XDK API  3.6.0
Documentation
Macros | Functions | Variables
LWM2MDnsUtil.c File Reference

This file provides the implementation of LWM2MDnsUtil module. More...

#include "XdkCommonInfo.h"
#include "LWM2MDnsUtil.h"
#include <Serval_Network.h>
#include <Serval_Ip.h>
#include <Serval_Clock.h>
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
#include "BCDS_WlanNetworkConfig.h"
+ Include dependency graph for LWM2MDnsUtil.c:

Macros

#define BCDS_MODULE_ID   XDK_COMMON_ID_LWM2MDNSUTIL
 
#define DNS_RETRY_INTERVAL_IN_MS   UINT16_C(100)
 
#define DNS_TASK_PRIORITY   UINT8_C(2)
 
#define DNS_TASK_STACK_SIZE   UINT16_C(512)
 
#define MUTEX_TIMEOUT   (100/(portTICK_PERIOD_MS))
 

Functions

static void LWM2MDnsTask (void *pvParameters)
 Task for asynchronous DNS lookup. If parameter is provided, it must point to a "int32_t" which contains the number of loops. If not provided (NULL) unlimited loops are executed. More...
 
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...
 

Variables

static void * LWM2MDnsUtilCallbackContext
 
static xSemaphoreHandle LWM2MDnsUtilMutexHandle
 
static LWM2MDnsUtil_Callback_T LWM2MDnsUtilResolvedCallback
 
static char LWM2MDnsUtilResolvedURL [128]
 
static xSemaphoreHandle LWM2MDnsUtilSemaHandle
 
static xTaskHandle LWM2MDnsUtilTaskHandle
 
static uint32_t LWM2MDnsUtilTimeout
 
static char LWM2MDnsUtilUrl [128]
 

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_COMMON_ID_LWM2MDNSUTIL
#define DNS_RETRY_INTERVAL_IN_MS   UINT16_C(100)

interval in milliseconds for lookup retries

#define DNS_TASK_PRIORITY   UINT8_C(2)

Task Priority for DNS Task

#define DNS_TASK_STACK_SIZE   UINT16_C(512)

TASK stack size for DNS Task

#define MUTEX_TIMEOUT   (100/(portTICK_PERIOD_MS))

timeout for mutex functions

Function Documentation

static void LWM2MDnsTask ( void *  pvParameters)
static
Parameters
pvParametersoptional pointer to number of loops.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

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  )

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 
)

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 
)

Refer interface header for description

+ Here is the caller graph for this function:

Variable Documentation

void* LWM2MDnsUtilCallbackContext
static

DNS context data, callback context

xSemaphoreHandle LWM2MDnsUtilMutexHandle
static

mutex to protect DNS context data for asynchronous lookup

LWM2MDnsUtil_Callback_T LWM2MDnsUtilResolvedCallback
static

DNS context data, resolved callback

char LWM2MDnsUtilResolvedURL[128]
static

DNS context data, resolved URL

xSemaphoreHandle LWM2MDnsUtilSemaHandle
static

semaphore to trigger asynchronous lookup

xTaskHandle LWM2MDnsUtilTaskHandle
static

task to execute asynchronous lookup

uint32_t LWM2MDnsUtilTimeout
static

DNS context data, retry timeout in seconds

char LWM2MDnsUtilUrl[128]
static

DNS context data, URL to be resolved


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