Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
lwm2mclient.c File Reference
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "ca-ot-util/cascoda_dns.h"
#include "cascoda-bm/cascoda_evbme.h"
#include "cascoda-bm/cascoda_serial.h"
#include "cascoda-bm/test15_4_evbme.h"
#include "cascoda-util/cascoda_rand.h"
#include "cascoda-util/cascoda_tasklet.h"
#include "openthread/cli.h"
#include "openthread/tasklet.h"
#include "liblwm2m.h"
#include "lwm2mclient.h"
#include "object_security.h"
#include "platform.h"
#include "sntp_helper.h"
#include "connection.h"
Include dependency graph for lwm2mclient.c:

Classes

struct  client_data_t
 

Macros

#define ARRAY_LENGTH(array)   (sizeof((array)) / sizeof((array)[0]))
 
#define DEFAULT_SERVER_IPV6   "[::1]"
 
#define OBJ_COUNT   9
 
#define BACKUP_OBJECT_COUNT   2
 

Functions

otInstance * get_ot_instance (void)
 Get the global ot instance. More...
 
void handle_value_changed (lwm2m_context_t *lwm2mH, lwm2m_uri_t *uri, const char *value, size_t valueLength)
 
void * lwm2m_connect_server (uint16_t secObjInstID, void *userData)
 
void lwm2m_close_connection (void *sessionH, void *userData)
 
void connection_rx_info_callback (uint16_t aPktLen)
 Callback that can be implemented by the application to track receive statistics. More...
 
void connection_tx_info_callback (uint16_t aPktLen)
 Callback that can be implemented by the application to track transmit statistics. More...
 
void print_usage (void)
 
int main (int argc, char *argv[])
 

Variables

lwm2m_object_t * objArray [OBJ_COUNT]
 
lwm2m_object_t * backupObjectArray [BACKUP_OBJECT_COUNT]
 
otInstance * OT_INSTANCE
 

Macro Definition Documentation

◆ ARRAY_LENGTH

#define ARRAY_LENGTH (   array)    (sizeof((array)) / sizeof((array)[0]))

◆ BACKUP_OBJECT_COUNT

#define BACKUP_OBJECT_COUNT   2

◆ DEFAULT_SERVER_IPV6

#define DEFAULT_SERVER_IPV6   "[::1]"

◆ OBJ_COUNT

#define OBJ_COUNT   9

Function Documentation

◆ connection_rx_info_callback()

void connection_rx_info_callback ( uint16_t  aPktLen)

Callback that can be implemented by the application to track receive statistics.

Parameters
aPktLenLength of the received packet

◆ connection_tx_info_callback()

void connection_tx_info_callback ( uint16_t  aPktLen)

Callback that can be implemented by the application to track transmit statistics.

Parameters
aPktLenLength of the received packet

◆ get_ot_instance()

otInstance* get_ot_instance ( void  )

Get the global ot instance.

Warning
The current implementation only supports a single OT instance to be used for lwm2m due architectural constraints within wakaama making it impossible to extract the lwm2m context from object callbacks. (On baremetal we only support a single openthread instance anyway)
Returns
The global ot instance.

◆ handle_value_changed()

void handle_value_changed ( lwm2m_context_t *  lwm2mH,
lwm2m_uri_t *  uri,
const char *  value,
size_t  valueLength 
)

◆ lwm2m_close_connection()

void lwm2m_close_connection ( void *  sessionH,
void *  userData 
)

◆ lwm2m_connect_server()

void* lwm2m_connect_server ( uint16_t  secObjInstID,
void *  userData 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ print_usage()

void print_usage ( void  )

Variable Documentation

◆ backupObjectArray

lwm2m_object_t* backupObjectArray[BACKUP_OBJECT_COUNT]

◆ objArray

lwm2m_object_t* objArray[OBJ_COUNT]