21#ifndef __APPS_INCLUDE_LTE_LTE_LWM2M_H
22#define __APPS_INCLUDE_LTE_LTE_LWM2M_H
34#include <nuttx/config.h>
71#define LWM2MSTUB_RESOURCE_HANDLENOCARE (0)
73#define LWM2MSTUB_RESOURCE_HANDLEHOST (1)
75#define LWM2MSTUB_RESOURCE_HANDLEMODEMH (2)
86#define LWM2MSTUB_MAX_WRITE_SIZE (1500)
88#define LWM2MSTUB_MAX_TOKEN_SIZE (8 * 2 + 1)
90#define LWM2MSTUB_MAX_SERVER_NAME (256)
92#define LWM2MSTUB_MAX_DEVID (256)
94#define LWM2MSTUB_MAX_SEQKEY (256)
106#define LWM2MSTUB_CONDVALID_MINPERIOD (1<<0)
109#define LWM2MSTUB_CONDVALID_MAXPERIOD (1<<1)
112#define LWM2MSTUB_CONDVALID_GRATERTHAN (1<<2)
115#define LWM2MSTUB_CONDVALID_LESSTHAN (1<<3)
118#define LWM2MSTUB_CONDVALID_STEP (1<<4)
129#define LWM2MSTUB_FWUP_PEND_DL (0)
131#define LWM2MSTUB_FWUP_PEND_UPD (1)
133#define LWM2MSTUB_FWUP_COMP_DL (2)
135#define LWM2MSTUB_FWUP_FAIL_DL (3)
137#define LWM2MSTUB_FWUP_CANCELED (4)
148#define LWM2MSTUB_CMD_REGISTER (0)
150#define LWM2MSTUB_CMD_DEREGISTER (1)
152#define LWM2MSTUB_CMD_UPDATERESIGER (2)
163#define LWM2MSTUB_STATE_NOTREGISTERD (0)
165#define LWM2MSTUB_STATE_REGISTPENDING (1)
167#define LWM2MSTUB_STATE_REGISTERD (2)
169#define LWM2MSTUB_STATE_REGISTERFAILED (3)
171#define LWM2MSTUB_STATE_UPDATEPENDING (4)
173#define LWM2MSTUB_STATE_DEREGISTPENDING (5)
175#define LWM2MSTUB_STATE_BSHOLDOFF (6)
177#define LWM2MSTUB_STATE_BSREQUESTED (7)
179#define LWM2MSTUB_STATE_BSONGOING (8)
181#define LWM2MSTUB_STATE_BSDONE (9)
183#define LWM2MSTUB_STATE_BSFAILED (10)
194#define LWM2MSTUB_RESOP_READ (0)
196#define LWM2MSTUB_RESOP_WRITE (1)
198#define LWM2MSTUB_RESOP_RW (2)
200#define LWM2MSTUB_RESOP_EXEC (3)
211#define LWM2MSTUB_RESINST_SINGLE (0)
213#define LWM2MSTUB_RESINST_MULTI (1)
224#define LWM2MSTUB_RESDATA_NONE (0)
226#define LWM2MSTUB_RESDATA_STRING (1)
228#define LWM2MSTUB_RESDATA_INT (2)
230#define LWM2MSTUB_RESDATA_UNSIGNED (3)
232#define LWM2MSTUB_RESDATA_FLOAT (4)
234#define LWM2MSTUB_RESDATA_BOOL (5)
236#define LWM2MSTUB_RESDATA_OPAQUE (6)
238#define LWM2MSTUB_RESDATA_TIME (7)
240#define LWM2MSTUB_RESDATA_OBJLINK (8)
251#define LWM2MSTUB_SECUREMODE_PSK (0)
253#define LWM2MSTUB_SECUREMODE_RPK (1)
255#define LWM2MSTUB_SECUREMODE_CERT (2)
257#define LWM2MSTUB_SECUREMODE_NOSEC (3)
259#define LWM2MSTUB_SECUREMODE_CERTEST (4)
270#define LWM2MSTUB_CONNECT_REGISTER (0)
272#define LWM2MSTUB_CONNECT_DEREGISTER (1)
274#define LWM2MSTUB_CONNECT_REREGISTER (2)
276#define LWM2MSTUB_CONNECT_BOOTSTRAP (3)
287#define LWM2MSTUB_RESP_CHANGED (0)
289#define LWM2MSTUB_RESP_CONTENT (1)
291#define LWM2MSTUB_RESP_BADREQ (2)
293#define LWM2MSTUB_RESP_UNAUTH (3)
295#define LWM2MSTUB_RESP_NOURI (4)
297#define LWM2MSTUB_RESP_NOTALLOW (5)
299#define LWM2MSTUB_RESP_NOTACCEPT (6)
301#define LWM2MSTUB_RESP_UNSUPPORT (7)
303#define LWM2MSTUB_RESP_INTERNALERROR (8)
314#define LWM2MSTUB_OP_WRITE (0)
316#define LWM2MSTUB_OP_EXEC (1)
318#define LWM2MSTUB_OP_WATTR (4)
320#define LWM2MSTUB_OP_DISCOVER (5)
322#define LWM2MSTUB_OP_READ (6)
324#define LWM2MSTUB_OP_OBSERVE (7)
326#define LWM2MSTUB_OP_CANCELOBS (8)
328#define LWM2MSTUB_OP_OFFLINE (9)
330#define LWM2MSTUB_OP_ONLINE (10)
332#define LWM2MSTUB_OP_SENDNOTICE (11)
334#define LWM2MSTUB_OP_RCVWUP (12)
336#define LWM2MSTUB_OP_RCVOBSACK (13)
340#define LWM2MSTUB_OP_CLIENTON (14)
342#define LWM2MSTUB_OP_CLIENTOFF (15)
344#define LWM2MSTUB_OP_FAILNOTIFY (16)
346#define LWM2MSTUB_OP_BSFINISH (20)
351#define LWM2MSTUB_OP_REGSUCCESS (21)
353#define LWM2MSTUB_OP_REGUPDATED (22)
355#define LWM2MSTUB_OP_DEREGSUCCESS (23)
357#define LWM2MSTUB_OP_NOSENDNOTICE (24)
789 int resp, FAR
char *readvalue,
int len);
845int lte_m2m_observeupdate(FAR
char *token,
847 FAR
char *value,
int len);
void(* lwm2mstub_read_cb_t)(int seq_no, int srv_id, FAR struct lwm2mstub_instance_s *inst)
Read request call back function type.
Definition: lte_lwm2m.h:447
void(* lwm2mstub_ovstart_cb_t)(int seq_no, int srv_id, FAR struct lwm2mstub_instance_s *inst, FAR char *token, FAR struct lwm2mstub_ovcondition_s *cond)
Observe start request call back function type.
Definition: lte_lwm2m.h:473
void(* lwm2mstub_ovstop_cb_t)(int seq_no, int srv_id, FAR struct lwm2mstub_instance_s *inst, FAR char *token)
Observation stop request call back function type.
Definition: lte_lwm2m.h:487
void(* lwm2mstub_write_cb_t)(int seq_no, int srv_id, FAR struct lwm2mstub_instance_s *inst, FAR char *value, int len)
Write request call back function type.
Definition: lte_lwm2m.h:435
void(* lwm2mstub_fwupstate_cb_t)(int event)
Firmware update call back function type.
Definition: lte_lwm2m.h:509
void(* lwm2mstub_operation_cb_t)(int event, int srv_id, FAR struct lwm2mstub_instance_s *inst)
Server operation call back function type.
Definition: lte_lwm2m.h:499
void(* lwm2mstub_exec_cb_t)(int seq_no, int srv_id, FAR struct lwm2mstub_instance_s *inst)
Execution request call back function type.
Definition: lte_lwm2m.h:459
double lt_cond
Definition: lte_lwm2m.h:396
int lte_set_report_m2moperation(lwm2mstub_operation_cb_t cb)
Register callback function pointer for server operation.
int lte_set_report_m2movstop(lwm2mstub_ovstop_cb_t cb)
Register callback function pointer for observation stop request.
double gt_cond
Definition: lte_lwm2m.h:395
int lte_set_report_m2mwrite(lwm2mstub_write_cb_t cb)
Register callback function pointer for write request.
unsigned int max_period
Definition: lte_lwm2m.h:394
int res_id
Definition: lte_lwm2m.h:367
int lte_set_report_m2mexec(lwm2mstub_exec_cb_t cb)
Register callback function pointer for execute request.
int lte_set_report_m2movstart(lwm2mstub_ovstart_cb_t cb)
Register callback function pointer for observation start request.
int res_inst
Definition: lte_lwm2m.h:383
int operation
Definition: lte_lwm2m.h:368
unsigned int min_period
Definition: lte_lwm2m.h:393
int object_id
Definition: lte_lwm2m.h:380
int data_type
Definition: lte_lwm2m.h:370
uint32_t lifetime
Definition: lte_lwm2m.h:411
int security_mode
Definition: lte_lwm2m.h:410
int lte_m2m_executeresp(int seq_no, FAR struct lwm2mstub_instance_s *inst, int resp)
Response result of execute request to the server.
double step_val
Definition: lte_lwm2m.h:397
bool bootstrap
Definition: lte_lwm2m.h:408
int lte_set_report_m2mread(lwm2mstub_read_cb_t cb)
Register callback function pointer for read request.
int state
Definition: lte_lwm2m.h:407
int lte_m2m_writeresponse(int seq_no, FAR struct lwm2mstub_instance_s *inst, int resp)
Response result of write request to the server.
bool nonip
Definition: lte_lwm2m.h:409
int lte_m2m_readresponse(int seq_no, FAR struct lwm2mstub_instance_s *inst, int resp, FAR char *readvalue, int len)
Response result of read request to the server.
char security_key[LWM2MSTUB_MAX_SEQKEY]
Definition: lte_lwm2m.h:414
int lte_m2m_connection(int cmd)
Control connection to server.
uint8_t valid_mask
Definition: lte_lwm2m.h:392
int inst_type
Definition: lte_lwm2m.h:369
int object_inst
Definition: lte_lwm2m.h:381
char server_uri[LWM2MSTUB_MAX_SERVER_NAME]
Definition: lte_lwm2m.h:412
int lte_set_report_m2mfwupdate(lwm2mstub_fwupstate_cb_t cb)
Register callback function pointer for firmware update status.
int handl
Definition: lte_lwm2m.h:371
char device_id[LWM2MSTUB_MAX_DEVID]
Definition: lte_lwm2m.h:413
int lte_m2m_observeresp(int seq_no, int resp)
Response result of observation start/stop request to the server.
int lte_getm2m_enabled_objectnum(void)
Get enabled objects number.
int lte_setm2m_objectdefinition(uint16_t objids, int res_num, FAR struct lwm2mstub_resource_s *reses)
Configure the resources of the object.
int lte_setm2m_qmode(bool en)
Set Queue mode of LwM2M.
int lte_setm2m_endpointname(FAR char *name)
Set endpoint name.
int lte_getm2m_servernum(void)
Get Server num.
int lte_getm2m_endpointname(FAR char *name, int len)
Get endpoint name.
bool lte_getm2m_qmode(void)
Get current Queue mode of LwM2M.
int lte_apply_m2msetting(void)
Activate all configurations.
int lte_enablem2m_objects(FAR uint16_t *objids, int objnum)
Enable objects.
int lte_getm2m_enabled_objects(FAR uint16_t *objids, int objnum)
Get object IDs of currently active objects.
int lte_getm2m_objresourceinfo(uint16_t objids, int res_num, FAR struct lwm2mstub_resource_s *reses)
Get the information of resources on the object.
int lte_setm2m_serverinfo(FAR struct lwm2mstub_serverinfo_s *info, int id)
Server configuration.
int lte_getm2m_serverinfo(FAR struct lwm2mstub_serverinfo_s *info, int id)
Get server configuration.
int lte_getm2m_objresourcenum(uint16_t objid)
Get resource number on the object.
#define LWM2MSTUB_MAX_DEVID
Max device id length in lwm2mstub_serverinfo_s.
Definition: lte_lwm2m.h:92
#define LWM2MSTUB_MAX_SERVER_NAME
Max server name length in lwm2mstub_serverinfo_s.
Definition: lte_lwm2m.h:90
#define LWM2MSTUB_MAX_SEQKEY
Max security key length in lwm2mstub_serverinfo_s.
Definition: lte_lwm2m.h:94
Definition: lte_lwm2m.h:379
Definition: lte_lwm2m.h:391
Definition: lte_lwm2m.h:366
Definition: lte_lwm2m.h:405