Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#include <stdio.h>
51#include <stdlib.h>
52#include <string.h>
53
54#include "liblwm2m.h"
55#include "lwm2m_client.h"
56#include "lwm2m_client_config.h"
57
89
106
117#ifndef CONFIG_LWM2M_DEVICE_NAME
118#define CONFIG_LWM2M_DEVICE_NAME "testRIOTDevice"
119#endif
120
124#ifndef CONFIG_LWM2M_DEVICE_MANUFACTURER
125#define CONFIG_LWM2M_DEVICE_MANUFACTURER "A RIOT maker"
126#endif
127
133#ifndef CONFIG_LWM2M_DEVICE_MODEL
134#define CONFIG_LWM2M_DEVICE_MODEL RIOT_BOARD
135#endif
136
140#ifndef CONFIG_LWM2M_DEVICE_SERIAL
141#define CONFIG_LWM2M_DEVICE_SERIAL "undefined"
142#endif
143
149#ifndef CONFIG_LWM2M_DEVICE_FW_VERSION
150#define CONFIG_LWM2M_DEVICE_FW_VERSION RIOT_VERSION
151#endif
152
167#ifdef DOXYGEN
171#define CONFIG_LWM2M_DEVICE_BINDING_U
172
176#define CONFIG_LWM2M_DEVICE_BINDING_UQ
177
181#define CONFIG_LWM2M_DEVICE_BINDING_S
182
186#define CONFIG_LWM2M_DEVICE_BINDING_SQ
187
191#define CONFIG_LWM2M_DEVICE_BINDING_US
192
196#define CONFIG_LWM2M_DEVICE_BINDING_UQS
197#endif
199
203#ifndef CONFIG_LWM2M_DEVICE_TYPE
204#define CONFIG_LWM2M_DEVICE_TYPE "RIOT device"
205#endif
206
212#ifndef CONFIG_LWM2M_DEVICE_HW_VERSION
213#define CONFIG_LWM2M_DEVICE_HW_VERSION RIOT_BOARD
214#endif
215
221#ifndef CONFIG_LWM2M_DEVICE_SW_VERSION
222#define CONFIG_LWM2M_DEVICE_SW_VERSION RIOT_VERSION
223#endif
225
231#if defined(CONFIG_LWM2M_DEVICE_BINDING_U)
232#define CONFIG_LWM2M_DEVICE_BINDINGS "U"
233#elif defined(CONFIG_LWM2M_DEVICE_BINDING_UQ)
234#define CONFIG_LWM2M_DEVICE_BINDINGS "UQ"
235#elif defined(CONFIG_LWM2M_DEVICE_BINDING_S)
236#define CONFIG_LWM2M_DEVICE_BINDINGS "S"
237#elif defined(CONFIG_LWM2M_DEVICE_BINDING_SQ)
238#define CONFIG_LWM2M_DEVICE_BINDINGS "SQ"
239#elif defined(CONFIG_LWM2M_DEVICE_BINDING_US)
240#define CONFIG_LWM2M_DEVICE_BINDINGS "US"
241#elif defined(CONFIG_LWM2M_DEVICE_BINDING_UQS)
242#define CONFIG_LWM2M_DEVICE_BINDINGS "UQS"
243#else
244#define CONFIG_LWM2M_DEVICE_BINDINGS "U"
245#endif
246
254lwm2m_object_t *lwm2m_object_device_init(lwm2m_client_data_t *client_data);
255
264
265#ifdef __cplusplus
266}
267#endif
268
lwm2m_device_resources
Resources of the LwM2M device object instance.
Definition device.h:63
lwm2m_device_error_codes
Error codes for the Error resource in the device object of LwM2M.
Definition device.h:95
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.
@ LWM2M_RES_HW_VERSION
Current hardware version of the device.
Definition device.h:82
@ LWM2M_DEVICE_RESOURCES
Number of resources.
Definition device.h:87
@ LWM2M_RES_REBOOT
Reboot the device.
Definition device.h:68
@ LWM2M_RES_ERROR_CODE
Last error code.
Definition device.h:75
@ LWM2M_RES_BINDINGS
Indicates supported bindings and modes on the client.
Definition device.h:80
@ LWM2M_RES_EXT_DEV_INFO
External device object instance.
Definition device.h:86
@ LWM2M_RES_FW_VER
Current firmware version of the device.
Definition device.h:67
@ LWM2M_RES_SERIAL
Serial number.
Definition device.h:66
@ LWM2M_RES_TIME_ZONE
Indicates the time zone of the device.
Definition device.h:79
@ LWM2M_RES_POWER_SRC
Available power sources.
Definition device.h:70
@ LWM2M_RES_MEM_TOTAL
Total amount of storage space in the device (kB.
Definition device.h:85
@ LWM2M_RES_SW_VERSION
Current software version on the device.
Definition device.h:83
@ LWM2M_RES_TYPE
Type of device.
Definition device.h:81
@ LWM2M_RES_POWER_VOL
Present voltage for each power source.
Definition device.h:71
@ LWM2M_RES_BATTERY_STATUS
Battery status when internal battery is present.
Definition device.h:84
@ LWM2M_RES_TIME_OFFSET
Indicated the UTC offset for the device.
Definition device.h:78
@ LWM2M_RES_FRESET
Perform a factory reset of the device.
Definition device.h:69
@ LWM2M_RES_POWER_AMP
Present current for each power source.
Definition device.h:72
@ LWM2M_RES_MEM_FREE
Estimated current available storage (kB)
Definition device.h:74
@ LWM2M_RES_MANUFACTURER
Human readable manufacturer name.
Definition device.h:64
@ LWM2M_RES_MODEL_NO
Model identifier (manufacturer specified string)
Definition device.h:65
@ LWM2M_RES_TIME
Current UNIX time of the client.
Definition device.h:77
@ LWM2M_RES_ERROR_CODE_RESET
Delete all error code instances.
Definition device.h:76
@ LWM2M_RES_BATTERY_LEVEL
Current battery level as a percentage.
Definition device.h:73
@ LWM2M_DEVICE_ERR_NO_ERR
No error.
Definition device.h:96
@ LWM2M_DEVICE_ERR_SMS_ERR
SMS failure.
Definition device.h:102
@ LWM2M_DEVICE_ERR_LOW_SIGNAL
Low received signal strength.
Definition device.h:100
@ LWM2M_DEVICE_ERR_NO_MEM
Out of memory.
Definition device.h:101
@ LWM2M_DEVICE_ERR_EXT_OFF
External power supply off.
Definition device.h:98
@ LWM2M_DEVICE_ERR_GPS_ERR
GPS module failure.
Definition device.h:99
@ LWM2M_DEVICE_ERR_IP_ERR
IP connectivity failure.
Definition device.h:103
@ LWM2M_DEVICE_ERR_LOW_BATT
Low battery power.
Definition device.h:97
@ LWM2M_DEVICE_ERR_PERIPH_ERR
Peripheral malfunction.
Definition device.h:104
Definitions and public API for a LwM2M client using Wakaama.
LwM2M client configurations.
LwM2M client descriptor.