XDK API  3.6.0
Documentation
Macros | Typedefs | Functions
LWM2MDnsUtil.h File Reference

Interface header for LWM2MDnsUtil file. More...

#include <Serval_Types.h>
+ Include dependency graph for LWM2MDnsUtil.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define DNS_TIMEOUT_IN_S   UINT32_C(5)
 
#define RC_DNS_BUSY   ((retcode_t)(0x01 | RC_MODULE_DNS | RC_SEVERITY_MINOR))
 
#define RC_DNS_OK   RC_OK
 
#define RC_DNS_PENDING   ((retcode_t)(0x02 | RC_MODULE_DNS | RC_SEVERITY_MINOR))
 
#define RC_MODULE_DNS   (0x1B << RC_SHIFT_MODULE)
 

Typedefs

typedef void(* LWM2MDnsUtil_Callback_T )(retcode_t rc, const char *resolvedURL, void *context)
 Callback for asynchronous DNS lookup. More...
 

Functions

retcode_t LWM2MDnsUtil_ExtendedResolveHostname (const char *const URL, char *const resolvedURL, const size_t sizeResolvedURL, uint32_t timeout, const LWM2MDnsUtil_Callback_T callback, void *context)
 Extended resolve URL. If URL uses literal host (e.g. "192.168.1.10"), the URL is just copied to provided resolvedURL buffer. Otherwise, either synchronous, if no callback is provided (NULL), or asynchronous, if callback is provided. More...
 
retcode_t LWM2MDnsUtil_Init (void)
 Initialize DNS module. More...
 
retcode_t LWM2MDnsUtil_ResolveHostname (const char *const URL, char *const resolvedURL, const size_t sizeResolvedURL, uint32_t timeout)
 Resolve URL. More...
 
retcode_t LWM2MDnsUtil_StartResolveHostname (const char *const URL, uint32_t timeout, const LWM2MDnsUtil_Callback_T callback, void *context)
 Start asynchronous DNS lookup. Report result using the callback. More...
 

Macro Definition Documentation

#define DNS_TIMEOUT_IN_S   UINT32_C(5)

timeout for repeat DNS lookup. Note, the DNS lookup may take longer but it's not repeated then!

#define RC_DNS_BUSY   ((retcode_t)(0x01 | RC_MODULE_DNS | RC_SEVERITY_MINOR))

DNS lookup busy by already pending lookup

#define RC_DNS_OK   RC_OK

DNS lookup OK

#define RC_DNS_PENDING   ((retcode_t)(0x02 | RC_MODULE_DNS | RC_SEVERITY_MINOR))

DNS lookup pending. Result will be reported by callback

#define RC_MODULE_DNS   (0x1B << RC_SHIFT_MODULE)

MODULE code for DNS

Typedef Documentation

typedef void(* LWM2MDnsUtil_Callback_T)(retcode_t rc, const char *resolvedURL, void *context)
Parameters
rcRC_OK, if DNS lookup was successful, false, otherwise.
resolvedURLresolved URL, if rc is RC_OK
contextcontext provided when call Dns_StartResolveHostname or Dns_ExtendedResolveHostname

Function Documentation

retcode_t LWM2MDnsUtil_ExtendedResolveHostname ( const char *const  URL,
char *const  resolvedURL,
const size_t  sizeResolvedURL,
uint32_t  timeout,
const LWM2MDnsUtil_Callback_T  callback,
void *  context 
)
Parameters
URLurl to resolve. Format "[proto://]host[:port][/path]".
resolvedURLbuffer for resolved url, if URL contains literal host or callback is NULL
sizeResolvedURLsize of buffer for resolved url, if URL contains literal host or callback is NULL
timeoutretry timeout in seconds
callbackcallback for result, if asynchronous lookup should be executed.
contextcontext for callback.
Returns
RC_DNS_OK, if url was resolved successfully, RC_DNS_PENDING, when starting was successful, RC_DNS_BUSY, when asynchronous DNS lookup is already pending, and RC_PLATFORM_ERROR in case of an error.*

Refer interface header for description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

retcode_t LWM2MDnsUtil_Init ( void  )
Note
Must be called before any other function of this module.
Returns
RC_OK, if successful, false, otherwise.

Refer interface header for description

+ Here is the call graph for this function:

retcode_t LWM2MDnsUtil_ResolveHostname ( const char *const  URL,
char *const  resolvedURL,
const size_t  sizeResolvedURL,
uint32_t  timeout 
)
Parameters
URLurl to resolve
resolvedURLbuffer for resolved url
sizeResolvedURLsize of buffer for resolved url.
timeoutretry timeout in seconds
Returns
RC_DNS_OK, if url was resolved successfully RC_PLATFORM_ERROR, if an error occurred.

Refer interface header for description

+ Here is the call graph for this function:

retcode_t LWM2MDnsUtil_StartResolveHostname ( const char *const  URL,
uint32_t  timeout,
const LWM2MDnsUtil_Callback_T  callback,
void *  context 
)
Parameters
URLurl to resolve
timeouttimeout for retries.
callbackcallback for result
contextcontext to be passed to callback.
Returns
RC_DNS_PENDING, when starting was successful, RC_DNS_BUSY, when asynchronous DNS lookup is already pending, and RC_PLATFORM_ERROR in case of an error.

Refer interface header for description

+ Here is the caller graph for this function:


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:40 by doxygen 1.8.8