m2mb API docs  30.00.007
m2mb API sets documentation
m2mb_lwm2m.h File Reference

Header file for m2mb_lwm2m APIs. More...

Go to the source code of this file.

Data Structures

struct  M2MB_LWM2M_ENABLE_REQ_T
 
struct  M2MB_LWM2M_ACK_REQ_T
 
struct  M2MB_LWM2M_OBJ_URI_T
 
struct  M2MB_LWM2M_OBJ_LINK_T
 
struct  M2MB_LWM2M_STS_URI_T
 
struct  M2MB_LWM2M_KEYS_T
 
struct  M2MB_LWM2M_RES_T
 
struct  M2MB_LWM2M_ENABLE_RES_T
 
struct  M2MB_LWM2M_DISABLE_RES_T
 
struct  M2MB_LWM2M_ACK_RES_T
 
struct  M2MB_LWM2M_READ_RES_T
 
struct  M2MB_LWM2M_WRITE_RES_T
 
struct  M2MB_LWM2M_EXEC_RES_T
 
struct  M2MB_LWM2M_SET_RES_T
 
struct  M2MB_LWM2M_GET_RES_T
 
struct  M2MB_LWM2M_GET_STAT_RES_T
 
struct  M2MB_LWM2M_STS_RES_T
 
struct  M2MB_LWM2M_GET_TYPE_RES_T
 
struct  M2MB_LWM2M_CONN_REQ_IND_T
 
struct  M2MB_LWM2M_SESSION_END_IND_T
 
struct  M2MB_LWM2M_INFO_IND_T
 
struct  M2MB_LWM2M_SRV_INFO_IND_T
 
struct  M2MB_LWM2M_MON_REQ_T
 
struct  M2MB_LWM2M_MON_RES_T
 
struct  M2MB_LWM2M_MON_INFO_IND_T
 
struct  M2MB_LWM2M_NEW_INST_REQ_T
 
struct  M2MB_LWM2M_NEW_INST_RES_T
 
struct  M2MB_LWM2M_NFYACK_STATUS_RES_T
 
struct  M2MB_LWM2M_NFYACK_URI_RES_T
 
struct  M2MB_LWM2M_NFYACK_LIST_RES_T
 
struct  M2MB_LWM2M_NFYACK_INFO_IND_T
 
struct  M2MB_LWM2M_FOTA_CFG_REQ_T
 the m2mb_lwm2m_fota_cfg request data structure More...
 
struct  M2MB_LWM2M_FOTA_CFG_RES_T
 the m2mb_lwm2m_fota_cfg response data structure More...
 
struct  M2MB_LWM2M_FOTA_ACK_REQ_T
 the m2mb_lwm2m_fota_ack request data structure More...
 
struct  M2MB_LWM2M_FOTA_ACK_RES_T
 the m2mb_lwm2m_fota_ack response data structure More...
 

Macros

#define LWM2M_STRING_MAX_LENGTH   ( 20 ) /* max length allowed for the strings reporting client status, primitives etc. */
 
#define LWM2M_STAT_STRING_MAX_LENGTH   ( 10 ) /* max length allowed for the STAT string */
 
#define LWM2M_STS_ISBSTSRV_MAX_VALUE   ( 1 ) /* max value allowed for isBootstrapServer */
 
#define LWM2M_STS_EXTRA_CHARS_IN_URL   ( 3 ) /* extra chars for comma, isBstServer and string terminator, to be appended to URL */
 
#define LWM2M_STS_MIN_DATA_SIZE   ( 128 ) /* extra chars for comma, isBstServer and string terminator, to be appended to URL */
 
#define M2MB_LWM2M_ONE_BYTE   ( 1 )
 
#define M2MB_LWM2M_MAX_ENDPOINT_NAME_LEN   ( 64 ) /* max Endpoint Name length */
 
#define M2MB_LWM2M_DTLS_PSK_MAX_KEY_LEN   ( 64 ) /* max key length */
 

Typedefs

typedef HANDLE M2MB_LWM2M_HANDLE
 
typedef void(* m2mb_lwm2m_ind_callback) (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata)
 

Enumerations

enum  M2MB_LWM2M_URI_LENGTH_E {
  M2MB_LWM2M_URI_0_FIELDS = 0, M2MB_LWM2M_URI_1_FIELDS, M2MB_LWM2M_URI_2_FIELDS, M2MB_LWM2M_URI_3_FIELDS,
  M2MB_LWM2M_URI_4_FIELDS, M2MB_LWM2M_URI_MAX_NUM
}
 
enum  M2MB_LWM2M_EN_MODE_E { M2MB_LWM2M_MODE_NO_ACK, M2MB_LWM2M_MODE_ACK, M2MB_LWM2M_MODE_MAX_NUM }
 
enum  M2MB_LWM2M_ACK_ACTION_E { M2MB_LWM2M_ACTION_ACK = 1, M2MB_LWM2M_ACTION_DEFER, M2MB_LWM2M_ACTION_MAX_NUM }
 
enum  M2MB_LWM2MENA_CMD_TYPE_E { M2MB_LWM2MENA_CMD_TYPE_SET = 0, M2MB_LWM2MENA_CMD_TYPE_READ, M2MB_LWM2MENA_CMD_TYPE_MAX_NUM }
 
enum  M2MB_LWM2M_EVENT_E {
  M2MB_LWM2M_ENABLE_RES = 0, M2MB_LWM2M_DISABLE_RES, M2MB_LWM2M_ACK_RES, M2MB_LWM2M_READ_RES,
  M2MB_LWM2M_WRITE_RES, M2MB_LWM2M_EXEC_RES, M2MB_LWM2M_SET_RES, M2MB_LWM2M_GET_RES,
  M2MB_LWM2M_GET_STAT_RES, M2MB_LWM2M_STS_RES, M2MB_LWM2M_MON_RES, M2MB_LWM2M_NEW_INST_RES,
  M2MB_LWM2M_NFYACK_STATUS_RES, M2MB_LWM2M_NFYACK_URI_RES, M2MB_LWM2M_NFYACK_LIST_RES, M2MB_LWM2M_GET_TYPE_RES,
  M2MB_LWM2M_FOTA_CFG_RES, M2MB_LWM2M_FOTA_ACK_RES, M2MB_LWM2M_INJKEYS_RES, M2MB_LWM2M_UPD_REG_IND = 30,
  M2MB_LWM2M_SMS_PUSH_IND, M2MB_LWM2M_NOTIFY_IND, M2MB_LWM2M_NOTIFY_MON_IND, M2MB_LWM2M_CONN_REQ_IND = 60,
  M2MB_LWM2M_SESSION_END_IND, M2MB_LWM2M_SESSION_INFO_IND, M2MB_LWM2M_SRV_INFO_IND, M2MB_LWM2M_MON_INFO_IND,
  M2MB_LWM2M_NFYACK_INFO_IND, M2MB_LWM2M_EVENT_MAX_NUM
}
 
enum  M2MB_LWM2M_CONNREQ_CAUSE_E {
  M2MB_LWM2M_CONNREQ_CAUSE_BOOTSTRAP, M2MB_LWM2M_CONNREQ_CAUSE_REGISTRATION, M2MB_LWM2M_CONNREQ_CAUSE_REREG, M2MB_LWM2M_CONNREQ_CAUSE_UPDATE,
  M2MB_LWM2M_CONNREQ_CAUSE_SMS, M2MB_LWM2M_CONNREQ_CAUSE_NOTIFY, M2MB_LWM2M_CONNREQ_CAUSE_DEREGISTRATION, M2MB_LWM2M_CONNREQ_CAUSE_MAX_NUM
}
 
enum  M2MB_LWM2M_RESULT_E {
  M2MB_LWM2M_RES_SUCCESS = 0, M2MB_LWM2M_RES_FAIL, M2MB_LWM2M_RES_FAIL_NO_ACTION, M2MB_LWM2M_RES_FAIL_UNSUPPORTED,
  M2MB_LWM2M_RES_FAIL_NOT_ALLOWED, M2MB_LWM2M_RES_FAIL_BAD_ARGS, M2MB_LWM2M_RES_FAIL_BAD_URI, M2MB_LWM2M_RES_NETWORK_ERROR = 50,
  M2MB_LWM2M_RES_HOST_UNREACH, M2MB_LWM2M_RES_SOCKET_ERROR, M2MB_LWM2M_RES_DTLS_ERROR, M2MB_LWM2M_RES_PROT_SUCCESS = 200,
  M2MB_LWM2M_RES_PROT_NOT_FOUND, M2MB_LWM2M_RES_PROT_NOT_ALLOWED, M2MB_LWM2M_RES_PROT_UNSUPPORTED, M2MB_LWM2M_RES_PROT_INTERNAL,
  M2MB_LWM2M_RES_PROT_UNKNOWN
}
 
enum  M2MB_LWM2M_IF_STATE_E {
  M2MB_LWM2M_IF_STATE_NONE, M2MB_LWM2M_IF_STATE_DISABLED, M2MB_LWM2M_IF_STATE_ACK_WAIT, M2MB_LWM2M_IF_STATE_ACTIVE,
  M2MB_LWM2M_IF_STATE_IDLE, M2MB_LWM2M_IF_STATE_DEREG_WAIT, M2MB_LWM2M_IF_STATE_DEREGISTERING, M2MB_LWM2M_IF_STATE_MAX
}
 
enum  M2MB_LWM2M_CL_STATE_E {
  M2MB_LWM2M_CL_STATE_DISABLED, M2MB_LWM2M_CL_STATE_BOOTSTRAPPING, M2MB_LWM2M_CL_STATE_BOOTSTRAPPED, M2MB_LWM2M_CL_STATE_REGISTERING,
  M2MB_LWM2M_CL_STATE_REGISTERED, M2MB_LWM2M_CL_STATE_DEREGISTERING, M2MB_LWM2M_CL_STATE_SUSPENDED, M2MB_LWM2M_CL_STATE_MAX
}
 
enum  M2MB_LWM2M_SET_DATA_TYPE_E {
  M2MB_LWM2M_SET_DATA_TYPE_INTEGER, M2MB_LWM2M_SET_DATA_TYPE_FLOAT, M2MB_LWM2M_SET_DATA_TYPE_STRING, M2MB_LWM2M_SET_DATA_TYPE_HEX_BINARY,
  M2MB_LWM2M_SET_DATA_TYPE_MAX
}
 
enum  M2MB_LWM2M_INFO_ID_E { M2MB_LWM2M_INFO_FOTA_REBOOT, M2MB_LWM2M_INFO_DEVICE_REBOOT, M2MB_LWM2M_INFO_RESOURCE_EXECUTE, M2MB_LWM2M_INFO_ID_MAX }
 
enum  M2MB_LWM2M_MON_ACTION_E { M2MB_LWM2M_MON_DISABLE = 0, M2MB_LWM2M_MON_ENABLE, M2MB_LWM2M_MON_MAX_NUM }
 
enum  M2MB_LWM2M_MON_MODE_E { M2MB_LWM2M_MON_MODE_SET_CMD = 0, M2MB_LWM2M_MON_MODE_READ_CMD, M2MB_LWM2M_MON_MODE_MAX_NUM }
 
enum  M2MB_LWM2M_FOTA_MODE_E {
  M2MB_LWM2M_FOTA_MODE_DEFAULT = 0, M2MB_LWM2M_FOTA_MODE_ACK_DWL = 1, M2MB_LWM2M_FOTA_MODE_ACK_UPD = 2, M2MB_LWM2M_FOTA_MODE_ACK_ALL = 3,
  M2MB_LWM2M_FOTA_MODE_MAX_NUM
}
 the fota modes supported by the m2mb lwm2m More...
 
enum  M2MB_LWM2M_FOTA_ACK_E { M2MB_LWM2M_FOTA_ACK_ALL = 1, M2MB_LWM2M_FOTA_ACK_MAX_NUM }
 
enum  M2MB_LWM2M_NFY_STATE_E { M2MB_LWM2M_NFY_STATE_MISSING = 0, M2MB_LWM2M_NFY_STATE_ACK_RECEIVED, M2MB_LWM2M_NFY_STATE_MAX_NUM }
 
enum  M2MB_LWM2M_KEY_ACTION_E {
  M2MB_LWM2M_KEY_CREATE, M2MB_LWM2M_KEY_DELETE_EP_NAME, M2MB_LWM2M_KEY_DELETE_ID_AND_SECRET, M2MB_LWM2M_KEY_DELETE_ALL,
  M2MB_LWM2M_KEY_MAX_ACTION
}
 
enum  M2MB_LWM2M_DATA_TYPE_E {
  M2MB_LWM2M_DATA_TYPE_INVALID = 0, M2MB_LWM2M_DATA_TYPE_NONE, M2MB_LWM2M_DATA_TYPE_STRING, M2MB_LWM2M_DATA_TYPE_INTEGER,
  M2MB_LWM2M_DATA_TYPE_FLOAT, M2MB_LWM2M_DATA_TYPE_BOOLEAN, M2MB_LWM2M_DATA_TYPE_OPAQUE, M2MB_LWM2M_DATA_TYPE_TIME,
  M2MB_LWM2M_DATA_TYPE_OBJECTLINK, M2MB_LWM2M_DATA_TYPE_STRINGARRAY, M2MB_LWM2M_DATA_TYPE_INTEGERARRAY, M2MB_LWM2M_DATA_TYPE_FLOATARRAY,
  M2MB_LWM2M_DATA_TYPE_BOOLEANARRAY, M2MB_LWM2M_DATA_TYPE_OPAQUEARRAY, M2MB_LWM2M_DATA_TYPE_TIMEARRAY, M2MB_LWM2M_DATA_TYPE_OBJECTLINKARRAY,
  M2MB_LWM2M_DATA_TYPE_LAST, M2MB_LWM2M_DATA_TYPE_FIRSTARRAYTYPE = M2MB_LWM2M_DATA_TYPE_STRINGARRAY, M2MB_LWM2M_DATA_TYPE_LASTARRAYTYPE = M2MB_LWM2M_DATA_TYPE_OBJECTLINKARRAY
}
 

Functions

M2MB_RESULT_E m2mb_lwm2m_init (M2MB_LWM2M_HANDLE *h, m2mb_lwm2m_ind_callback cb, void *cb_user_param)
 m2mb_lwm2m_init initializes, for current client, the capability to interact with LwM2M agent. More...
 
M2MB_RESULT_E m2mb_lwm2m_deinit (M2MB_LWM2M_HANDLE h)
 m2mb_lwm2m_deinit deinitializes LwM2M service for current client. More...
 
M2MB_RESULT_E m2mb_lwm2m_enable (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ENABLE_REQ_T *en_params)
 m2mb_lwm2m_enable starts LwM2M client registration More...
 
M2MB_RESULT_E m2mb_lwm2m_disable (M2MB_LWM2M_HANDLE h)
 m2mb_lwm2m_disable triggers LwM2M client deregistration. More...
 
M2MB_RESULT_E m2mb_lwm2m_ack (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ACK_REQ_T *ack)
 m2mb_lwm2m_ack informs LwM2M client about network availability More...
 
M2MB_RESULT_E m2mb_lwm2m_read (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *outbuf, UINT16 outbuflen)
 m2mb_lwm2m_read reads the LwM2M resource at the given URI More...
 
M2MB_RESULT_E m2mb_lwm2m_write (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *inbuf, UINT16 inbuflen)
 m2mb_lwm2m_write writes the LwM2M resource at the given URI More...
 
M2MB_RESULT_E m2mb_lwm2m_exec (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri)
 m2mb_lwm2m_exec executes the LwM2M resource at the given URI More...
 
M2MB_RESULT_E m2mb_lwm2m_set (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *inbuf, UINT16 inbuflen)
 m2mb_lwm2m_set sets the value of a LwM2M resource at module side More...
 
M2MB_RESULT_E m2mb_lwm2m_get (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *outbuf, UINT16 outbuflen)
 m2mb_lwm2m_get reads the value of a LwM2M resource at module side More...
 
M2MB_RESULT_E m2mb_lwm2m_get_stat (M2MB_LWM2M_HANDLE h)
 m2mb_lwm2m_get_stat reads the current status of the LwM2M client More...
 
M2MB_RESULT_E m2mb_lwm2m_sts (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_STS_URI_T *reqStsStructure)
 m2mb_lwm2m_sts sets the next server's address More...
 
M2MB_RESULT_E m2mb_lwm2m_mon (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, M2MB_LWM2M_MON_REQ_T *mon_params)
 m2mb_lwm2m_mon sets the monitoring status an LwM2M resource at module side More...
 
M2MB_RESULT_E m2mb_lwm2m_newinst (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, M2MB_LWM2M_NEW_INST_REQ_T *new_inst_params)
 m2mb_lwm2m_newinst creates a specified instance for a specified object More...
 
M2MB_RESULT_E m2mb_lwm2m_nfy_ack_status (M2MB_LWM2M_HANDLE h, BOOLEAN set, BOOLEAN enable)
 m2mb_lwm2m_nfy_ack_status sets or gets the flag to enable or disable Notify Ack reporting More...
 
M2MB_RESULT_E m2mb_lwm2m_nfy_ack_uri (M2MB_LWM2M_HANDLE h, BOOLEAN add, M2MB_LWM2M_OBJ_URI_T *uri)
 m2mb_lwm2m_nfy_ack_uri adds or removes a resource URI to the list for Notify Ack reporting More...
 
M2MB_RESULT_E m2mb_lwm2m_nfy_ack_list (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uriList, UINT8 listElementsNumber)
 m2mb_lwm2m_nfy_ack_list retrieves the list for Notify Ack reporting More...
 
M2MB_RESULT_E m2mb_lwm2m_agent_config (M2MB_LWM2M_HANDLE h, UINT16 agentID)
 m2mb_lwm2m_agent_config propagates the specified client for a specific operation (such as read, write or execute resource) More...
 
M2MB_RESULT_E m2mb_lwm2m_get_resource_type (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, UINT16 *resType)
 m2mb_lwm2m_get_resource_type propagates the resource type for a required resource. More...
 
M2MB_RESULT_E m2mb_lwm2m_fota_cfg (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_CFG_REQ_T *cfg_params)
 m2mb_lwm2m_fota_cfg sets and stores the fota mode. More...
 
M2MB_RESULT_E m2mb_lwm2m_fota_ack (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_ACK_REQ_T *ack_params)
 m2mb_lwm2m_fota_ack sends the ack for the required operation. More...
 
M2MB_RESULT_E m2mb_lwm2m_injkeys (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_KEY_ACTION_E action, M2MB_LWM2M_KEYS_T *keys)
 m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent. More...
 

Detailed Description

Header file for m2mb_lwm2m APIs.

m2m/m2m_common/m2mb_inc/m2mb_lwm2m.h

m2mb_lwm2m APIs provide actions and events for LWM2M management.

@notes

Author
Roberto Caboni
Date
03/05/2018

Enumeration Type Documentation

◆ M2MB_LWM2M_DATA_TYPE_E

Enumerator
M2MB_LWM2M_DATA_TYPE_INVALID 

indicates an invalid resource type

M2MB_LWM2M_DATA_TYPE_NONE 

indicates a resource with no type

M2MB_LWM2M_DATA_TYPE_STRING 

indicates a resource capable of holding an ASCII string (UTF-8 is not supported)

M2MB_LWM2M_DATA_TYPE_INTEGER 

indicates a resource capable of holding a LWM2M Integer value

M2MB_LWM2M_DATA_TYPE_FLOAT 

indicates a resource capable of holding a LWM2M Float value

M2MB_LWM2M_DATA_TYPE_BOOLEAN 

indicates a resource capable of holding a LWM2M Boolean value

M2MB_LWM2M_DATA_TYPE_OPAQUE 

indicates a resource capable of holding a LWM2M Opaque value

M2MB_LWM2M_DATA_TYPE_TIME 

indicates a resource capable of holding a LWM2M Time value

M2MB_LWM2M_DATA_TYPE_OBJECTLINK 

indicates a resource capable of holding a LWM2M ObjectLink value

M2MB_LWM2M_DATA_TYPE_STRINGARRAY 

indicates a multiple-instance resource capable of holding a number of ASCII string values

M2MB_LWM2M_DATA_TYPE_INTEGERARRAY 

indicates a multiple-instance resource capable of holding a number of LWM2M Integer values

M2MB_LWM2M_DATA_TYPE_FLOATARRAY 

indicates a multiple-instance resource capable of holding a number of LWM2M Float values

M2MB_LWM2M_DATA_TYPE_BOOLEANARRAY 

indicates a multiple-instance resource capable of holding a number of LWM2M Boolean values

M2MB_LWM2M_DATA_TYPE_OPAQUEARRAY 

indicates a multiple-instance resource capable of holding a number of LWM2M Opaque values

M2MB_LWM2M_DATA_TYPE_TIMEARRAY 

indicates a multiple-instance resource capable of holding a number of LWM2M Time values

M2MB_LWM2M_DATA_TYPE_OBJECTLINKARRAY 

indicates a multiple-instance resource capable of holding a number of LWM2M ObjectLink values

M2MB_LWM2M_DATA_TYPE_LAST 

Reserved value

M2MB_LWM2M_DATA_TYPE_FIRSTARRAYTYPE 

Reserved value

M2MB_LWM2M_DATA_TYPE_LASTARRAYTYPE 

Reserved value

◆ M2MB_LWM2M_EVENT_E

Enumerator
M2MB_LWM2M_FOTA_CFG_RES 

the fota configuration m2mb response identifier

M2MB_LWM2M_FOTA_ACK_RES 

the fota ack m2mb response identifier

◆ M2MB_LWM2M_FOTA_ACK_E

Enumerator
M2MB_LWM2M_FOTA_ACK_ALL 

acks the required fota operation regardless of its type

M2MB_LWM2M_FOTA_ACK_MAX_NUM 

the latest possible code; every successive insertions should be above this symbol

◆ M2MB_LWM2M_FOTA_MODE_E

the fota modes supported by the m2mb lwm2m

Enumerator
M2MB_LWM2M_FOTA_MODE_DEFAULT 

default mode, no acks required

M2MB_LWM2M_FOTA_MODE_ACK_DWL 

acked download, ack required for download operation only

M2MB_LWM2M_FOTA_MODE_ACK_UPD 

ack update mode, ack required for update operation only

M2MB_LWM2M_FOTA_MODE_ACK_ALL 

ack all mode, ack required for all operations

M2MB_LWM2M_FOTA_MODE_MAX_NUM 

latest possible code; every successive insertions should be above this symbol

◆ M2MB_LWM2M_KEY_ACTION_E

Enumerator
M2MB_LWM2M_KEY_CREATE 

to inject the keys

M2MB_LWM2M_KEY_DELETE_EP_NAME 

to delete the Endpoint Name

M2MB_LWM2M_KEY_DELETE_ID_AND_SECRET 

to delete the Identity and the Secret Key

M2MB_LWM2M_KEY_DELETE_ALL 

to delete all of the above

M2MB_LWM2M_KEY_MAX_ACTION 

max action value

◆ M2MB_LWM2M_NFY_STATE_E

Enumerator
M2MB_LWM2M_NFY_STATE_MISSING 

indicates a missing ack. Notify not confirmed by the LwM2M Server

M2MB_LWM2M_NFY_STATE_ACK_RECEIVED 

indicates that the notify has been received by the LwM2M Server.

M2MB_LWM2M_NFY_STATE_MAX_NUM 

Reserved value

Function Documentation

◆ m2mb_lwm2m_ack()

M2MB_RESULT_E m2mb_lwm2m_ack ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_ACK_REQ_T ack 
)

m2mb_lwm2m_ack informs LwM2M client about network availability

m2mb_lwm2m_ack allows the user to acknowledge client's request for network availability. It has to be issued in case of client enabled in "M2MB_LWM2M_MODE_ACK" mode. An ACK will be required after enable, disable, sms_push, notify and upd_reg events.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]ack_paramspointer to a structure containing the parameters required for the acknowledge. In particular it contains a boolean that authorizes/denies the transaction.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_ack( h, ack_params );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
switch( event )
{
//...
case M2MB_LWM2M_CONN_REQ_IND:
{
printf( "Connection request on APN %d, reason %d", resp->apnclass, resp->reason );
if( apn_class_is_registered )
{
M2MB_LWM2M_ACK_REQ_T ack_params = { M2MB_LWM2M_ACTION_ACK, 0 };
retVal = m2mb_lwm2m_ack( h, &ack_params );
if( retVal == M2MB_RESULT_SUCCESS )
{
// Ack sent. The client will go on and will issue another callback at registration completion
}
}
else
{
// Activate it, BUT NOT WITHIN THE CALLBACK!!! It is issued by agent's task.
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
M2MB_LWM2M_ENABLE_REQ_T pars = { M2MB_LWM2M_MODE_ACK, 1, 2, 5 };
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
retVal = m2mb_lwm2m_enable( h, &pars );
if ( retVal == M2MB_RESULT_SUCCESS )
{
// ... Wait for registration request callback
// ... Interaction whith the LwM2M client
}
}

◆ m2mb_lwm2m_agent_config()

M2MB_RESULT_E m2mb_lwm2m_agent_config ( M2MB_LWM2M_HANDLE  h,
UINT16  agentID 
)

m2mb_lwm2m_agent_config propagates the specified client for a specific operation (such as read, write or execute resource)

m2mb_lwm2m_agent_config is used to inform the LwM2M state machine to refer the required operation (which can be a #LWM2MW, #LWM2MR, #LWM2ME or #LWM2MSTS) to the agent specified by the AT command. It should be used before invoking the m2mb function. No callback is called.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]agentIDa structure defining the URI specified by the user (only object ID and object instance ID are managed).
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_agent_config( h, agentID );

int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.res = 4; // Reboot executable resource
m2mb_lwm2m_agent_config( h, agentID );
// the exec is executed for the Telit agent
retVal = m2mb_lwm2m_exec( h, &uri );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_exec request succeeded" );
}
}

◆ m2mb_lwm2m_deinit()

M2MB_RESULT_E m2mb_lwm2m_deinit ( M2MB_LWM2M_HANDLE  h)

m2mb_lwm2m_deinit deinitializes LwM2M service for current client.

m2mb_lwm2m_deinit deinitializes LwM2M service for current client freeing the handle passed as first parameter. Calling the m2mb_sms_deinit is useful after using the LwM2M service in order to free memory space.

Parameters
[in]hthe handle to the LwM2M service, that will be deinitialized by the function.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_deinit( &h );

M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//... use LwM2M APIs ...
retVal = m2mb_lwm2m_deinit( h );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_deinit succeeded" );
}

◆ m2mb_lwm2m_disable()

M2MB_RESULT_E m2mb_lwm2m_disable ( M2MB_LWM2M_HANDLE  h)

m2mb_lwm2m_disable triggers LwM2M client deregistration.

m2mb_lwm2m_disable starts the procedure for LwM2M client deregistration. It is non-blocking, so it returns immediately with an error code. If it returns successfully the deregistration result is provided through the callback defined by the user. If the client was enabled in M2MB_LWM2M_MODE_ACK mode, a call to m2mb_lwm2m_ack() is be required in order to assure network availability. The actual result of the API is returned through the callback with M2MB_LWM2M_DISABLE_RES event.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_disable( h );

M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
retVal = m2mb_lwm2m_enable( h, &pars );
if ( retVal == M2MB_RESULT_SUCCESS )
{
// ... Interaction with the LwM2M client
retVal = m2mb_lwm2m_disable( h );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_disable succeeded" );
}
}

◆ m2mb_lwm2m_enable()

M2MB_RESULT_E m2mb_lwm2m_enable ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_ENABLE_REQ_T en_params 
)

m2mb_lwm2m_enable starts LwM2M client registration

m2mb_lwm2m_enable starts the procedure for LwM2M client registration. It is non-blocking, so it returns immediately with an error code. It may fail if some basic conditions are not satisfied (PDP context not activated). If it returns successfully the registration result is provided through the callback defined by the user. If called in M2MB_LWM2M_MODE_ACK mode, a call to m2mb_lwm2m_ack() is be required in order to assure network availability. The actual result of the API is returned through the callback with M2MB_LWM2M_ENABLE_RES event.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]en_paramsa structure defining some mandatory parameters, such as apnclass.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_enable( h, params );

M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
// Set enable parameters. For example:
// pars.apnclass = 1;
retVal = m2mb_lwm2m_enable( h, &pars );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_enable succeeded" );
}

◆ m2mb_lwm2m_exec()

M2MB_RESULT_E m2mb_lwm2m_exec ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri 
)

m2mb_lwm2m_exec executes the LwM2M resource at the given URI

m2mb_lwm2m_exec executes the LwM2M resource at the URI specified by parameter 'uri', performing an operation equivalent to an execution from server side. The function returns immediately, and the result of the required operation is sent along with the callback defined in m2mb_lwm2m_init. In case of fatal error (example: client not ready), the function fails immediately and no callback is issued.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI of the resource to be executed. If the resource is not executable, an error is raised by the callback.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_execute( h, uri, );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_EXEC_RES:
{
M2MB_LWM2M_EXEC_RES_T *resp = ( M2MB_LWM2M_EXEC_RES_T * )resp_struct;
printf( "Exec result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.res = 4; // Reboot executable resource
retVal = m2mb_lwm2m_exec( h, &uri );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_exec request succeeded" );
}
}

◆ m2mb_lwm2m_fota_ack()

M2MB_RESULT_E m2mb_lwm2m_fota_ack ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_FOTA_ACK_REQ_T ack_params 
)

m2mb_lwm2m_fota_ack sends the ack for the required operation.

m2mb_lwm2m_fota_ack allows the user to acknoledge (and authorize) the current fota operation (i.e.: download or delta application). The function is non-blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_FOTA_ACK_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_FOTA_ACK_RES_T type.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]ack_paramsa structure containing the ack information specified by the user.
Returns
M2MB_RESULT_SUCCESS in case of success
a value of M2MB_RESULT_E in case of errors
Note

m2mb_lwm2m_fota_ack( h, ack_params );

// WARNING: do not place blocking actions within callback, it would block the lwm2m agent task!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
{ // event in response to the m2mb_lwm2m_fota_ack
if( resp != NULL )
{
printf( "Returning resource type: result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
printf( "Fota config succeeded" );
// code
}
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent ID
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
fotaAckParams.action = M2MB_LWM2M_FOTA_ACTION_ACK;
m2mb_lwm2m_agent_config( h, agentID );
retVal = m2mb_lwm2m_fota_ack( h, &fotaAckParams );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_fota_ack request succeeded" );
}
}

◆ m2mb_lwm2m_fota_cfg()

M2MB_RESULT_E m2mb_lwm2m_fota_cfg ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_FOTA_CFG_REQ_T cfg_params 
)

m2mb_lwm2m_fota_cfg sets and stores the fota mode.

m2mb_lwm2m_fota_cfg allows the user to set the proper fota modality by requiring an 'ack' to proceed with the delta download or to proceed with the delta application, or to confirm both download and update. The function is non-blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_FOTA_CFG_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_FOTA_CFG_RES_T type.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]cfg_paramsa structure containing the fota mode info specified by the user.
Returns
M2MB_RESULT_SUCCESS in case of success
a value of M2MB_RESULT_E in case of errors
Note

m2mb_lwm2m_fota_cfg( h, cfg_params );

// WARNING: do not place blocking actions within callback, it would block the lwm2m agent task!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
{ // event in response to the m2mb_lwm2m_fota_cfg
if( resp != NULL )
{
printf( "Returning resource type: result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
printf( "Fota config succeeded" );
// code
}
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent ID
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
cfg_params.mode = M2MB_LWM2M_FOTA_MODE_ALL_ACKED;
m2mb_lwm2m_agent_config( h, agentID );
retVal = m2mb_lwm2m_fota_cfg( h, &cfg_params );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_fota_cfg request succeeded" );
}
}

◆ m2mb_lwm2m_get()

M2MB_RESULT_E m2mb_lwm2m_get ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
void *  outbuf,
UINT16  outbuflen 
)

m2mb_lwm2m_get reads the value of a LwM2M resource at module side

m2mb_lwm2m_get allows the user to read, at module side, the value of a resource, at the URI specified by parameter 'uri', which is defined as write-only by LwM2M protocol. It also allows the read-back of the value set with m2mb_lwm2m_set() API. The function returns immediately, and the result of the required operation is sent along with the callback defined in m2mb_lwm2m_init. In case of fatal error (example: client not ready), the function fails immediately and no callback is issued. In case of successful get, data is copied within the buffer passed by the user.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI of the resource to be get. Only a defined set of whitelisted URIs can be accepted by this function. If the resource is not included in this set an error is raised by the callback. The list of whitelisted URIs is: <TODO: add list of whitelisted URIs>
[in]outbufan user defined buffer to which the data will be copied.
[in]outbuflenthe size of the user defined buffer to which the data will be copied.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_get( h, uri, buf, len );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_GET_RES:
{
M2MB_LWM2M_GET_RES_T *resp = ( M2MB_LWM2M_GET_RES_T * )resp_struct;
printf( "Get result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
char *buf = ( char * )m2mb_os_malloc( 50 );
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.res = 17; // Device type resource
retVal = m2mb_lwm2m_get( h, &uri, buf, 50 );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_get request succeeded" );
}
}

◆ m2mb_lwm2m_get_resource_type()

M2MB_RESULT_E m2mb_lwm2m_get_resource_type ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
UINT16 *  resType 
)

m2mb_lwm2m_get_resource_type propagates the resource type for a required resource.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI specified by the user.
[in]outbufan user defined buffer in which the response will be stored. The buffer is returned in the callback event.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_get_resource_type( h, uri, resType );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_GET_TYPE_RES:
{ // event in response to the m2mb_lwm2m_get_resource_type
printf( "Returning resource type: result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
printf( "Resource type is: %d", resp->resType );
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 resType = 0;
UINT16 agentID = 0; // Telit agent
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 33211; // Telit Services Management
uri.objInst = 0;
uri.res = 0; // service enable resource
m2mb_lwm2m_agent_config( h, agentID );
retVal = m2mb_lwm2m_get_resource_type( h, &uri , &resType );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_get_resource_type request succeeded" );
}
}

◆ m2mb_lwm2m_get_stat()

M2MB_RESULT_E m2mb_lwm2m_get_stat ( M2MB_LWM2M_HANDLE  h)

m2mb_lwm2m_get_stat reads the current status of the LwM2M client

m2mb_lwm2m_get_stat reads the current status of the LwM2M client, allowing the user to know what action is currently performed and to retrieve piece of informations such as the remaining time before the following registration update.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. The function returns immediately, and the user defined callback is issued whenever the status information is ready.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_get_stat( h );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_GET_STAT_RES:
{
printf( "Get stat result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
retVal = m2mb_lwm2m_get_stat( h );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_get_stat request succeeded" );
}
}

◆ m2mb_lwm2m_init()

M2MB_RESULT_E m2mb_lwm2m_init ( M2MB_LWM2M_HANDLE *  h,
m2mb_lwm2m_ind_callback  cb,
void *  cb_user_param 
)

m2mb_lwm2m_init initializes, for current client, the capability to interact with LwM2M agent.

m2mb_lwm2m_init initializes the LwM2M handle for current client, returning the handle that must be passed as first parameter for all interactions with LwM2M agent. Calling the m2mb_lwm2m_init is mandatory before using any other LwM2M API.

WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!

Parameters
[in]*hthe handle to the LwM2M service, that will be initialized by the function.
[in]cbthe callback that will be called if an event or an error happens.
[in]*cb_user_parama pointer to generic user data that will be returned as it is in the callback.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_init( &h, myCallback, myUserdata );

void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
//my code
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_init succeeded" );
}
}

◆ m2mb_lwm2m_injkeys()

M2MB_RESULT_E m2mb_lwm2m_injkeys ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_KEY_ACTION_E  action,
M2MB_LWM2M_KEYS_T keys 
)

m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent.

m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent. The function is asynchronous. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_INJKEYS_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_RES_T type.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]actionthe action to execute.
[in]keyspointer to the M2MB_LWM2M_KEYS_T struct allocated by the caller containing the EP name and Keys to inject (empty when deleting).
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_injkeys( h, action, keys );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_INJKEYS_RES:
{ // event in response to the m2mb_lwm2m_injkeys
M2MB_LWM2M_RES_T *resp = ( M2MB_LWM2M_RES_T * )resp_struct;
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
printf( "m2mb_lwm2m_injkeys OK" );
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
strcpy( keys.endpoint_name, "my_ep_name" );
strcpy( keys.identity, "00112233445566778899AABBCCDDEEFF" );
strcpy( keys.secret_key, "FFEEDDCCBBAA99887766554433221100" );
m2mb_lwm2m_agent_config( h, agentID );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_injkeys request succeeded" );
}
}

◆ m2mb_lwm2m_mon()

M2MB_RESULT_E m2mb_lwm2m_mon ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
M2MB_LWM2M_MON_REQ_T mon_params 
)

m2mb_lwm2m_mon sets the monitoring status an LwM2M resource at module side

m2mb_lwm2m_mon allows the user to enable or disable the monitoring of resource changes. The changes can occur both from AT command side (#LWM2MW or #LWM2MSET) or from a server request. The function is asynchronous. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_MON_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_MON_RES_T type. The user is allowed to enable the object monitoring and it will be advised of each resource change in this object with an URC. The object to be monitored should be specified by parameter inserting it in the parameter 'uri', although only the object identifier field in 'uri' is currently taken into account.

Once the monitoring is activated, each resource change will generate an event that should be managed in the same callback. This event is the M2MB_LWM2M_MON_INFO_IND; in this case, it is reported the uri of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_MON_INFO_IND_T type.

Please notice that, in case of full monitoring list retrieve, the list is returned as a M2MB_LWM2M_OBJ_URI_T array of MAX_MONITOR_LIST_COUNT elements; only the ObjectID field will contain data; please notice that object '0' (Security) is not monitorable, so its value in this list indicates an empty item.

In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI of the resource to be monitored. Only the object identifier is currently used, although with further developments it could be extended the monitoring to single object instances and single resource identifiers (and consequently the URCs will be restricted to a minor set of data). Nevertheless, the full URI originating the resource change is reported in the URC.
[in]mon_paramsa structure that contains the enable/disable action request, and the operation mode to be performed (set a new object to be monitored, or read the full list of objects under monitoring.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note
Monitoring events will be issued also when the changing resource operations (e.g. write, set) are performed by the client itself with m2mb APIs.

m2mb_lwm2m_mon( h, uri, mon );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_MON_RES:
{ // event in response to the m2mb_lwm2m_mon
M2MB_LWM2M_MON_RES_T *resp = ( M2MB_LWM2M_MON_RES_T * )resp_struct;
printf( "Resource change monitor setting result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
case M2MB_LWM2M_MON_INFO_IND:
{ // event that brings a resource change information
// code; i.e.:
// uriLen value is the number of valid fields of the URI, starting from the 1st and going towards
// the last one in the printf below
if( pInfo->uri.uriLen == 4 )
{
printf( "resource changed: /%d/%d/%d/%d,
pInfo->uri.obj
pInfo->uri.objInst,
pInfo->uri.resource,
pInfo->uri.resourceInst );
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
M2MB_LWM2M_OBJ_URI_T uri;
M2MB_LWM2M_MON_REQ_T mon;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
// setting a new monitoring for object 3
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.res = 0;
mon.action = M2MB_LWM2M_MON_ENABLE;
mon.mode = M2MB_LWM2M_MON_MODE_SET_CMD;
retVal = m2mb_lwm2m_mon( h, &uri, &mon );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_mon request succeeded" );
}
//...
// reading the full monitoring list
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 0; // Device object
uri.objInst = 0;
uri.res = 0;
mon.action = M2MB_LWM2M_MON_DISABLE;
mon.mode = M2MB_LWM2M_MON_MODE_READ_CMD;
retVal = m2mb_lwm2m_mon( h, &uri, &mon );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_mon request succeeded" );
}
}

◆ m2mb_lwm2m_newinst()

M2MB_RESULT_E m2mb_lwm2m_newinst ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
M2MB_LWM2M_NEW_INST_REQ_T new_inst_params 
)

m2mb_lwm2m_newinst creates a specified instance for a specified object

m2mb_lwm2m_newinst allows the user to create am instance for a specified object, filling all its resources with their proper default values (0 for numeric types, "" for strings) according to the resource types. The function is asynchronous. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NEW_INST_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NEW_INST_RES_T type. The user can create a new object instance only when the LwM2M client is up and running.

In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI specified by the user (only object ID and object instance ID are managed).
[in]new_inst_paramsa structure that contains the agent specified by the user. Currently only Telit agent is fully supported. The parameter is a M2MB_LWM2M_NEW_INST_REQ_T handler.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_lwm2m_newinst( h, uri, new_inst_params );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_NEW_INST_RES:
{ // event in response to the m2mb_lwm2m_newinst
printf( "Creating object instance specified: result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
M2MB_LWM2M_NEW_INST_REQ_T new_inst_params;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
// setting a new instance 21 for object 33205
uri.uriLen = M2MB_LWM2M_URI_2_FIELDS; // currently not managed
uri.obj = 33205;
uri.objInst = 21;
uri.res = 0; // even if specified, this field will be forced to 0
uri.resInst = 0; // even if specified, this field will be forced to 0
mon.action = M2MB_LWM2M_MON_ENABLE;
mon.mode = M2MB_LWM2M_MON_MODE_SET_CMD;
retVal = m2mb_lwm2m_mon( h, &uri, &mon );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_mon request succeeded" );
}
//...
// reading the full monitoring list
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 0; // Device object
uri.objInst = 0;
uri.res = 0;
new_inst_params.agent = 0; // Telit agent
retVal = m2mb_lwm2m_newinst( h, &uri, &new_inst_params );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_mon request succeeded" );
}
}

◆ m2mb_lwm2m_nfy_ack_list()

M2MB_RESULT_E m2mb_lwm2m_nfy_ack_list ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uriList,
UINT8  listElementsNumber 
)

m2mb_lwm2m_nfy_ack_list retrieves the list for Notify Ack reporting

m2mb_lwm2m_nfy_ack_list allows the user to retrieve the list for Notify Ack reporting.

The function is not blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NFYACK_LIST_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NFYACK_LIST_RES_T type.

Once the Notify Ack reporting is enabled, each change of a resource (whose URI has been previously added in the list by using the m2mb_lwm2m_nfy_ack_uri) will generate an event (M2MB_LWM2M_NFYACK_INFO_IND) that should be managed in the same callback. The M2MB_LWM2M_NFYACK_INFO_IND event reports the URI of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_NFYACK_INFO_IND_T type.

In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uriLista pointer to the preallocated array of M2MB_LWM2M_OBJ_URI_T elements to be filled with the list elements.
[in]listElementsNumberthe number of M2MB_LWM2M_OBJ_URI_T elements the uriList has been allocated of.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note
m2mb_lwm2m_agent_config has to be previously called, in order to configure the agent the request will be related to

m2mb_lwm2m_nfy_ack_list( h, uriList, listElementsNumber );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_NFYACK_STATUS_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_status
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "current status for Notify Ack reporting is %s", ( ( resp->enabled == TRUE ) ? ( "ENABLED" ) : ( "DISABLED" ) ) );
}
break;
}
case M2MB_LWM2M_NFYACK_URI_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_uri
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "m2mb_lwm2m_nfy_ack_uri response OK" );
}
break;
}
case M2MB_LWM2M_NFYACK_LIST_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_list
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "m2mb_lwm2m_nfy_ack_list read %hu elements", nfyAckListResponse->listElementsNumber );
}
break;
}
//...
case M2MB_LWM2M_NFYACK_INFO_IND:
{ // event that brings a Notify Ack information
// code; i.e.:
// uriLen value is the number of valid fields of the URI, starting from the 1st and going towards
// the last one in the printf below
if( ( pInfo ) && ( pInfo->uri.uriLen == 3 ) )
{
printf( "#LWM2MNFYACK: agentId %hu, SSID %hu, uri \"/%hu/%hu/%hu\", %s",
pInfo->agent,
pInfo->shServerId,
pInfo->uri.obj,
pInfo->uri.objInst,
pInfo->uri.resource,
( pInfo->nfyState == M2MB_LWM2M_NFY_STATE_ACK_RECEIVED ) ? ( "ACK RECEIVED" ) : ( "ACK NOT RECEIVED" ) );
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent
BOOLEAN set = TRUE;
BOOLEAN enable = TRUE;
BOOLEAN add = TRUE;
M2MB_LWM2M_OBJ_URI_T uri = { 0 };
UINT8 listElements = 6;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
//configuring agent Telit
retVal = m2mb_lwm2m_agent_config( h, agentID );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_agent_config request succeeded" );
}
//adding an URI to the list
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.resource = 0;
uri.resourceInst = 0; // better set it to 0, even if M2MB_LWM2M_URI_3_FIELDS
retVal = m2mb_lwm2m_nfy_ack_uri( h, add, &uri );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_uri request succeeded" );
}
//trying to read the URI list
uriList = ( M2MB_LWM2M_OBJ_URI_T * ) m2mb_os_calloc( listElements * sizeof( M2MB_LWM2M_OBJ_URI_T ) );
retVal = m2mb_lwm2m_nfy_ack_list( h, uriList, listElements );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_list request succeeded" );
}
//setting the status to ENABLED
retVal = m2mb_lwm2m_nfy_ack_status( h, set, enable );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_status request succeeded" );
}
}

◆ m2mb_lwm2m_nfy_ack_status()

M2MB_RESULT_E m2mb_lwm2m_nfy_ack_status ( M2MB_LWM2M_HANDLE  h,
BOOLEAN  set,
BOOLEAN  enable 
)

m2mb_lwm2m_nfy_ack_status sets or gets the flag to enable or disable Notify Ack reporting

m2mb_lwm2m_nfy_ack_status allows the user to enable or disable the reporting of Acknowledgments sent by a server that receives a Notify message for a resource under observation. The function is not blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NFYACK_STATUS_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NFYACK_STATUS_RES_T type.

Once the Notify Ack reporting is enabled, each change of a resource (whose URI has been previously added in the list by using the m2mb_lwm2m_nfy_ack_uri) will generate an event (M2MB_LWM2M_NFYACK_INFO_IND) that should be managed in the same callback. The M2MB_LWM2M_NFYACK_INFO_IND event reports the URI of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_NFYACK_INFO_IND_T type.

In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]setwhether a set (if TRUE) or get (if FALSE) request has to be performed.
[in]enableBOOLEAN variable that enables (if TRUE) or disables (if FALSE) the Notify Ack reporting when set is TRUE.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note
m2mb_lwm2m_agent_config has to be previously called, in order to configure the agent the request will be related to

m2mb_lwm2m_nfy_ack_status( h, set, enable );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_NFYACK_STATUS_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_status
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "current status for Notify Ack reporting is %s", ( ( resp->enabled == TRUE ) ? ( "ENABLED" ) : ( "DISABLED" ) ) );
}
break;
}
//...
case M2MB_LWM2M_NFYACK_INFO_IND:
{ // event that brings a Notify Ack information
// code; i.e.:
// uriLen value is the number of valid fields of the URI, starting from the 1st and going towards
// the last one in the printf below
if( ( pInfo ) && ( pInfo->uri.uriLen == 3 ) )
{
printf( "#LWM2MNFYACK: agentId %hu, SSID %hu, uri \"/%hu/%hu/%hu\", %s",
pInfo->agent,
pInfo->shServerId,
pInfo->uri.obj,
pInfo->uri.objInst,
pInfo->uri.resource,
( pInfo->nfyState == M2MB_LWM2M_NFY_STATE_ACK_RECEIVED ) ? ( "ACK RECEIVED" ) : ( "ACK NOT RECEIVED" ) );
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent
BOOLEAN set = TRUE;
BOOLEAN enable = TRUE;
BOOLEAN add = TRUE;
M2MB_LWM2M_OBJ_URI_T uri = { 0 };
UINT8 listElements = 6;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
//configuring agent Telit
retVal = m2mb_lwm2m_agent_config( h, agentID );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_agent_config request succeeded" );
}
//setting the status to ENABLED
retVal = m2mb_lwm2m_nfy_ack_status( h, set, enable );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_status request succeeded" );
}
}

◆ m2mb_lwm2m_nfy_ack_uri()

M2MB_RESULT_E m2mb_lwm2m_nfy_ack_uri ( M2MB_LWM2M_HANDLE  h,
BOOLEAN  add,
M2MB_LWM2M_OBJ_URI_T uri 
)

m2mb_lwm2m_nfy_ack_uri adds or removes a resource URI to the list for Notify Ack reporting

m2mb_lwm2m_nfy_ack_uri allows the user to add or remove a resource URI to the list for Notify Ack reporting; if that resource is under observation and its URI is in this list, the Notify Ack will be reported. The function is not blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NFYACK_URI_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NFYACK_URI_RES_T type.

Once the Notify Ack reporting is enabled, each change of a resource (whose URI has been previously added in the list by using the m2mb_lwm2m_nfy_ack_uri) will generate an event (M2MB_LWM2M_NFYACK_INFO_IND) that should be managed in the same callback. The M2MB_LWM2M_NFYACK_INFO_IND event reports the URI of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_NFYACK_INFO_IND_T type.

In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]addwhether an add (if TRUE) or remove (if FALSE) request has to be performed.
[in]uria pointer to the preallocated structure that defines the URI of the item to add (or remove).
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note
m2mb_lwm2m_agent_config has to be previously called, in order to configure the agent the request will be related to

m2mb_lwm2m_nfy_ack_uri( h, add, uri );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_NFYACK_STATUS_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_status
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "current status for Notify Ack reporting is %s", ( ( resp->enabled == TRUE ) ? ( "ENABLED" ) : ( "DISABLED" ) ) );
}
break;
}
case M2MB_LWM2M_NFYACK_URI_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_uri
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "m2mb_lwm2m_nfy_ack_uri response OK" );
}
break;
}
case M2MB_LWM2M_NFYACK_LIST_RES:
{ // event in response to the m2mb_lwm2m_nfy_ack_list
if( ( resp ) && ( resp->result == M2M_LWM2M_RES_SUCCESS ) )
{
// code
printf( "m2mb_lwm2m_nfy_ack_list read %hu elements", nfyAckListResponse->listElementsNumber );
}
break;
}
//...
case M2MB_LWM2M_NFYACK_INFO_IND:
{ // event that brings a Notify Ack information
// code; i.e.:
// uriLen value is the number of valid fields of the URI, starting from the 1st and going towards
// the last one in the printf below
if( ( pInfo ) && ( pInfo->uri.uriLen == 3 ) )
{
printf( "#LWM2MNFYACK: agentId %hu, SSID %hu, uri \"/%hu/%hu/%hu\", %s",
pInfo->agent,
pInfo->shServerId,
pInfo->uri.obj,
pInfo->uri.objInst,
pInfo->uri.resource,
( pInfo->nfyState == M2MB_LWM2M_NFY_STATE_ACK_RECEIVED ) ? ( "ACK RECEIVED" ) : ( "ACK NOT RECEIVED" ) );
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0; // Telit agent
BOOLEAN set = TRUE;
BOOLEAN enable = TRUE;
BOOLEAN add = TRUE;
M2MB_LWM2M_OBJ_URI_T uri = { 0 };
UINT8 listElements = 6;
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
//configuring agent Telit
retVal = m2mb_lwm2m_agent_config( h, agentID );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_agent_config request succeeded" );
}
//adding an URI to the list
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.resource = 0;
uri.resourceInst = 0; // better set it to 0, even if M2MB_LWM2M_URI_3_FIELDS
retVal = m2mb_lwm2m_nfy_ack_uri( h, add, &uri );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_uri request succeeded" );
}
//trying to read the URI list
uriList = ( M2MB_LWM2M_OBJ_URI_T * ) m2mb_os_calloc( listElements * sizeof( M2MB_LWM2M_OBJ_URI_T ) );
retVal = m2mb_lwm2m_nfy_ack_list( h, uriList, listElements );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_list request succeeded" );
}
//setting the status to ENABLED
retVal = m2mb_lwm2m_nfy_ack_status( h, set, enable );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_status request succeeded" );
}
}

◆ m2mb_lwm2m_read()

M2MB_RESULT_E m2mb_lwm2m_read ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
void *  outbuf,
UINT16  outbuflen 
)

m2mb_lwm2m_read reads the LwM2M resource at the given URI

m2mb_lwm2m_read reads the LwM2M resource at the URI specified by parameter 'uri', performing an operation equivalent to a read from server side. The function returns immediately, and the result of the required operation is sent along with the callback defined in m2mb_lwm2m_init. According to this, the read result is made available in the memory area defined by the m2mb's user after a little delay. In case of fatal error (example: client not ready), the function fails immediately and no callback is issued. In case of successful read, data is copied in the buffer passed by the user.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI of the resource to be read. If the resource is not readable, an error is raised by the callback.
[in]outbufan user defined buffer in which the response will be stored.
[in]outbuflenthe size of the user defined buffer in which the response will be stored.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note
It is worth noting that for 'float' and 'int' types, the client could manage sizes up to 64 bits length; therefore, to avoid problems of memory overlapping, in case of float data type the user should pass inbuf and inbuflen parameters sized for a double float, and in case of integer data type the user should pass inbuf and inbuflen parameters sized for a INT64.

m2mb_lwm2m_read( h, uri, buf, len );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_READ_RES:
{
M2MB_LWM2M_READ_RES_T *resp = ( M2MB_LWM2M_READ_RES_T * )resp_struct;
printf( "Read result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// Manage result value
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
char *buf = ( char * )m2mb_os_malloc( 50 );
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.res = 0;
retVal = m2mb_lwm2m_read( h, &uri, buf, 50 );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_read request succeeded" );
}
}

◆ m2mb_lwm2m_set()

M2MB_RESULT_E m2mb_lwm2m_set ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
void *  inbuf,
UINT16  inbuflen 
)

m2mb_lwm2m_set sets the value of a LwM2M resource at module side

m2mb_lwm2m_set allows the user to drive, at module side, the value of a resource, at the URI specified by parameter 'uri', which is defined as read-only by LwM2M protocol. This value will be shown to any following read from server side or through m2mb_lwm2m_read(). The function returns immediately, and the result of the required operation is sent along with the callback defined in m2mb_lwm2m_init. In case of fatal error (example: client not ready), the function fails immediately and no callback is issued. In case of successful set, data is copied from the buffer passed by the user. Values set through this API can be read back by means of m2mb_lwm2m_get() API.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI of the resource to be written. Only a defined set of whitelisted URIs can be accepted by this function. If the resource is not included in this set (meaning that the resource value, even if read only, is automatically obtained by the agent and cannot be driven by the user), an error is raised by the callback. The list of whitelisted URIs is: <TODO: add list of whitelisted URIs>
[in]inbufan user defined buffer from which the data will be copied.
[in]inbuflenthe size of the user defined buffer from which the data will be copied.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note
Please notice that changes on any resource during the bootstrap should be avoided, in order to not override the server bootstrap configuration.

m2mb_lwm2m_set( h, uri, buf, len );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_SET_RES:
{
M2MB_LWM2M_SET_RES_T *resp = ( M2MB_LWM2M_SET_RES_T * )resp_struct;
printf( "Set result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
char *buf = ( char * )m2mb_os_malloc( 50 );
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3; // Device object
uri.objInst = 0;
uri.res = 17; // Device type resource
strcpy( buf, "CustomDeviceType" );
retVal = m2mb_lwm2m_set( h, &uri, buf, strlen( buf ) );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_set request succeeded" );
}
}

◆ m2mb_lwm2m_sts()

M2MB_RESULT_E m2mb_lwm2m_sts ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_STS_URI_T reqStsStructure 
)

m2mb_lwm2m_sts sets the next server's address

m2mb_lwm2m_sts allows either setting the next server's address loaded by the LwM2M client at the next startup or restoring a previously server chosen. This function should be used only for certification purposes, where the certification tests server differs from the ordinary one.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. The function returns immediately, and the user defined callback is issued whenever the status information is ready.
[in]reqStsStructurepointer to the LwM2M structure that contains the information needed for #LWM2MSTS command managing
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note
field uriLen on M2MB_LWM2M_STS_URI_T structure is currently unmanaged, and it is left for future purposes. stsReq.uriLen should only be set to M2MB_LWM2M_URI_1_FIELDS or M2MB_LWM2M_URI_2_FIELDS for setting a STS server; M2MB_LWM2M_URI_1_FIELDS means that the server specified is not a bootstrap server; M2MB_LWM2M_URI_2_FIELDS allows the user to specify if the the next connection to the server is a bootstrap one (by inserting stsReq.bootstrapRequest set to 1) or not (by inserting stsReq.bootstrapRequest set to 0). Please notice that inserting M2MB_LWM2M_URI_2_FIELDS and stsReq.bootstrapRequest set to 0 is equivalent to setting M2MB_LWM2M_URI_1_FIELDS, since in this case the server is declared as factory bootstrapped. stsReq.uriLen could also be set to M2MB_LWM2M_URI_MAX_NUM to remove a formerly set STS server; in this case the unique parameter to be set should be the the M2MB LWM2M handler; the URI fields will be ignored even if they bring valid values. m2mb_lwm2m_sts( h, reqStsStructure );
// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_STS:
{
M2MB_LWM2M_STS_RES_T *resp = ( M2MB_LWM2M_STS_RES_T * )resp_struct;
printf( "Sts command result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
CHAR stringValue[ MY_MAX_STRING_LENGTH ];
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
// setting a user defined server via STS command
memset( stsReq, 0, sizeof( M2MB_LWM2M_STS_URI_T ) );
memset( stringValue, 0, sizeof( stringValue ) );
strcpy( stringValue, "coaps://myUrlToBePointed:5684" );
stsReq.data = stringValue;
stsReq.dataLen = strlen( stringValue );
stsReq.bootstrapRequest = 1; // must be 1 for requiring a Bootstrap, 0 for direct DM connection
// stsReq.uriLen must be M2MB_LWM2M_URI_1_FIELDS or M2MB_LWM2M_URI_2_FIELDS for STS command setting.
// M2MB_LWM2M_URI_2_FIELDS is the correct choice in this example.
stsReq.uriLen = M2MB_LWM2M_URI_2_FIELDS;
retVal = m2mb_lwm2m_sts( lwm2mTestHndl, &stsReq );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_sts request succeeded" );
}
//...
// resetting the former STS
memset( stsReq, 0, sizeof( M2MB_LWM2M_STS_URI_T ) );
stsReq.uriLen = M2MB_LWM2M_URI_MAX_NUM;
retVal = m2mb_lwm2m_sts( lwm2mTestHndl, &stsReq );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_sts request succeeded" );
}
//...
// setting a tabled STS server
memset( stsReq, 0, sizeof( M2MB_LWM2M_STS_URI_T ) );
stsReq.serverTableId = 0;
stsReq.uriLen = M2MB_LWM2M_URI_0_FIELDS;
retVal = m2mb_lwm2m_sts( lwm2mTestHndl, &stsReq );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_sts request succeeded" );
}
}

◆ m2mb_lwm2m_write()

M2MB_RESULT_E m2mb_lwm2m_write ( M2MB_LWM2M_HANDLE  h,
M2MB_LWM2M_OBJ_URI_T uri,
void *  inbuf,
UINT16  inbuflen 
)

m2mb_lwm2m_write writes the LwM2M resource at the given URI

m2mb_lwm2m_write writes the LwM2M resource at the URI specified by parameter 'uri', performing an operation equivalent to a write from server side. The function returns immediately, and the result of the required operation is sent along with the callback defined in m2mb_lwm2m_init. In case of fatal error (example: client not ready), the function fails immediately and no callback is issued. In case of successful write, data is copied from the buffer passed by the user.

Parameters
[in]hthe handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function.
[in]uria structure defining the URI of the resource to be written. If the resource is not writable, an error is raised by the callback.
[in]inbufan user defined buffer from which the data will be copied.
[in]inbuflenthe size of the user defined buffer from which the data will be copied.
Returns
M2MB_RESULT_SUCCESS on success, a different value on error.
Note
Please notice that in case of float data type, the user should pass inbuf and inbuflen parameters sized for a double float. Please notice that changes on any resource during the bootstrap should be avoided, in order to not override the server bootstrap configuration.

m2mb_lwm2m_write( h, uri, buf, len );

// WARNING: do not place blocking action within callback, since it is issued by the agent's task!!!
void myCallback( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata )
{
switch( event )
{
//...
case M2MB_LWM2M_WRITE_RES:
{
printf( "Write result %d", resp->result );
if( resp->result == M2M_LWM2M_RES_SUCCESS )
{
// code
}
break;
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
char *buf = ( char * )m2mb_os_malloc( 50 );
retVal = m2mb_lwm2m_init( &h, myCallback, ( void* )myUserdata );
//...
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 10000;
uri.objInst = 1;
uri.res = 7;
strcpy( buf, "stringValue" );
retVal = m2mb_lwm2m_write( h, &uri, buf, strlen( buf ) );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_write request succeeded" );
}
}
m2mb_lwm2m_get_stat
M2MB_RESULT_E m2mb_lwm2m_get_stat(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_get_stat reads the current status of the LwM2M client
M2MB_LWM2M_FOTA_ACK_REQ_T
the m2mb_lwm2m_fota_ack request data structure
Definition: m2mb_lwm2m.h:577
M2MB_LWM2M_ENABLE_REQ_T
Definition: m2mb_lwm2m.h:289
M2MB_LWM2M_MON_INFO_IND_T
Definition: m2mb_lwm2m.h:482
m2mb_lwm2m_get_resource_type
M2MB_RESULT_E m2mb_lwm2m_get_resource_type(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, UINT16 *resType)
m2mb_lwm2m_get_resource_type propagates the resource type for a required resource.
M2MB_LWM2M_KEYS_T::identity
CHAR identity[M2MB_LWM2M_DTLS_PSK_MAX_KEY_LEN+1]
Definition: m2mb_lwm2m.h:338
M2MB_LWM2M_FOTA_ACK_RES_T
the m2mb_lwm2m_fota_ack response data structure
Definition: m2mb_lwm2m.h:586
M2MB_LWM2M_NFYACK_INFO_IND_T::nfyState
M2MB_LWM2M_NFY_STATE_E nfyState
Definition: m2mb_lwm2m.h:549
M2MB_LWM2M_FOTA_CFG_RES
Definition: m2mb_lwm2m.h:91
M2MB_LWM2M_NFYACK_LIST_RES_T::result
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:532
M2MB_LWM2M_MON_RES_T
Definition: m2mb_lwm2m.h:474
M2MB_LWM2M_KEYS_T
Definition: m2mb_lwm2m.h:335
m2mb_lwm2m_get
M2MB_RESULT_E m2mb_lwm2m_get(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *outbuf, UINT16 outbuflen)
m2mb_lwm2m_get reads the value of a LwM2M resource at module side
m2mb_lwm2m_enable
M2MB_RESULT_E m2mb_lwm2m_enable(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ENABLE_REQ_T *en_params)
m2mb_lwm2m_enable starts LwM2M client registration
M2MB_LWM2M_FOTA_CFG_RES_T::result
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:568
m2mb_lwm2m_ack
M2MB_RESULT_E m2mb_lwm2m_ack(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ACK_REQ_T *ack)
m2mb_lwm2m_ack informs LwM2M client about network availability
m2mb_lwm2m_fota_ack
M2MB_RESULT_E m2mb_lwm2m_fota_ack(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_ACK_REQ_T *ack_params)
m2mb_lwm2m_fota_ack sends the ack for the required operation.
M2MB_LWM2M_GET_STAT_RES_T
Definition: m2mb_lwm2m.h:417
M2MB_LWM2M_OBJ_URI_T
Definition: m2mb_lwm2m.h:304
m2mb_lwm2m_newinst
M2MB_RESULT_E m2mb_lwm2m_newinst(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, M2MB_LWM2M_NEW_INST_REQ_T *new_inst_params)
m2mb_lwm2m_newinst creates a specified instance for a specified object
m2mb_lwm2m_deinit
M2MB_RESULT_E m2mb_lwm2m_deinit(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_deinit deinitializes LwM2M service for current client.
m2mb_lwm2m_disable
M2MB_RESULT_E m2mb_lwm2m_disable(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_disable triggers LwM2M client deregistration.
M2MB_LWM2M_NFY_STATE_ACK_RECEIVED
Definition: m2mb_lwm2m.h:242
M2MB_LWM2M_EXEC_RES_T
Definition: m2mb_lwm2m.h:395
M2MB_LWM2M_READ_RES_T
Definition: m2mb_lwm2m.h:376
M2MB_LWM2M_NEW_INST_REQ_T
Definition: m2mb_lwm2m.h:488
M2MB_LWM2M_FOTA_ACK_RES
Definition: m2mb_lwm2m.h:92
M2MB_LWM2M_CONN_REQ_IND_T
Definition: m2mb_lwm2m.h:438
M2MB_LWM2M_NFYACK_INFO_IND_T
Definition: m2mb_lwm2m.h:544
m2mb_lwm2m_write
M2MB_RESULT_E m2mb_lwm2m_write(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *inbuf, UINT16 inbuflen)
m2mb_lwm2m_write writes the LwM2M resource at the given URI
m2mb_os_malloc
void * m2mb_os_malloc(UINT32 size)
Allocates bytes of memory.
M2MB_LWM2M_WRITE_RES_T
Definition: m2mb_lwm2m.h:385
M2MB_LWM2M_GET_TYPE_RES_T
Definition: m2mb_lwm2m.h:431
M2MB_LWM2M_NFYACK_INFO_IND_T::agent
UINT16 agent
Definition: m2mb_lwm2m.h:547
M2MB_LWM2M_NEW_INST_RES_T
Definition: m2mb_lwm2m.h:493
m2mb_lwm2m_injkeys
M2MB_RESULT_E m2mb_lwm2m_injkeys(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_KEY_ACTION_E action, M2MB_LWM2M_KEYS_T *keys)
m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent.
m2mb_lwm2m_set
M2MB_RESULT_E m2mb_lwm2m_set(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *inbuf, UINT16 inbuflen)
m2mb_lwm2m_set sets the value of a LwM2M resource at module side
M2MB_LWM2M_FOTA_ACK_RES_T::result
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:588
m2mb_os_calloc
void * m2mb_os_calloc(UINT32 size)
Allocates bytes of memory and init space with 0.
M2MB_LWM2M_RES_T
Definition: m2mb_lwm2m.h:348
M2MB_LWM2M_ACK_REQ_T
Definition: m2mb_lwm2m.h:298
M2MB_LWM2M_KEYS_T::endpoint_name
CHAR endpoint_name[M2MB_LWM2M_MAX_ENDPOINT_NAME_LEN+1]
Definition: m2mb_lwm2m.h:337
M2MB_LWM2M_GET_RES_T
Definition: m2mb_lwm2m.h:409
M2MB_LWM2M_NFYACK_INFO_IND_T::uri
M2MB_LWM2M_OBJ_URI_T uri
Definition: m2mb_lwm2m.h:546
M2MB_LWM2M_RES_T::result
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:350
M2MB_LWM2M_EVENT_E
M2MB_LWM2M_EVENT_E
Definition: m2mb_lwm2m.h:72
m2mb_lwm2m_nfy_ack_uri
M2MB_RESULT_E m2mb_lwm2m_nfy_ack_uri(M2MB_LWM2M_HANDLE h, BOOLEAN add, M2MB_LWM2M_OBJ_URI_T *uri)
m2mb_lwm2m_nfy_ack_uri adds or removes a resource URI to the list for Notify Ack reporting
M2MB_LWM2M_KEY_CREATE
Definition: m2mb_lwm2m.h:254
M2MB_LWM2M_SET_RES_T
Definition: m2mb_lwm2m.h:401
M2MB_LWM2M_STS_RES_T
Definition: m2mb_lwm2m.h:426
M2MB_LWM2M_FOTA_CFG_RES_T
the m2mb_lwm2m_fota_cfg response data structure
Definition: m2mb_lwm2m.h:566
M2MB_LWM2M_NFYACK_STATUS_RES_T::result
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:507
m2mb_lwm2m_mon
M2MB_RESULT_E m2mb_lwm2m_mon(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, M2MB_LWM2M_MON_REQ_T *mon_params)
m2mb_lwm2m_mon sets the monitoring status an LwM2M resource at module side
m2mb_lwm2m_agent_config
M2MB_RESULT_E m2mb_lwm2m_agent_config(M2MB_LWM2M_HANDLE h, UINT16 agentID)
m2mb_lwm2m_agent_config propagates the specified client for a specific operation (such as read,...
M2MB_LWM2M_NFYACK_URI_RES_T
Definition: m2mb_lwm2m.h:518
M2MB_LWM2M_NFYACK_STATUS_RES_T
Definition: m2mb_lwm2m.h:505
M2MB_LWM2M_NFYACK_URI_RES_T::result
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:520
m2mb_lwm2m_sts
M2MB_RESULT_E m2mb_lwm2m_sts(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_STS_URI_T *reqStsStructure)
m2mb_lwm2m_sts sets the next server's address
m2mb_lwm2m_read
M2MB_RESULT_E m2mb_lwm2m_read(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *outbuf, UINT16 outbuflen)
m2mb_lwm2m_read reads the LwM2M resource at the given URI
M2MB_LWM2M_NFYACK_STATUS_RES_T::enabled
BOOLEAN enabled
Definition: m2mb_lwm2m.h:509
m2mb_lwm2m_nfy_ack_status
M2MB_RESULT_E m2mb_lwm2m_nfy_ack_status(M2MB_LWM2M_HANDLE h, BOOLEAN set, BOOLEAN enable)
m2mb_lwm2m_nfy_ack_status sets or gets the flag to enable or disable Notify Ack reporting
M2MB_LWM2M_KEYS_T::secret_key
CHAR secret_key[M2MB_LWM2M_DTLS_PSK_MAX_KEY_LEN+1]
Definition: m2mb_lwm2m.h:339
m2mb_lwm2m_fota_cfg
M2MB_RESULT_E m2mb_lwm2m_fota_cfg(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_CFG_REQ_T *cfg_params)
m2mb_lwm2m_fota_cfg sets and stores the fota mode.
m2mb_lwm2m_nfy_ack_list
M2MB_RESULT_E m2mb_lwm2m_nfy_ack_list(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uriList, UINT8 listElementsNumber)
m2mb_lwm2m_nfy_ack_list retrieves the list for Notify Ack reporting
m2mb_lwm2m_init
M2MB_RESULT_E m2mb_lwm2m_init(M2MB_LWM2M_HANDLE *h, m2mb_lwm2m_ind_callback cb, void *cb_user_param)
m2mb_lwm2m_init initializes, for current client, the capability to interact with LwM2M agent.
M2MB_LWM2M_STS_URI_T
Definition: m2mb_lwm2m.h:319
m2mb_lwm2m_exec
M2MB_RESULT_E m2mb_lwm2m_exec(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri)
m2mb_lwm2m_exec executes the LwM2M resource at the given URI
M2MB_LWM2M_NFYACK_INFO_IND_T::shServerId
UINT16 shServerId
Definition: m2mb_lwm2m.h:548
M2MB_LWM2M_NFYACK_LIST_RES_T
Definition: m2mb_lwm2m.h:530