XDK API  3.6.0
Documentation
Files | Macros | Functions | Variables
Lwm2mExampleClient

LWM2M Client for connecting to a LWM2M server. More...

+ Collaboration diagram for Lwm2mExampleClient:

Files

file  AppController.c
 

Macros

#define APP_RESPONSE_FROM_SNTP_SERVER_TIMEOUT   UINT32_C(10000)
 
#define APP_SYNC_TIME_INTERVAL_MAX_MS   UINT32_C(1800000)
 
#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
 

Functions

void AppController_Init (void *cmdProcessorHandle, uint32_t param2)
 Gives control to the Application controller. More...
 
static void AppControllerEnable (void *param1, uint32_t param2)
 To enable the necessary modules for the application. More...
 
static void AppControllerFire (void *pvParameters)
 Responsible for controlling the LWM2M Example client control flow. More...
 
static void AppControllerSetup (void *param1, uint32_t param2)
 To setup the necessary modules for the application. More...
 
void AppControllerSyncSNTP (void)
 This will synchronizing the SNTP server time with the node. More...
 
static void AppLWM2MStatusNotificationCB (LWM2M_StatusNotification_T status)
 

Variables

static CmdProcessor_TAppCmdProcessor
 
static xTaskHandle AppControllerHandle = NULL
 
static LWM2M_Setup_T Lwm2mSetup
 
static SNTP_Setup_T SNTPSetupInfo
 
static WLAN_Setup_T WLANSetupInfo
 

Detailed Description

This module will act as the client of the LWM2M protocol.

This example demonstrates how to register with a LWM2M Server including the standard LWM2M Objects. Insecure and encrypted communication are supported. The example will connect to the leshan.eclipse.org LWM2M Server.

You need to enter your WLAN-Credentials in AppController.h. Once the XDK is connected to the network and to the Leshan Server the orange LED will turn on. From the website you can now click on the desired client and read the objects.

LeshanClient.png
Leshan Client – User Interface to the Leshan Server; Object Read

Macro Definition Documentation

#define APP_RESPONSE_FROM_SNTP_SERVER_TIMEOUT   UINT32_C(10000)

Timeout for SNTP server time sync

#define APP_SYNC_TIME_INTERVAL_MAX_MS   UINT32_C(1800000)

APP_SYNC_TIME_INTERVAL_MAX_MS is the synchronization time with SNTP server.

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER

Function Documentation

void AppController_Init ( void *  cmdProcessorHandle,
uint32_t  param2 
)

This is a template function where the user can write his custom application.

Refer interface header for description

+ Here is the call graph for this function:

static void AppControllerEnable ( void *  param1,
uint32_t  param2 
)
static
  • LED
  • WLAN
  • ServalPAL
  • SNTP
  • Lwm2m
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerFire ( void *  pvParameters)
static
Parameters
[in]pvParametersFreeRTOS task handle. Could be used if more than one thread is using this function block.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerSetup ( void *  param1,
uint32_t  param2 
)
static
  • LED
  • WLAN
  • ServalPAL
  • SNTP
  • Lwm2m
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AppControllerSyncSNTP ( void  )

+ Here is the call graph for this function:

static void AppLWM2MStatusNotificationCB ( LWM2M_StatusNotification_T  status)
static

Refer function prototype for description

+ Here is the call graph for this function:

Variable Documentation

CmdProcessor_T* AppCmdProcessor
static

Handle to store the main Command processor handle to be reused by ServalPAL thread

xTaskHandle AppControllerHandle = NULL
static

OS thread handle for Application controller to be used by run-time blocking threads

LWM2M_Setup_T Lwm2mSetup
static
Initial value:
=
{
.CmdProcessorHandle = NULL,
.SecurityPreSharedKey =
{
},
.EndPointName = APP_LWM2M_END_POINT_NAME,
.Binding = "U",
.ConfirmableNotification = false,
.MACAddr = NULL,
.TestMode = LWM2M_TEST_MODE_YES,
.ServerURL = APP_LWM2M_SERVER_URL,
.ServerPort = APP_LWM2M_SERVER_PORT,
.ClientPort = APP_LWM2M_CLIENT_PORT,
.StatusNotificationCB = AppLWM2MStatusNotificationCB,
}
#define APP_LWM2M_END_POINT_NAME
Definition: AppController.h:174
#define APP_LWM2M_DTLS_PSK_KEY_LENGTH
Definition: AppController.h:154
Definition: XDK_LWM2M.h:147
#define NULL
Definition: BCDS_Basics.h:80
#define APP_LWM2M_DTLS_PSK_IDENTITY
Definition: AppController.h:141
Definition: XDK_LWM2M.h:80
#define APP_LWM2M_DTLS_PSK_KEY
Definition: AppController.h:148
#define APP_LWM2M_SERVER_URL
Definition: AppController.h:131
static void AppLWM2MStatusNotificationCB(LWM2M_StatusNotification_T status)
Definition: AppController.c:155
#define APP_LWM2M_SECURITY_ENABLE
Definition: AppController.h:123
#define APP_LWM2M_LIFETIME_IN_SECONDS
Definition: AppController.h:184
#define APP_LWM2M_SERVER_PORT
Definition: AppController.h:179
#define APP_LWM2M_CLIENT_PORT
Definition: AppController.h:136

Lwm2m setup parameters

SNTP_Setup_T SNTPSetupInfo
static
Initial value:
=
{
.ServerUrl = SNTP_SERVER_URL,
.ServerPort = SNTP_SERVER_PORT,
}
#define SNTP_SERVER_PORT
Definition: AppController.h:120
#define SNTP_SERVER_URL
Definition: AppController.h:115

SNTP setup parameters

WLAN_Setup_T WLANSetupInfo
static
Initial value:
=
{
.IsEnterprise = false,
.IsHostPgmEnabled = false,
.SSID = WLAN_SSID,
.Username = WLAN_PSK,
.Password = WLAN_PSK,
.IsStatic = WLAN_STATIC_IP,
.IpAddr = WLAN_IP_ADDR,
.GwAddr = WLAN_GW_ADDR,
.DnsAddr = WLAN_DNS_ADDR,
.Mask = WLAN_MASK,
}
#define WLAN_DNS_ADDR
Definition: AppController.h:101
#define WLAN_PSK
Definition: AppController.h:75
#define WLAN_GW_ADDR
Definition: AppController.h:94
#define WLAN_IP_ADDR
Definition: AppController.h:87
#define WLAN_SSID
Definition: AppController.h:69
#define WLAN_STATIC_IP
Definition: AppController.h:80
#define WLAN_MASK
Definition: AppController.h:108

WLAN setup parameters


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:54 by doxygen 1.8.8