Loading...
Searching...
No Matches

Detailed Description

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "liblwm2m.h"
#include "lwm2m_client.h"
#include "lwm2m_client_config.h"
+ Include dependency graph for device.h:

Go to the source code of this file.

Macros

#define CONFIG_LWM2M_DEVICE_NAME   "testRIOTDevice"
 Device name used to register at the LwM2M server.
 
#define CONFIG_LWM2M_DEVICE_MANUFACTURER   "A RIOT maker"
 Device object manufacturer string.
 
#define CONFIG_LWM2M_DEVICE_MODEL   RIOT_BOARD
 Device object model.
 
#define CONFIG_LWM2M_DEVICE_SERIAL   "undefined"
 Device object serial number.
 
#define CONFIG_LWM2M_DEVICE_FW_VERSION   RIOT_VERSION
 Device object firmware version.
 
#define CONFIG_LWM2M_DEVICE_TYPE   "RIOT device"
 Device object device type.
 
#define CONFIG_LWM2M_DEVICE_HW_VERSION   RIOT_BOARD
 Device object hardware version.
 
#define CONFIG_LWM2M_DEVICE_SW_VERSION   RIOT_VERSION
 Device object software version.
 
#define CONFIG_LWM2M_DEVICE_BINDINGS   "U"
 Device binding and queue mode.
 

Enumerations

enum  lwm2m_device_resources {
  LWM2M_RES_MANUFACTURER = 0 , LWM2M_RES_MODEL_NO , LWM2M_RES_SERIAL , LWM2M_RES_FW_VER ,
  LWM2M_RES_REBOOT , LWM2M_RES_FRESET , LWM2M_RES_POWER_SRC , LWM2M_RES_POWER_VOL ,
  LWM2M_RES_POWER_AMP , LWM2M_RES_BATTERY_LEVEL , LWM2M_RES_MEM_FREE , LWM2M_RES_ERROR_CODE ,
  LWM2M_RES_ERROR_CODE_RESET , LWM2M_RES_TIME , LWM2M_RES_TIME_OFFSET , LWM2M_RES_TIME_ZONE ,
  LWM2M_RES_BINDINGS , LWM2M_RES_TYPE , LWM2M_RES_HW_VERSION , LWM2M_RES_SW_VERSION ,
  LWM2M_RES_BATTERY_STATUS , LWM2M_RES_MEM_TOTAL , LWM2M_RES_EXT_DEV_INFO , LWM2M_DEVICE_RESOURCES
}
 Resources of the LwM2M device object instance. More...
 
enum  lwm2m_device_error_codes {
  LWM2M_DEVICE_ERR_NO_ERR = 0 , LWM2M_DEVICE_ERR_LOW_BATT = 1 , LWM2M_DEVICE_ERR_EXT_OFF = 2 , LWM2M_DEVICE_ERR_GPS_ERR = 3 ,
  LWM2M_DEVICE_ERR_LOW_SIGNAL = 4 , LWM2M_DEVICE_ERR_NO_MEM = 5 , LWM2M_DEVICE_ERR_SMS_ERR = 6 , LWM2M_DEVICE_ERR_IP_ERR = 7 ,
  LWM2M_DEVICE_ERR_PERIPH_ERR = 8
}
 Error codes for the Error resource in the device object of LwM2M. More...
 

Functions

lwm2m_object_t * lwm2m_object_device_init (lwm2m_client_data_t *client_data)
 Initialize the Device object.
 
bool lwm2m_device_reboot_requested (void)
 Determines if a reboot request has been issued to the device by a server.
 

Device bindings and queue modes

This options are meant to be set either via Kconfig or CFLAGS:

CFLAGS += -DCONFIG_LWM2M_DEVICE_BINDING_UQ
Note
Only one option should be selected. If more than one is defined the priority follows this order. By default CONFIG_LWM2M_DEVICE_BINDING_U is assumed.
#define CONFIG_LWM2M_DEVICE_BINDING_U
 UDP binding.
 
#define CONFIG_LWM2M_DEVICE_BINDING_UQ
 UDP binding with Queue mode.
 
#define CONFIG_LWM2M_DEVICE_BINDING_S
 SMS binding.
 
#define CONFIG_LWM2M_DEVICE_BINDING_SQ
 SMS binding with Queue mode.
 
#define CONFIG_LWM2M_DEVICE_BINDING_US
 UDP and SMS bindings.
 
#define CONFIG_LWM2M_DEVICE_BINDING_UQS
 UDP and SMS bindings with Queue mode.