 |
m2mb API docs
37.00.005.1
m2mb API sets documentation
|
Header file for m2mb_lwm2m APIs.
More...
Go to the source code of this file.
|
|
#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 */ |
| |
|
| 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_CIPHER_CFG_RES,
M2MB_LWM2M_FOTA_CFG_RES,
M2MB_LWM2M_CIPHER_CFG_READ_RES,
M2MB_LWM2M_FOTA_CFG_READ_RES,
M2MB_LWM2M_FOTA_ACK_RES,
M2MB_LWM2M_FOTA_STATE_RES,
M2MB_LWM2M_INJKEYS_RES,
M2MB_LWM2M_ODIS_RES,
M2MB_LWM2M_EXIST_RES,
M2MB_LWM2M_GET_LIST_NUM_RES,
M2MB_LWM2M_LIST_RES,
M2MB_LWM2M_CUST_RES,
M2MB_LWM2M_GET_REG_NUM_RES,
M2MB_LWM2M_REG_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_OBJSET_RES = 90,
M2MB_LWM2M_OBJGET_RES,
M2MB_LWM2M_CFG_RES,
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_FAIL_AGENT_UNAVAILABLE,
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
} |
| | the client interface status, in terms of operativity More...
|
| |
| enum | M2MB_LWM2M_CL_STATE_E {
M2MB_LWM2M_CL_STATE_DISABLED,
M2MB_LWM2M_CL_STATE_DEREGISTERED = 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
} |
| | the client internal status More...
|
| |
| 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_FORCE_EXIT,
M2MB_LWM2M_INFO_CLIENT_DISABLED,
M2MB_LWM2M_INFO_REG_FAILURE,
M2MB_LWM2M_INFO_ID_MAX
} |
| | general client event info More...
|
| |
| 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_CIPHER_MODE_E { M2MB_LWM2M_CIPHER_MODE_DEFAULT = 0,
M2MB_LWM2M_CIPHER_MODE_ECDH = 1,
M2MB_LWM2M_CIPHER_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_REJECT = 4,
M2MB_LWM2M_FOTA_MODE_MAX_NUM
} |
| | the ciphers supported by the m2mb lwm2m More...
|
| |
| enum | M2MB_LWM2M_FOTA_TOUT_ACTION_E { M2MB_LWM2M_FOTA_TOUT_ACTION_RESET_SM = 0,
M2MB_LWM2M_FOTA_TOUT_ACTION_ACK = 1,
M2MB_LWM2M_FOTA_TOUT_ACTION_MAX_NUM
} |
| | the fota timeout actions 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 | ODIS_PARAMETERS_E {
ODIS_HOST_DEVICE_ID = 0,
ODIS_HOST_DEVICE_MANUFACTURER = 1,
ODIS_HOST_DEVICE_MODEL = 2,
ODIS_HOST_DEVICE_SW_VERSION = 3,
ODIS_HOST_INSTANCE_ID = 4,
ODIS_HOST_PARAM_MAX_NUMBER = 5
} |
| | the parameters set for +ODIS command More...
|
| |
| enum | M2MB_LWM2M_CUST_PARAM_ID_E { M2MB_LWM2M_CUST_PARAM_ID_CARRIER = 0,
M2MB_LWM2M_CUST_PARAM_ID_DLT = 1,
M2MB_LWM2M_CUST_PARAM_ID_MAX
} |
| | the admitted parameters enum for #LWM2MCUST command More...
|
| |
| enum | CUST_PARAMETERS_E { CUST_PARAMETERS_COMMAND_ID = 0,
CUST_PARAMETERS_DATA = 1,
CUST_PARAM_MAX_NUMBER
} |
| | the parameters set for #LWM2MCUST command More...
|
| |
| enum | REG_PARAMETERS_E { REG_PARAMETERS_AGENT_ID = 0,
REG_PARAMETERS_SERVER_ID = 1,
REG_PARAMETERS_ACTION_ID = 2,
REG_PARAM_MAX_NUMBER
} |
| | the parameters set for #LWM2MREG command More...
|
| |
| enum | M2MB_LWM2M_REG_ACTION_E {
M2MB_LWM2M_REG_ACTION_FORCE_DEREG = 0,
M2MB_LWM2M_REG_ACTION_FORCE_REG = 1,
M2MB_LWM2M_REG_ACTION_UPDATE_REG = 2,
M2MB_LWM2M_REG_ACTION_GET_SRV_INFO = 3,
M2MB_LWM2M_REG_ACTION_MAX_NUM
} |
| | the actions set More...
|
| |
| enum | M2MB_LWM2M_REG_STATUS_E { M2MB_LWM2M_REG_STATUS_DEREGISTERED = 0,
M2MB_LWM2M_REG_STATUS_SUSPENDED = 1,
M2MB_LWM2M_REG_STATUS_REGISTERED = 2,
M2MB_LWM2M_REG_STATUS_MAX_NUM
} |
| | the server operation requests set More...
|
| |
| enum | M2MB_LWM2M_REG_ERROR_CODE_E {
M2MB_LWM2M_REG_SUCCESS = 0,
M2MB_LWM2M_REG_ALREADY_REGISTERED = 1,
M2MB_LWM2M_REG_ALREADY_DEREGISTERED = 2,
M2MB_LWM2M_REG_SERVER_NOT_FOUND = 3,
M2MB_LWM2M_REG_CLIENT_DISABLED = 4,
M2MB_LWM2M_REG_MAX_NUM
} |
| |
| 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
} |
| |
| enum | LWM2M_FOTA_INTERNAL_STATUS_E {
LWM2M_FOTA_INTERNAL_STATUS_IDLE,
LWM2M_FOTA_INTERNAL_STATUS_FOTA_REQ_INIT,
LWM2M_FOTA_INTERNAL_STATUS_WAIT_DWL_ACK,
LWM2M_FOTA_INTERNAL_STATUS_DOWNLOADING,
LWM2M_FOTA_INTERNAL_STATUS_DOWNLOADED,
LWM2M_FOTA_INTERNAL_STATUS_DELTA_CHECK,
LWM2M_FOTA_INTERNAL_STATUS_WAIT_UPD_ACK,
LWM2M_FOTA_INTERNAL_STATUS_UPDATING,
LWM2M_FOTA_INTERNAL_STATUS_REJECT,
LWM2M_FOTA_INTERNAL_STATUS_FAILED,
LWM2M_FOTA_INTERNAL_STATUS_MAX_NUMBER
} |
| |
| enum | LWM2M_FW_OBJ_STATE_E {
LWM2M_FW_OBJ_STATE_IDLE,
LWM2M_FW_OBJ_STATE_DOWNLOADING,
LWM2M_FW_OBJ_STATE_DOWNLOADED,
LWM2M_FW_OBJ_STATE_UPDATING,
LWM2M_FW_OBJ_STATE_MAX_NUMBER
} |
| |
| enum | M2MB_LWM2M_CFG_ACTIONID_E { M2MB_LWM2M_CFG_ACTIONID_SET = 0,
M2MB_LWM2M_CFG_ACTIONID_GET = 1,
M2MB_LWM2M_CFG_ACTIONID_MAX_NUM
} |
| | the list of actions accepted by m2mb_lwm2m_cfg api More...
|
| |
| enum | M2MB_LWM2M_CFG_PARAMID_E {
M2MB_LWM2M_CFG_PARAMID_STOUT = 0,
M2MB_LWM2M_CFG_PARAMID_IPV4_ONLY = 1,
M2MB_LWM2M_CFG_PARAMID_COAP_ACK = 2,
M2MB_LWM2M_CFG_PARAMID_COAP_RETRANS = 3,
M2MB_LWM2M_CFG_PARAMID_EXT_POLLING = 4,
M2MB_LWM2M_CFG_PARAMID_AGENTCID = 5,
M2MB_LWM2M_CFG_PARAMID_GNSS = 6,
M2MB_LWM2M_CFG_PARAMID_REG_URC = 7,
M2MB_LWM2M_CFG_PARAMID_PDP_USER = 8,
M2MB_LWM2M_CFG_PARAMID_DTLS_RETRANS_STAT = 9,
M2MB_LWM2M_CFG_PARAMID_MAX_NUM
} |
| | the paramId set More...
|
| |
|
| 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 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_cipher_cfg (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CIPHER_CFG_REQ_T *cfg_params) |
| | m2mb_lwm2m_cipher_cfg sets and stores the cipher configuration. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_cipher_cfg_read (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CIPHER_CFG_ITEM_T *cipherCfgData, UINT8 maxItemsNumber) |
| | m2mb_lwm2m_cipher_cfg_read reads the cipher configuration for all the active clients. 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_cfg_read (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_CFG_ITEM_T *fotaCfgData, UINT8 maxItemsNumber) |
| | m2mb_lwm2m_fota_cfg_read reads the fota mode for all the active clients. 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_fota_status (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_STATE_T *fotaStateData) |
| | m2mb_lwm2m_fota_status returns the fota data for the spcified LwM2M client. 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...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_odis_reset (M2MB_LWM2M_HANDLE h) |
| | m2mb_lwm2m_odis_reset is in charge of resetting the handler data fields reserved for odis. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_odis_config (M2MB_LWM2M_HANDLE h, ODIS_PARAMETERS_E odis_item, CHAR *odis_data) |
| | m2mb_lwm2m_odis_config is in charge of filling the selected otis item with the given data. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_odis (M2MB_LWM2M_HANDLE h) |
| | m2mb_lwm2m_odis allows the user to store the odis data set into nv memory. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_odis_set (M2MB_LWM2M_HANDLE h, UINT8 odis_instance) |
| | m2mb_lwm2m_odis_set allows the user to store the odis data set into the given instance in nv memory. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_exist (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri) |
| | m2mb_lwm2m_exist returns the existence or not for a given uri/agent More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_get_list_entries (M2MB_LWM2M_HANDLE h) |
| | m2mb_lwm2m_get_list_entries returns the overall number of elements, expressed in M2MB_LWM2M_LIST_ELEMENT_RES_T units, necessary to specify all the objects/instances currently defined for a client. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_list (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_LIST_ELEMENT_RES_T *listPointer, UINT16 listSize) |
| | m2mb_lwm2m_list returns all the objects/instances defined for a client More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_cust (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CUST_PARAM_T *custReq) |
| | m2mb_lwm2m_cust stores the customization data. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_cfg (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CFG_PARAM_T *cfgReq) |
| | m2mb_lwm2m_cfg sets or retrieves the lwm2m configuration value related to a given parameter More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_get_reg_entries (M2MB_LWM2M_HANDLE h) |
| | m2mb_lwm2m_get_reg_entries returns the overall number of elements, expressed in M2MB_LWM2M_REG_ELEMENT_RES_T units, needed to specify all the information currently stored for the server data, when calling the m2mb_lwm2m_reg with M2MB_LWM2M_REG_ACTION_GET_SRV_INFO action. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_reg (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_REG_PARAM_T *regReq, M2MB_LWM2M_REG_ELEMENT_RES_T *listPointer, UINT16 listSize) |
| | m2mb_lwm2m_reg manages the user connection request for the specified server. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_objset (M2MB_LWM2M_HANDLE h, const M2MB_LWM2M_OBJSET_PARAM_T *objSetReq) |
| | m2mb_lwm2m_objset updates one or more resources of a Lwm2m object instance. More...
|
| |
| M2MB_RESULT_E | m2mb_lwm2m_objget (M2MB_LWM2M_HANDLE h, const M2MB_LWM2M_OBJGET_PARAM_T *objGetReq, CHAR *objGetRespString, UINT16 objGetRespSize) |
| | m2mb_lwm2m_objget reads a Lwm2m object/object instance/resource. More...
|
| |
Header file for m2mb_lwm2m APIs.
m2m/m2m_common/m2mb_inc/m2mb_lwm2m.h
m2mb_lwm2m APIs provide actions and events for LWM2M management.
- Note
- Dependencies: m2mb_types.h
- Author
- Roberto Caboni
- Date
- 03/05/2018
◆ M2MB_LWM2M_REG_RES_T
◆ CUST_PARAMETERS_E
the parameters set for #LWM2MCUST command
| Enumerator |
|---|
| CUST_PARAMETERS_COMMAND_ID | parameter identifier
|
| CUST_PARAMETERS_DATA | data identifier
|
| CUST_PARAM_MAX_NUMBER | pls insert any further value above CUST_PARAM_MAX_NUMBER
|
◆ LWM2M_FOTA_INTERNAL_STATUS_E
| Enumerator |
|---|
| LWM2M_FOTA_INTERNAL_STATUS_IDLE | no operation ongoing
|
| LWM2M_FOTA_INTERNAL_STATUS_FOTA_REQ_INIT | fota request has just arrived
|
| LWM2M_FOTA_INTERNAL_STATUS_WAIT_DWL_ACK | download request received, waiting for ack
|
| LWM2M_FOTA_INTERNAL_STATUS_DOWNLOADING | download in progress
|
| LWM2M_FOTA_INTERNAL_STATUS_DOWNLOADED | download completed
|
| LWM2M_FOTA_INTERNAL_STATUS_DELTA_CHECK | delta integrity check in progress
|
| LWM2M_FOTA_INTERNAL_STATUS_WAIT_UPD_ACK | update request received, waiting for ack
|
| LWM2M_FOTA_INTERNAL_STATUS_UPDATING | update in progress
|
| LWM2M_FOTA_INTERNAL_STATUS_REJECT | fota rejected status
|
| LWM2M_FOTA_INTERNAL_STATUS_FAILED | fota process failed
|
| LWM2M_FOTA_INTERNAL_STATUS_MAX_NUMBER | pls insert any further value above LWM2M_FOTA_INTERNAL_STATUS_MAX_NUMBER
|
◆ LWM2M_FW_OBJ_STATE_E
| Enumerator |
|---|
| LWM2M_FW_OBJ_STATE_IDLE | no FOTA operation currently in progress
|
| LWM2M_FW_OBJ_STATE_DOWNLOADING | download in progress
|
| LWM2M_FW_OBJ_STATE_DOWNLOADED | download completed, ready to update
|
| LWM2M_FW_OBJ_STATE_UPDATING | update in progress
|
| LWM2M_FW_OBJ_STATE_MAX_NUMBER | pls insert any further value above LWM2M_FW_OBJ_STATE_MAX_NUMBER
|
◆ M2MB_LWM2M_CFG_ACTIONID_E
the list of actions accepted by m2mb_lwm2m_cfg api
| Enumerator |
|---|
| M2MB_LWM2M_CFG_ACTIONID_SET | Set a new value
|
| M2MB_LWM2M_CFG_ACTIONID_GET | Get the value
|
| M2MB_LWM2M_CFG_ACTIONID_MAX_NUM | pls insert any further value above M2MB_LWM2M_CFG_ACTIONID_MAX_NUM
|
◆ M2MB_LWM2M_CFG_PARAMID_E
the paramId set
| Enumerator |
|---|
| M2MB_LWM2M_CFG_PARAMID_STOUT | Session timeout value
|
| M2MB_LWM2M_CFG_PARAMID_IPV4_ONLY | Force to use IPv4 only for LwM2M communications
|
| M2MB_LWM2M_CFG_PARAMID_COAP_ACK | COAP ack_timeout value
|
| M2MB_LWM2M_CFG_PARAMID_COAP_RETRANS | COAP max_retransmit value
|
| M2MB_LWM2M_CFG_PARAMID_EXT_POLLING | External observations polling time
|
| M2MB_LWM2M_CFG_PARAMID_AGENTCID | Pdp context to be used by the client
|
| M2MB_LWM2M_CFG_PARAMID_GNSS | GNSS service
|
| M2MB_LWM2M_CFG_PARAMID_REG_URC | Registration URCs
|
| M2MB_LWM2M_CFG_PARAMID_PDP_USER | User-activated context
|
| M2MB_LWM2M_CFG_PARAMID_DTLS_RETRANS_STAT | DTLS retransmit enable or disable status value
|
| M2MB_LWM2M_CFG_PARAMID_MAX_NUM | pls insert any further value above M2MB_LWM2M_CFG_PARAMID_MAX_NUM
|
◆ M2MB_LWM2M_CIPHER_MODE_E
| Enumerator |
|---|
| M2MB_LWM2M_CIPHER_MODE_DEFAULT | default ciphers
|
| M2MB_LWM2M_CIPHER_MODE_ECDH | ECDH ciphers
|
| M2MB_LWM2M_CIPHER_MODE_MAX_NUM | first invalid code; every successive insertions should be above this symbol
|
◆ M2MB_LWM2M_CL_STATE_E
the client internal status
| Enumerator |
|---|
| M2MB_LWM2M_CL_STATE_DEREGISTERED | disabled/deregistered status
|
| M2MB_LWM2M_CL_STATE_BOOTSTRAPPING | client is bootstrapping
|
| M2MB_LWM2M_CL_STATE_BOOTSTRAPPED | client is bootstrapped
|
| M2MB_LWM2M_CL_STATE_REGISTERING | client is registering
|
| M2MB_LWM2M_CL_STATE_REGISTERED | client is registered
|
| M2MB_LWM2M_CL_STATE_DEREGISTERING | client is deregistering
|
| M2MB_LWM2M_CL_STATE_SUSPENDED | client is suspended
|
◆ M2MB_LWM2M_CUST_PARAM_ID_E
the admitted parameters enum for #LWM2MCUST command
| Enumerator |
|---|
| M2MB_LWM2M_CUST_PARAM_ID_CARRIER | the customization carrier identifier
|
| M2MB_LWM2M_CUST_PARAM_ID_DLT | param id to delete the existing customization, if any
|
| M2MB_LWM2M_CUST_PARAM_ID_MAX | pls insert any further value above the label M2MB_LWM2M_CUST_PARAM_ID_MAX
|
◆ 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_CIPHER_CFG_RES | the cipher configuration m2mb response identifier
|
| M2MB_LWM2M_FOTA_CFG_RES | the fota configuration m2mb response identifier
|
| M2MB_LWM2M_CIPHER_CFG_READ_RES | the cipher configuration read m2mb response identifier
|
| M2MB_LWM2M_FOTA_CFG_READ_RES | the fota configuration read m2mb response identifier
|
| M2MB_LWM2M_FOTA_ACK_RES | the fota ack m2mb response identifier
|
| M2MB_LWM2M_FOTA_STATE_RES | the fota state m2mb response identifier
|
| M2MB_LWM2M_ODIS_RES | the odis m2mb response identifier
|
| M2MB_LWM2M_EXIST_RES | the exist check response identifier
|
| M2MB_LWM2M_GET_LIST_NUM_RES | the elements number for LIST command identifier
|
| M2MB_LWM2M_LIST_RES | the list check response identifier
|
| M2MB_LWM2M_CUST_RES | the customization response identifier
|
| M2MB_LWM2M_GET_REG_NUM_RES | the elements number for REG command identifier
|
| M2MB_LWM2M_REG_RES | the reg response identifier
|
| M2MB_LWM2M_OBJSET_RES | the object set response identifier
|
| M2MB_LWM2M_OBJGET_RES | the object get response identifier
|
| M2MB_LWM2M_CFG_RES | the cfg 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 | first invalid code; every successive insertions should be above this symbol
|
◆ M2MB_LWM2M_FOTA_MODE_E
the ciphers supported by the m2mb lwm2m
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_REJECT | reject the fota request
|
| M2MB_LWM2M_FOTA_MODE_MAX_NUM | first invalid code; every successive insertions should be above this symbol
|
◆ M2MB_LWM2M_FOTA_TOUT_ACTION_E
the fota timeout actions supported by the m2mb lwm2m
| Enumerator |
|---|
| M2MB_LWM2M_FOTA_TOUT_ACTION_RESET_SM | FOTA state machine is reset after the timeout period
|
| M2MB_LWM2M_FOTA_TOUT_ACTION_ACK | ack is automatically sent after the timeout period
|
| M2MB_LWM2M_FOTA_TOUT_ACTION_MAX_NUM | first invalid code; every successive insertions should be above this symbol
|
◆ M2MB_LWM2M_IF_STATE_E
the client interface status, in terms of operativity
| Enumerator |
|---|
| M2MB_LWM2M_IF_STATE_NONE | init value
|
| M2MB_LWM2M_IF_STATE_DISABLED | client operativity is disabled or suspended
|
| M2MB_LWM2M_IF_STATE_ACK_WAIT | client is waiting for an ACK for its operativity
|
| M2MB_LWM2M_IF_STATE_ACTIVE | client is in its active timing window currently
|
| M2MB_LWM2M_IF_STATE_IDLE | client is in its idle timing window currently
|
| M2MB_LWM2M_IF_STATE_DEREG_WAIT | client is waiting for an ACK for deregistering
|
| M2MB_LWM2M_IF_STATE_DEREGISTERING | client is deregistering
|
◆ M2MB_LWM2M_INFO_ID_E
general client event info
| Enumerator |
|---|
| M2MB_LWM2M_INFO_FOTA_REBOOT | the device will be rebooted to complete a FOTA update
|
| M2MB_LWM2M_INFO_DEVICE_REBOOT | the device will be rebooted
|
| M2MB_LWM2M_INFO_RESOURCE_EXECUTE | an executable resource has been called
|
| M2MB_LWM2M_INFO_FORCE_EXIT | the client will be forcefully disabled
|
| M2MB_LWM2M_INFO_CLIENT_DISABLED | all servers deregistered and client effectively disabled
|
| M2MB_LWM2M_INFO_REG_FAILURE | a server failed to complete the registration
|
◆ 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
|
◆ M2MB_LWM2M_REG_ACTION_E
the actions set
| Enumerator |
|---|
| M2MB_LWM2M_REG_ACTION_FORCE_DEREG | deregister from the given server request
|
| M2MB_LWM2M_REG_ACTION_FORCE_REG | registration towards the given server request
|
| M2MB_LWM2M_REG_ACTION_UPDATE_REG | update registration towards the given server request
|
| M2MB_LWM2M_REG_ACTION_GET_SRV_INFO | retrive the server registration status request
|
| M2MB_LWM2M_REG_ACTION_MAX_NUM | pls insert any further value above M2MB_LWM2M_REG_ACTION_MAX_NUM
|
◆ M2MB_LWM2M_REG_ERROR_CODE_E
| Enumerator |
|---|
| M2MB_LWM2M_REG_SUCCESS | operation successful
|
| M2MB_LWM2M_REG_ALREADY_REGISTERED | already registered to server code
|
| M2MB_LWM2M_REG_ALREADY_DEREGISTERED | already deregistered to server code
|
| M2MB_LWM2M_REG_SERVER_NOT_FOUND | server not found code
|
| M2MB_LWM2M_REG_CLIENT_DISABLED | client disabled code
|
| M2MB_LWM2M_REG_MAX_NUM | pls insert any further value above M2MB_LWM2M_REG_MAX_NUM
|
◆ M2MB_LWM2M_REG_STATUS_E
the server operation requests set
| Enumerator |
|---|
| M2MB_LWM2M_REG_STATUS_DEREGISTERED | deregistered status
|
| M2MB_LWM2M_REG_STATUS_SUSPENDED | suspended status
|
| M2MB_LWM2M_REG_STATUS_REGISTERED | registered status
|
| M2MB_LWM2M_REG_STATUS_MAX_NUM | pls insert any further value above M2MB_LWM2M_REG_STATUS_MAX_NUM
|
◆ M2MB_LWM2M_RESULT_E
| Enumerator |
|---|
| M2MB_LWM2M_RES_FAIL_AGENT_UNAVAILABLE | the agent unavailable error code
|
◆ ODIS_PARAMETERS_E
the parameters set for +ODIS command
| Enumerator |
|---|
| ODIS_HOST_DEVICE_ID | Unique host device identifier
|
| ODIS_HOST_DEVICE_MANUFACTURER | host device manufacturer
|
| ODIS_HOST_DEVICE_MODEL | host device model
|
| ODIS_HOST_DEVICE_SW_VERSION | host device software version
|
| ODIS_HOST_INSTANCE_ID | Odis instance identifier
|
| ODIS_HOST_PARAM_MAX_NUMBER | pls insert any further value above ODIS_HOST_PARAM_MAX_NUMBER
|
◆ REG_PARAMETERS_E
the parameters set for #LWM2MREG command
| Enumerator |
|---|
| REG_PARAMETERS_AGENT_ID | agent identifier
|
| REG_PARAMETERS_SERVER_ID | short server identifier
|
| REG_PARAMETERS_ACTION_ID | action identifier
|
| REG_PARAM_MAX_NUMBER | pls insert any further value above REG_PARAM_MAX_NUMBER
|
◆ m2mb_lwm2m_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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | ack_params | pointer 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 );
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 )
{
if( retVal == M2MB_RESULT_SUCCESS )
{
}
}
else
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
if ( retVal == M2MB_RESULT_SUCCESS )
{
}
}
◆ 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | agentID | a 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;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 4;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_exec request succeeded" );
}
}
◆ m2mb_lwm2m_cfg()
m2mb_lwm2m_cfg sets or retrieves the lwm2m configuration value related to a given parameter
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | cfgReq | the cfg required data, expressed in the M2MB_LWM2M_CFG_PARAM_T type. |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
m2mb_lwm2m_cfg( h, cfgReq );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
cfgReq.agentId = agentID;
cfg.paramId = 0;
cfgReq.value = 60;
{
printf( "m2mb_lwm2m_cfg request succeeded" );
}
else
{
printf( "m2mb_lwm2m_cfg request failed" );
}
}
◆ m2mb_lwm2m_cipher_cfg()
m2mb_lwm2m_cipher_cfg sets and stores the cipher configuration.
m2mb_lwm2m_cipher_cfg allows the user to set the cipher during runtime. 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_CIPHER_CFG_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_CIPHER_CFG_RES_T type.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | cfg_params | a structure containing the cipher to be used 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_cipher_cfg( h, cfg_params );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf( "Returning resource type: result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Setting Cipher config succeeded" );
}
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_cipher_cfg request succeeded" );
}
}
◆ m2mb_lwm2m_cipher_cfg_read()
m2mb_lwm2m_cipher_cfg_read reads the cipher configuration for all the active clients.
m2mb_lwm2m_cipher_cfg_read allows the user to read the cipher setting configured for all the active clients. The function is non-blocking. This means that the function returns immediately, but the response data is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_CIPHER_CFG_READ_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_CIPHER_CFG_READ_RES_T type.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | cipherCfgData | pointer to a M2MB_LWM2M_CIPHER_CFG_ITEM_T structure array that will be filled with the cipher setting info related to the active clients. |
| [in] | maxItemsNumber | the maximum M2MB_LWM2M_CIPHER_CFG_ITEM_T elements number that will be filled with the fota mode info. |
- Returns
- a value from M2MB_RESULT_E
- Note
m2mb_lwm2m_cipher_cfg_read( h, cipherCfgData, maxItemsNumber );
#define MAX_ITEM_NUM_FOR_CIPHER_CFG_READ ( 2 ) //max num of cipher cfg items to be read
void myCallback( M2MB_LWM2M_HANDLE h,
UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf(
"Returning resource type: result %d", resp->
result );
if( resp->
result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Cipher configuations read succeeded" );
}
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT8 maxItemNum = MAX_ITEM_NUM_FOR_CIPHER_CFG_READ;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_cipher_cfg_read request succeeded" );
}
}
◆ m2mb_lwm2m_cust()
m2mb_lwm2m_cust stores the customization data.
m2mb_lwm2m_cust is intended to store the customization data. The function is not blocking. In case of success, nothing is returned; instead, the callback defined in m2mb_lwm2m_init is configured to receive the required data through the M2MB_LWM2M_CUST_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_CUST_RES_T type. In case of fatal error (example: client not ready), the function returns with a failure code and no callback is issued. In case of successful operation, the chosen customization will be applied after the next power-cycle.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | custReq | the cust required data, expressed in the M2MB_LWM2M_CUST_PARAM_T type. |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- The command is executed by the Telit LwM2M client task, therefore that client should be active (not skipped).
m2mb_lwm2m_cust( h, custReq );
void myCallback( M2MB_LWM2M_HANDLE h,
UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
if( resp->
result == M2MB_LWM2M_RES_SUCCESS )
{
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
UINT32 dataLength = strlen( "DCM" );
{
memcpy( cust.data.buffer, atpParam->item[CUST_PARAMETERS], dataLength );
{
printf( "m2mb_lwm2m_cust request succeeded" );
}
else
{
printf( "m2mb_lwm2m_cust request failed" );
}
}
}
◆ 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] | h | the 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;
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] | h | the 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;
if ( retVal == M2MB_RESULT_SUCCESS )
{
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_disable succeeded" );
}
}
◆ m2mb_lwm2m_enable()
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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | en_params | a 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;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_enable succeeded" );
}
◆ m2mb_lwm2m_exec()
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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a 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, );
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:
{
printf( "Exec result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 4;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_exec request succeeded" );
}
}
◆ m2mb_lwm2m_exist()
m2mb_lwm2m_exist returns the existence or not for a given uri/agent
m2mb_lwm2m_exist returns 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 exist 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 operation, the given uri data (if inserted) and the boolean reporting whether the uri/agent is existent or not are copied in the buffer passed by the user. In case the user is interested in an agent existence query, the uri should be passed and it should be filled with uri.uriLen = M2MB_LWM2M_URI_0_FIELDS. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_exist.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a structure defining the uri of the resource to be investigated. |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- The objects from Connection Statistics (/7) are allowed to be investigated, therefore a query for objects <7 results in a failure. The given uri and agent are returned with the M2MB_LWM2M_EXIST_RES_T structure.
m2mb_lwm2m_exist( h, uri );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
printf(
"Exist result %d", resp->
result );
if( resp->
result == M2M_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
uri.uriLen = M2MB_LWM2M_URI_4_FIELDS;
uri.obj = 11;
uri.objInst = 1;
uri.resource = 4;
uri.resourceInst = 0;
if( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_exist request succeeded" );
}
}
◆ m2mb_lwm2m_fota_ack()
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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | ack_params | a 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 );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf(
"Returning resource type: result %d", resp->
result );
if( resp->
result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Fota config succeeded" );
}
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
fotaAckParams.action = M2MB_LWM2M_FOTA_ACTION_ACK;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_fota_ack request succeeded" );
}
}
◆ m2mb_lwm2m_fota_cfg()
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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | cfg_params | a 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 );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf(
"Returning resource type: result %d", resp->
result );
if( resp->
result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Fota config succeeded" );
}
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
cfg_params.mode = M2MB_LWM2M_FOTA_MODE_ALL_ACKED;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_fota_cfg request succeeded" );
}
}
◆ m2mb_lwm2m_fota_cfg_read()
m2mb_lwm2m_fota_cfg_read reads the fota mode for all the active clients.
m2mb_lwm2m_fota_cfg_read allows the user to read the fota mode configured for all the active clients. The function is non-blocking. This means that the function returns immediately, but the response data is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_FOTA_CFG_READ_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_FOTA_CFG_READ_RES_T type.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | fotaCfgData | pointer to a M2MB_LWM2M_FOTA_CFG_ITEM_T structure array that will be filled with the fota mode info related to the active clients. |
| [in] | maxItemsNumber | the maximum M2MB_LWM2M_FOTA_CFG_ITEM_T elements number that will be filled with the fota mode info. |
- Returns
- a value from M2MB_RESULT_E
- Note
m2mb_lwm2m_fota_cfg_read( h, fotaCfgData, maxItemsNumber );
#define MAX_ITEM_NUM_FOR_FOTA_CFG_READ ( 2 ) //max num of fota cfg items to be read
void myCallback( M2MB_LWM2M_HANDLE h,
UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf(
"Returning resource type: result %d", resp->
result );
if( resp->
result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Fota configuations read succeeded" );
}
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT8 maxItemNum = MAX_ITEM_NUM_FOR_FOTA_CFG_READ;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_fota_cfg_read request succeeded" );
}
}
◆ m2mb_lwm2m_fota_status()
m2mb_lwm2m_fota_status returns the fota data for the spcified LwM2M client.
m2mb_lwm2m_fota_status allows the user to acquire the client data related to the FOTA operations, in terms of current status and data exposed to the LwM2M server; moreover, in case of acknowledged FOTA configuration (i.e.: see m2mb_lwm2m_fota_cfg API), the data will contain also a valid 'ACK' time expiring, in case the client is waiting for an 'ACK'. 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_STATE_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_FOTA_STATE_RES_T type.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | fotaStateData | pointer to a structure containing the internal FOTA management data. |
- Returns
- M2MB_RESULT_SUCCESS in case of success
-
a value of M2MB_RESULT_E in case of errors
- Note
m2mb_lwm2m_fota_status( h, fotaStateData );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf(
"Returning resource type: result %d", resp->
result );
if( resp->
result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Fota status read succeeded" );
}
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_fota_status 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a 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] | outbuf | an user defined buffer to which the data will be copied. |
| [in] | outbuflen | the 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 );
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:
{
printf( "Get result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 17;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_get request succeeded" );
}
}
◆ m2mb_lwm2m_get_list_entries()
| M2MB_RESULT_E m2mb_lwm2m_get_list_entries |
( |
M2MB_LWM2M_HANDLE |
h | ) |
|
m2mb_lwm2m_get_list_entries returns the overall number of elements, expressed in M2MB_LWM2M_LIST_ELEMENT_RES_T units, necessary to specify all the objects/instances currently defined for a client.
m2mb_lwm2m_get_list_entry should be used to calculate the right dimension of the array needed for the m2mb_lwm2m_list. Using this function, the user is able to retrieve the number of the M2MB_LWM2M_LIST_ELEMENT_RES_T entries necessary to describe all the objects/instances pairs defined for a given client context; with it, the user is able to allocate the proper memory size. Since a single object could have more instances associated, every object instance is counted separately. Thus, m2mb_lwm2m_get_list_entries returns the overall entries (of M2MB_LWM2M_LIST_ELEMENT_RES_T type) that contain a valid object/object instance pair currently supported by the client. The function is not blocking. In case of success, nothing is returned; instead, the callback is configured to receive the required data through the M2MB_LWM2M_GET_LIST_NUM_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_GET_LIST_NUM_RES_T type. In case of fatal error (example: client not ready), the function returns a failure code and no callback event is issued. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_get_list_entries.
- Parameters
-
| [in] | h | the 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
- It is suggested to call the m2mb_lwm2m_get_list_entries before the m2mb_lwm2m_list, in order to calculate the right array data dimension and avoid either having the result truncated or wasting memory.
m2mb_lwm2m_get_list_entries( h );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf( "Getting list entries result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Overall items number is %d", resp->listEntries);
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
{
printf( "m2mb_lwm2m_get_list_entries request succeeded" );
}
else
{
printf( "m2mb_lwm2m_get_list_entries request failed" );
}
}
◆ m2mb_lwm2m_get_reg_entries()
| M2MB_RESULT_E m2mb_lwm2m_get_reg_entries |
( |
M2MB_LWM2M_HANDLE |
h | ) |
|
m2mb_lwm2m_get_reg_entries returns the overall number of elements, expressed in M2MB_LWM2M_REG_ELEMENT_RES_T units, needed to specify all the information currently stored for the server data, when calling the m2mb_lwm2m_reg with M2MB_LWM2M_REG_ACTION_GET_SRV_INFO action.
m2mb_lwm2m_get_reg_entries should be used to calculate the right dimension of the array needed for the m2mb_lwm2m_reg. Using this function, the user is able to retrieve the number of the M2MB_LWM2M_REG_ELEMENT_RES_T entries needed to describe all the data stored for either a single server or the entire set of them a given client context; with it, the user is able to allocate the proper memory size.
The function is not blocking. In case of success, nothing is returned; instead, the callback is configured to receive the required data through the M2MB_LWM2M_GET_REG_NUM_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_GET_REG_NUM_RES_T type. In case of errors (example: client not ready), the function returns a failure code and no callback event is issued. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_get_reg_entries.
- Parameters
-
| [in] | h | the 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
- This function has sense only when calling m2mb_lwm2m_get_reg with M2MB_LWM2M_REG_ACTION_GET_SRV_INFO action. In this case, it is suggested to call the m2mb_lwm2m_get_reg_entries before the m2mb_lwm2m_reg, in order to calculate the right array data dimension and avoid either having the result truncated or wasting memory.
m2mb_lwm2m_get_reg_entries( h );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
printf( "Getting reg entries result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Overall items number is %d", resp->regEntries);
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
{
printf( "m2mb_lwm2m_get_reg_entries request succeeded" );
}
else
{
printf( "m2mb_lwm2m_get_reg_entries request failed" );
}
}
◆ 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a structure defining the URI specified by the user. |
| [in] | outbuf | an 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 );
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:
{
printf( "Returning resource type: result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
printf( "Resource type is: %d", resp->resType );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 resType = 0;
UINT16 agentID = 0;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 33211;
uri.objInst = 0;
uri.resource = 0;
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 sof information such as the remaining time before the following registration update, expressed in seconds and in milliseconds.
- Parameters
-
| [in] | h | the 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
- Please note that, as per OneEdge specification, m2mb_lwm2m_get_stat functionality is only allowed for Telit LwM2M client. Please note that the remaining time before the update registration has only sense when the client is registered; value 0 is returned othwerise. Please note that the m2mb_lwm2m_get_stat is conceived to work only in a single server configuration. Please note that the information reported by this m2mb is strictly related to the internal client status, regardless the client-server mutual state and relation; therefore, it is possible that the client is active or idle but it is not registered to the server. To have a more reliable piece of information related to the client-server status, please refer to m2mb_lwm2m_reg, which also is managing the multi-server cases and it is not bound to the Telit LwM2M client.
m2mb_lwm2m_get_stat( h );
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 == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
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] | *h | the handle to the LwM2M service, that will be initialized by the function. |
| [in] | cb | the callback that will be called if an event or an error happens. |
| [in] | *cb_user_param | a 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 )
{
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_init succeeded" );
}
}
◆ m2mb_lwm2m_injkeys()
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 new credentials will take effect at the next module reboot. 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 cast to the M2MB_LWM2M_RES_T type.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | action | the action to execute. |
| [in] | keys | pointer 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 );
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:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "m2mb_lwm2m_injkeys OK" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
strcpy( keys.
identity,
"00112233445566778899AABBCCDDEEFF" );
strcpy( keys.
secret_key,
"FFEEDDCCBBAA99887766554433221100" );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_injkeys request succeeded" );
}
}
◆ m2mb_lwm2m_list()
m2mb_lwm2m_list returns all the objects/instances defined for a client
m2mb_lwm2m_list returns the list of objects and object instances currently supported by the client, expressed in M2MB_LWM2M_LIST_ELEMENT_RES_T items. The function is not blocking. In case of success, nothing is returned; instead, the callback defined in m2mb_lwm2m_init is configured to receive the required data through the M2MB_LWM2M_LIST_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_LIST_RES_T type. In case of fatal error (example: client not ready), the function returns with a failure core and no callback is issued. In case of successful operation, all the objects and object instances pairs are returned as consecutive elements of M2MB_LWM2M_LIST_ELEMENT_RES_T type, and the written entries is also returned on the M2MB_LWM2M_LIST_RES_T data structure. In case of successful operation but with an insufficient list size, the returned list is truncated to the last entry possibly contained in the given size's array, and the M2MB_LWM2M_LIST_RES_T parameter
- Parameters
-
| isTruncated | is set to TRUE. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_list. |
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [out] | listPointer | the pointer to the memory region that will be filled with the objects/instances, expressed in elements of M2MB_LWM2M_LIST_ELEMENT_RES_T type. |
| [in] | listSize | the size of the memory area pointed by |
| listPointer,expressed | in M2MB_LWM2M_LIST_ELEMENT_RES_T elements. |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- Although the m2mb_lwm2m_get_list_entries is not strictly necessary, its use is strongly suggested in order to calculate the right array data dimension.
m2mb_lwm2m_list( h, listPointer, listSize );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
UINT16 listSize = 15;
if( pList != NULL )
{
{
printf( "m2mb_lwm2m_list request succeeded" );
}
else
{
printf( "m2mb_lwm2m_list request failed" );
}
}
}
◆ m2mb_lwm2m_mon()
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 cast 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 along with the handler of the LwM2M client instance that required the monitoring service activation; this way, the user application could decide either taking all the indications or filtering only the ones activated by itself. resp_struct must be cast 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a 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_params | a 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 );
void myCallback( M2MB_LWM2M_HANDLE hndl,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
case M2MB_LWM2M_MON_RES:
{
printf( "Resource change monitor setting result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
case M2MB_LWM2M_MON_INFO_IND:
{
monitoring by the same handler of this LwM2M client instance
{
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.resource = 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 )
{
}
//...
// reading the full monitoring list
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 0; // Device object
uri.objInst = 0;
uri.resource = 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 )
{
}
}
◆ m2mb_lwm2m_newinst()
m2mb_lwm2m_newinst creates a specified instance for a specified object
m2mb_lwm2m_newinst allows the user to create an 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 cast 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a structure defining the URI specified by the user (only object ID and object instance ID are managed). |
| [in] | new_inst_params | a 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 );
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:
{
printf( "Creating object instance specified: result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
uri.uriLen = M2MB_LWM2M_URI_2_FIELDS;
uri.obj = 33205;
uri.objInst = 21;
uri.resource = 0;
uri.resourceInst = 0;
new_inst_params.agent = 0;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_newinst 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 cast 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 cast 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uriList | a pointer to the preallocated array of M2MB_LWM2M_OBJ_URI_T elements to be filled with the list elements. |
| [in] | listElementsNumber | the 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 );
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:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf(
"current status for Notify Ack reporting is %s", ( ( resp->
enabled == TRUE ) ? (
"ENABLED" ) : (
"DISABLED" ) ) );
}
break;
}
case M2MB_LWM2M_NFYACK_URI_RES:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "m2mb_lwm2m_nfy_ack_uri response OK" );
}
break;
}
case M2MB_LWM2M_NFYACK_LIST_RES:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "m2mb_lwm2m_nfy_ack_list read %hu elements", nfyAckListResponse->listElementsNumber );
}
break;
}
case M2MB_LWM2M_NFYACK_INFO_IND:
{
if( ( pInfo ) && ( pInfo->
uri.uriLen == 3 ) )
{
printf( "#LWM2MNFYACK: agentId %hu, SSID %hu, uri \"/%hu/%hu/%hu\", %s",
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
BOOLEAN set = TRUE;
BOOLEAN enable = TRUE;
BOOLEAN add = TRUE;
UINT8 listElements = 6;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_agent_config request succeeded" );
}
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 0;
uri.resourceInst = 0;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_uri request succeeded" );
}
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_list request succeeded" );
}
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 cast 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 cast 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | set | whether a set (if TRUE) or get (if FALSE) request has to be performed. |
| [in] | enable | BOOLEAN 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 );
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:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf(
"current status for Notify Ack reporting is %s", ( ( resp->
enabled == TRUE ) ? (
"ENABLED" ) : (
"DISABLED" ) ) );
}
break;
}
case M2MB_LWM2M_NFYACK_INFO_IND:
{
if( ( pInfo ) && ( pInfo->
uri.uriLen == 3 ) )
{
printf( "#LWM2MNFYACK: agentId %hu, SSID %hu, uri \"/%hu/%hu/%hu\", %s",
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
BOOLEAN set = TRUE;
BOOLEAN enable = TRUE;
BOOLEAN add = TRUE;
UINT8 listElements = 6;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_agent_config request succeeded" );
}
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 cast 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 cast 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | add | whether an add (if TRUE) or remove (if FALSE) request has to be performed. |
| [in] | uri | a 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 );
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:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf(
"current status for Notify Ack reporting is %s", ( ( resp->
enabled == TRUE ) ? (
"ENABLED" ) : (
"DISABLED" ) ) );
}
break;
}
case M2MB_LWM2M_NFYACK_URI_RES:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "m2mb_lwm2m_nfy_ack_uri response OK" );
}
break;
}
case M2MB_LWM2M_NFYACK_LIST_RES:
{
if( ( resp ) && ( resp->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "m2mb_lwm2m_nfy_ack_list read %hu elements", nfyAckListResponse->listElementsNumber );
}
break;
}
case M2MB_LWM2M_NFYACK_INFO_IND:
{
if( ( pInfo ) && ( pInfo->
uri.uriLen == 3 ) )
{
printf( "#LWM2MNFYACK: agentId %hu, SSID %hu, uri \"/%hu/%hu/%hu\", %s",
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
BOOLEAN set = TRUE;
BOOLEAN enable = TRUE;
BOOLEAN add = TRUE;
UINT8 listElements = 6;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_agent_config request succeeded" );
}
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 0;
uri.resourceInst = 0;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_uri request succeeded" );
}
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_list request succeeded" );
}
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_nfy_ack_status request succeeded" );
}
}
◆ m2mb_lwm2m_objget()
| M2MB_RESULT_E m2mb_lwm2m_objget |
( |
M2MB_LWM2M_HANDLE |
h, |
|
|
const M2MB_LWM2M_OBJGET_PARAM_T * |
objGetReq, |
|
|
CHAR * |
objGetRespString, |
|
|
UINT16 |
objGetRespSize |
|
) |
| |
m2mb_lwm2m_objget reads a Lwm2m object/object instance/resource.
m2mb_lwm2m_objset performs a read operation on a specified Lwm2m object, object instance or resource (as in CoAP GET method). The data is presented using a json string in accordance with the format defined in Lwm2m specification, see section 6.4.4 of OMA Lwm2m specification ver. 1.0.2 (Data Formats for Transferring Resource Information - JSON). The function is not blocking. In case of success, nothing is returned; instead, the callback defined in m2mb_lwm2m_init is configured to receive the required data through the M2MB_LWM2M_OBJGET_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_OBJGET_RES_T type. In case of errors (example: client not ready), the function returns with a failure code and no callback is issued. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_objget.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | objGetReq | the pointer to the data useful to manage the m2mb_lwm2m_objget. |
| [out] | objGetRespString | pointer to a preallocated buffer that will contain the operation response |
| [in] | objGetRespSize | size of the objGetRespString buffer |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
m2mb_lwm2m_objget( h, objSetReq );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
UINT16 objGetRespSize = 6144;
CHAR* objGetRespString = ( CHAR* )
m2mb_os_calloc( objGetRespSize *
sizeof( CHAR ) );
objGetReq.agentId = agentID;
if(
m2mb_lwm2m_objget( h, &objGetReq, objGetRespString, objGetRespSize ) == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_objget request succeeded" );
}
else
{
printf( "m2mb_lwm2m_objget request failed" );
}
}
◆ m2mb_lwm2m_objset()
m2mb_lwm2m_objset updates one or more resources of a Lwm2m object instance.
m2mb_lwm2m_objset performs a write operation on a specified Lwm2m object instance, updating the object instance as in the partial update or (CoAP POST method). The data is provided by the caller using a json string in accordance with the format defined in Lwm2m specification, see section 6.4.4 of OMA Lwm2m specification ver. 1.0.2 (Data Formats for Transferring Resource Information - JSON). The function is not blocking. In case of success, nothing is returned; instead, the callback defined in m2mb_lwm2m_init is configured to receive the required data through the M2MB_LWM2M_OBJSET_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_OBJSET_RES_T type. In case of errors (example: client not ready), the function returns with a failure code and no callback is issued. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_objset.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | objSetReq | the pointer to the data useful to manage the m2mb_lwm2m_objset. |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
m2mb_lwm2m_objset( h, objSetReq );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
{
printf( "m2mb_lwm2m_objset request succeeded" );
}
else
{
printf( "m2mb_lwm2m_objset request failed" );
}
}
◆ m2mb_lwm2m_odis()
| M2MB_RESULT_E m2mb_lwm2m_odis |
( |
M2MB_LWM2M_HANDLE |
h | ) |
|
m2mb_lwm2m_odis allows the user to store the odis data set into nv memory.
m2mb_lwm2m_odis allows the user to store the odis data set into nv memory by using the AT&T LwM2M client. The odis data managed by this function is written in the instance '0'.
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_ODIS_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_ODIS_RES_T type.
- Parameters
-
| [in] | h | the LwM2M service handler, previously initialized by the m2mb_lwm2m_init function. |
- Returns
- returns M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- before calling the m2mb_lwm2m_odis, the odis data should be stored on a temporary memory placement by calling the m2mb_lwm2m_odis_config for each parameter. It is recommended to clean the temporary memory area with the m2mb_lwm2m_odis_reset just after the m2mb_lwm2m_odis invokation, whether it succeeds or not.
m2mb_lwm2m_odis( h );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( ( odisResponse != NULL ) && ( odisResponse->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "#M2MB_ODIS succeeded" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
CHAR hostDeviceId[] = "host_device";
CHAR hostManufacturerId[] = "host_manufacturer";
CHAR hostModelId[] = "host_model";
CHAR hostSwVersion[] = "host_software_version";
hostDeviceId ) == M2MB_RESULT_SUCCESS )
{
hostManufacturerId ) == M2MB_RESULT_SUCCESS )
{
hostModelId ) == M2MB_RESULT_SUCCESS )
{
hostSwVersion ) == M2MB_RESULT_SUCCESS )
{
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_odis request succeeded" );
}
}
}
}
}
}
◆ m2mb_lwm2m_odis_config()
| M2MB_RESULT_E m2mb_lwm2m_odis_config |
( |
M2MB_LWM2M_HANDLE |
h, |
|
|
ODIS_PARAMETERS_E |
odis_item, |
|
|
CHAR * |
odis_data |
|
) |
| |
m2mb_lwm2m_odis_config is in charge of filling the selected otis item with the given data.
m2mb_lwm2m_odis_config should be called once for each odis parameter.
- Parameters
-
| [in] | h | the LwM2M service handler, previously initialized by the m2mb_lwm2m_init function. |
| [in] | odis_item | the item to be saved, expressed with the ODIS_PARAMETERS_E type. |
| [in] | odis_data | the data to be saved in the temporary odis_item memory buffer, expressed as a terminated string. |
- Returns
- returns M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- in order to have the m2mb_lwm2m_odis successful, the m2mb_lwm2m_odis_config should always be invoked once for each parameter for the odis parameter storing cycle. Since the m2mb_lwm2m_odis_config could only work on clean memory, it is recommended to clean the temporary memory area invoking the m2mb_lwm2m_odis_reset just after the m2mb_lwm2m_odis execution, whether it succeeds or not. Provided that the m2mb_lwm2m_odis_reset is non executed immediately after the m2mb_lwm2m_odis, in case of setting the odis parameters for a second or successive time, m2mb_lwm2m_odis_reset may also be invoked before the m2mb_lwm2m_odis_config invokations. For a code example, please see the code section below.
m2mb_lwm2m_odis_config( h, odis_item, odis_data );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( ( odisResponse != NULL ) && ( odisResponse->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "#M2MB_ODIS succeeded" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
CHAR hostDeviceId[] = "host_device";
CHAR hostManufacturerId[] = "host_manufacturer";
CHAR hostModelId[] = "host_model";
CHAR hostSwVersion[] = "host_software_version";
UINT8 odisInstance = 1;
hostDeviceId ) == M2MB_RESULT_SUCCESS )
{
hostManufacturerId ) == M2MB_RESULT_SUCCESS )
{
hostModelId ) == M2MB_RESULT_SUCCESS )
{
hostSwVersion ) == M2MB_RESULT_SUCCESS )
{
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_odis_set request succeeded" );
}
}
}
}
}
}
◆ m2mb_lwm2m_odis_reset()
| M2MB_RESULT_E m2mb_lwm2m_odis_reset |
( |
M2MB_LWM2M_HANDLE |
h | ) |
|
m2mb_lwm2m_odis_reset is in charge of resetting the handler data fields reserved for odis.
handler data fields reserved for odis should be reset after their use in odis storing or before any successive odis configuration. Resetting the handler data filled will result in freeing its dedicated amount of allocated memory.
- Parameters
-
| [in] | h | the LwM2M service handler, previously initialized by the m2mb_lwm2m_init function. |
- Returns
- returns M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- the temporary memory for odis is internally clean during the module initialization. In the sequence to configure the odis parameters before the odis storing, the m2mb_lwm2m_odis_reset should always be invoked after the first odis storing (m2mb_lwm2m_odis) or before the m2mb_lwm2m_odis_config calls in case of successive odis setting, since the m2mb_lwm2m_odis_config could succeed only working on a clean memory. Please notice that it is not mandatory to invoke the m2mb_lwm2m_odis_reset before the very first odis configuration. For a code example, please see the code section below.
m2mb_lwm2m_odis_reset( h );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( ( odisResponse != NULL ) && ( odisResponse->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "#M2MB_ODIS succeeded" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
CHAR hostDeviceId[] = "host_device";
CHAR hostManufacturerId[] = "host_manufacturer";
CHAR hostModelId[] = "host_model";
CHAR hostSwVersion[] = "host_software_version";
UINT8 odisInstance = 0;
hostDeviceId ) == M2MB_RESULT_SUCCESS )
{
hostManufacturerId ) == M2MB_RESULT_SUCCESS )
{
hostModelId ) == M2MB_RESULT_SUCCESS )
{
hostSwVersion ) == M2MB_RESULT_SUCCESS )
{
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_odis_set request succeeded" );
}
}
}
}
}
}
◆ m2mb_lwm2m_odis_set()
| M2MB_RESULT_E m2mb_lwm2m_odis_set |
( |
M2MB_LWM2M_HANDLE |
h, |
|
|
UINT8 |
odis_instance |
|
) |
| |
m2mb_lwm2m_odis_set allows the user to store the odis data set into the given instance in nv memory.
m2mb_lwm2m_odis_set allows the user to store the odis data set into nv memory by using the AT&T LwM2M client.
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_ODIS_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_ODIS_RES_T type.
- Parameters
-
| [in] | h | the LwM2M service handler, previously initialized by the m2mb_lwm2m_init function. |
| [in] | odis_instance | the given Odis instance. |
- Returns
- returns M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- before calling the m2mb_lwm2m_odis_set, the odis data should be stored on a temporary memory placement by calling the m2mb_lwm2m_odis_config for each parameter. It is recommended to clean the temporary memory area with the m2mb_lwm2m_odis_reset just after the m2mb_lwm2m_odis_set invokation, whether it succeeds or not.
m2mb_lwm2m_odis_set( h, odis_instance );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( ( odisResponse != NULL ) && ( odisResponse->
result == M2MB_LWM2M_RES_SUCCESS ) )
{
printf( "#M2MB_ODIS succeeded" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
CHAR hostDeviceId[] = "host_device";
CHAR hostManufacturerId[] = "host_manufacturer";
CHAR hostModelId[] = "host_model";
CHAR hostSwVersion[] = "host_software_version";
UINT8 odisInstance = 1;
hostDeviceId ) == M2MB_RESULT_SUCCESS )
{
hostManufacturerId ) == M2MB_RESULT_SUCCESS )
{
hostModelId ) == M2MB_RESULT_SUCCESS )
{
hostSwVersion ) == M2MB_RESULT_SUCCESS )
{
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_odis_set 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a structure defining the URI of the resource to be read. If the resource is not readable, an error is raised by the callback. |
| [in] | outbuf | an user defined buffer in which the response will be stored. |
| [in] | outbuflen | the 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 );
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:
{
printf( "Read result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 0;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_read request succeeded" );
}
}
◆ m2mb_lwm2m_reg()
m2mb_lwm2m_reg manages the user connection request for the specified server.
m2mb_lwm2m_reg manages the given action for the specified server; if the actionId is M2MB_LWM2M_REG_ACTION_GET_SRV_INFO and the serverId pointer is set to NULL, the function retrieves the info for all the servers associated to the queried agent. If the serverId is specified by the user, it retrieves only the info for that server. The result of the action M2MB_LWM2M_REG_ACTION_GET_SRV_INFO is expressed in an array of M2MB_LWM2M_REG_ELEMENT_RES_T items. All the other actions need the serverId to be specified. The function is not blocking. In case of success, nothing is returned; instead, the callback defined in m2mb_lwm2m_init is configured to receive the required data through the M2MB_LWM2M_REG_RES event. In this case the resp_struct must be cast to the M2MB_LWM2M_REG_RES_T type. In case of errors (example: client not ready), the function returns with a failure code and no callback is issued. In case of successful operation, if the specified the action is M2MB_LWM2M_REG_ACTION_GET_SRV_INFO, all the servers data is returned as consecutive elements of M2MB_LWM2M_REG_ELEMENT_RES_T type, and the written entries is also returned on the M2MB_LWM2M_REG_RES_T data structure. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_reg.
- Parameters
-
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | regReq | the pointer to the data useful to manage the m2mb_lwm2m_reg. |
| [out] | listPointer | in case the required action is M2MB_LWM2M_REG_ACTION_GET_SRV_INFO, it is the pointer to the memory region that will be filled with the M2MB_LWM2M_REG_ELEMENT_RES_T elements, expressed in elements of M2MB_LWM2M_REG_ELEMENT_RES_T type. In case of different actions, it can be set to NULL. |
| [in] | listSize | in case the required action is M2MB_LWM2M_REG_ACTION_GET_SRV_INFO, it is the size of the memory area pointed by |
| listPointer,expressed | in M2MB_LWM2M_REG_ELEMENT_RES_T elements. In case of different actions, it can be set to 0. |
- Returns
- M2MB_RESULT_SUCCESS on success, a different value on error.
- Note
- Although the m2mb_lwm2m_get_reg_entries is not strictly necessary, its use is strongly suggested in case the action required is M2MB_LWM2M_REG_ACTION_GET_SRV_INFO, in order to calculate the right array data dimension, otherwise a mismatch between expected servers and got server will cause an error.
m2mb_lwm2m_reg( h, regRequest, listPointer, listSize );
void myCallback( M2MB_LWM2M_HANDLE h,
M2MB_LWM2M_EVENT_E event, UINT16 resp_size,
void *resp_struct,
void *userdata )
{
switch( event )
{
{
if( resp != NULL )
{
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
}
else
{
printf( "invalid pointer received" );
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
UINT16 agentID = 0;
UINT16 listSize = 2;
regReq.agentId = agentID;
regReq.serverId = NULL;
if( pList != NULL )
{
if(
m2mb_lwm2m_reg( h, ®Req, pList, listSize ) == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_reg request succeeded" );
}
else
{
printf( "m2mb_lwm2m_reg request failed" );
}
}
}
◆ 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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a 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] | inbuf | an user defined buffer from which the data will be copied. |
| [in] | inbuflen | the 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 );
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:
{
printf( "Set result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 3;
uri.objInst = 0;
uri.resource = 17;
strcpy( buf, "CustomDeviceType" );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_set request succeeded" );
}
}
◆ m2mb_lwm2m_sts()
m2mb_lwm2m_sts sets the next server address
m2mb_lwm2m_sts allows either setting the next server address loaded by the LwM2M client or restoring a previously server chosen. The server address will be used at the next module reboot. This function should be used only for certification purposes, where the certification tests server differs from the ordinary one. m2mb_lwm2m_agent_config should always be called before the m2mb_lwm2m_sts.
- Parameters
-
| [in] | h | the 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] | reqStsStructure | pointer 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 );
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_RES:
{
printf( "Sts command result %d", resp->result );
if( resp->result == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
CHAR stringValue[ MY_MAX_STRING_LENGTH ];
UINT16 agentID = 0;
memset( stringValue, 0, sizeof( stringValue ) );
strcpy( stringValue, "coaps://myUrlToBePointed:5684" );
stsReq.data = stringValue;
stsReq.dataLen = strlen( stringValue );
stsReq.bootstrapRequest = 1;
stsReq.uriLen = M2MB_LWM2M_URI_2_FIELDS;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_sts request succeeded" );
}
stsReq.uriLen = M2MB_LWM2M_URI_MAX_NUM;
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_sts request succeeded" );
}
stsReq.serverTableId = 0;
stsReq.uriLen = M2MB_LWM2M_URI_0_FIELDS;
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] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
| [in] | uri | a structure defining the URI of the resource to be written. If the resource is not writable, an error is raised by the callback. |
| [in] | inbuf | an user defined buffer from which the data will be copied. |
| [in] | inbuflen | the 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 in case of string data type, the user should pass inbuflen parameter according to the size of the string passed through inbuf. 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 );
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 == M2MB_LWM2M_RES_SUCCESS )
{
}
break;
}
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_LWM2M_HANDLE h;
struct myStruct myUserdata;
uri.uriLen = M2MB_LWM2M_URI_3_FIELDS;
uri.obj = 10000;
uri.objInst = 1;
uri.resource = 7;
strcpy( buf, "stringValue" );
if ( retVal == M2MB_RESULT_SUCCESS )
{
printf( "m2mb_lwm2m_write request succeeded" );
}
}
SIZE_T dataSize
Definition: m2mb_lwm2m.h:1019
M2MB_RESULT_E m2mb_lwm2m_get_stat(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_get_stat reads the current status of the LwM2M client
the m2mb_lwm2m_fota_ack request data structure
Definition: m2mb_lwm2m.h:843
Definition: m2mb_lwm2m.h:251
Definition: m2mb_lwm2m.h:331
Definition: m2mb_lwm2m.h:447
the single entry involved in the m2mb_lwm2m_list operation
M2MB_OS_RESULT_E m2mb_os_free(void *pMem)
Free allocated memory.
M2MB_RESULT_E m2mb_lwm2m_odis_set(M2MB_LWM2M_HANDLE h, UINT8 odis_instance)
m2mb_lwm2m_odis_set allows the user to store the odis data set into the given instance in nv memory.
Definition: m2mb_lwm2m.h:666
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.
the m2mb_lwm2m_objget response data structure
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:816
Definition: m2mb_lwm2m.h:103
Definition: m2mb_lwm2m.h:423
the m2mb_lwm2m_fota_ack response data structure
Definition: m2mb_lwm2m.h:852
the m2mb_lwm2m_cfg response data structure
Definition: m2mb_lwm2m.h:94
M2MB_RESULT_E m2mb_lwm2m_exist(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri)
m2mb_lwm2m_exist returns the existence or not for a given uri/agent
Definition: m2mb_lwm2m.h:652
UINT16 agent
Definition: m2mb_lwm2m.h:732
Definition: m2mb_lwm2m.h:493
the m2mb_lwm2m_get_list_entries response data structure
the m2mb_lwm2m_reg response data structure
M2MB_LWM2M_CUST_DATA_T data
Definition: m2mb_lwm2m.h:1029
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
Definition: m2mb_lwm2m.h:98
M2MB_RESULT_E m2mb_lwm2m_enable(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ENABLE_REQ_T *en_params)
m2mb_lwm2m_enable starts LwM2M client registration
the m2mb_lwm2m_objset response data structure
M2MB_RESULT_E m2mb_lwm2m_cipher_cfg_read(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CIPHER_CFG_ITEM_T *cipherCfgData, UINT8 maxItemsNumber)
m2mb_lwm2m_cipher_cfg_read reads the cipher configuration for all the active clients.
M2MB_RESULT_E m2mb_lwm2m_objset(M2MB_LWM2M_HANDLE h, const M2MB_LWM2M_OBJSET_PARAM_T *objSetReq)
m2mb_lwm2m_objset updates one or more resources of a Lwm2m object instance.
M2MB_RESULT_E m2mb_lwm2m_get_reg_entries(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_get_reg_entries returns the overall number of elements, expressed in M2MB_LWM2M_REG_ELEMEN...
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:692
M2MB_RESULT_E m2mb_lwm2m_objget(M2MB_LWM2M_HANDLE h, const M2MB_LWM2M_OBJGET_PARAM_T *objGetReq, CHAR *objGetRespString, UINT16 objGetRespSize)
m2mb_lwm2m_objget reads a Lwm2m object/object instance/resource.
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
Definition: m2mb_lwm2m.h:925
Definition: m2mb_lwm2m.h:801
the m2mb_lwm2m_reg request data structure
the m2mb_lwm2m_exist request data structure
Definition: m2mb_lwm2m.h:998
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:1000
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_RESULT_E result
Definition: m2mb_lwm2m.h:854
Definition: m2mb_lwm2m.h:462
Definition: m2mb_lwm2m.h:100
Definition: m2mb_lwm2m.h:125
M2MB_RESULT_E m2mb_lwm2m_fota_cfg_read(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_CFG_ITEM_T *fotaCfgData, UINT8 maxItemsNumber)
m2mb_lwm2m_fota_cfg_read reads the fota mode for all the active clients.
Definition: m2mb_lwm2m.h:95
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_RESULT_E m2mb_lwm2m_deinit(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_deinit deinitializes LwM2M service for current client.
Definition: m2mb_lwm2m.h:104
M2MB_RESULT_E m2mb_lwm2m_disable(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_disable triggers LwM2M client deregistration.
Definition: m2mb_lwm2m.h:305
M2MB_RESULT_E m2mb_lwm2m_odis_config(M2MB_LWM2M_HANDLE h, ODIS_PARAMETERS_E odis_item, CHAR *odis_data)
m2mb_lwm2m_odis_config is in charge of filling the selected otis item with the given data.
Definition: m2mb_lwm2m.h:553
Definition: m2mb_lwm2m.h:534
the m2mb_lwm2m_cust request data structure
Definition: m2mb_lwm2m.h:1026
M2MB_LWM2M_OBJ_URI_T uri
Definition: m2mb_lwm2m.h:668
Definition: m2mb_lwm2m.h:673
Definition: m2mb_lwm2m.h:97
the single entry involved in the m2mb_lwm2m_reg operation
the m2mb_lwm2m_list response data structure
Definition: m2mb_lwm2m.h:602
CHAR identity[M2MB_LWM2M_DTLS_PSK_MAX_KEY_LEN+1]
Definition: m2mb_lwm2m.h:496
M2MB_RESULT_E m2mb_lwm2m_get_list_entries(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_get_list_entries returns the overall number of elements, expressed in M2MB_LWM2M_LIST_ELEM...
Definition: m2mb_lwm2m.h:102
Definition: m2mb_lwm2m.h:729
M2MB_LWM2M_NFY_STATE_E nfyState
Definition: m2mb_lwm2m.h:734
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_RESULT_E m2mb_lwm2m_cipher_cfg(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CIPHER_CFG_REQ_T *cfg_params)
m2mb_lwm2m_cipher_cfg sets and stores the cipher configuration.
the m2mb_lwm2m_cipher_cfg response data structure
Definition: m2mb_lwm2m.h:763
void * m2mb_os_malloc(UINT32 size)
Allocates bytes of memory.
M2MB_LWM2M_OBJ_URI_T uri
Definition: m2mb_lwm2m.h:731
UINT32 handler
Definition: m2mb_lwm2m.h:669
the m2mb_lwm2m_objset request data structure
the m2mb_lwm2m_odis response data structure
Definition: m2mb_lwm2m.h:986
Definition: m2mb_lwm2m.h:543
void * buffer
Definition: m2mb_lwm2m.h:1017
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:705
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:508
Definition: m2mb_lwm2m.h:595
Definition: m2mb_lwm2m.h:93
M2MB_RESULT_E m2mb_lwm2m_list(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_LIST_ELEMENT_RES_T *listPointer, UINT16 listSize)
m2mb_lwm2m_list returns all the objects/instances defined for a client
M2MB_RESULT_E m2mb_lwm2m_cust(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CUST_PARAM_T *custReq)
m2mb_lwm2m_cust stores the customization data.
Definition: m2mb_lwm2m.h:333
Definition: m2mb_lwm2m.h:678
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_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_RESULT_E m2mb_lwm2m_fota_status(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_STATE_T *fotaStateData)
m2mb_lwm2m_fota_status returns the fota data for the spcified LwM2M client.
the m2mb_lwm2m_objget request data structure
void * m2mb_os_calloc(UINT32 size)
Allocates bytes of memory and init space with 0.
Definition: m2mb_lwm2m.h:506
Definition: m2mb_lwm2m.h:456
Definition: m2mb_lwm2m.h:567
M2MB_LWM2M_CUST_PARAM_ID_E paramId
Definition: m2mb_lwm2m.h:1028
Definition: m2mb_lwm2m.h:101
M2MB_RESULT_E m2mb_lwm2m_reg(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_REG_PARAM_T *regReq, M2MB_LWM2M_REG_ELEMENT_RES_T *listPointer, UINT16 listSize)
m2mb_lwm2m_reg manages the user connection request for the specified server.
Definition: m2mb_lwm2m.h:106
Definition: m2mb_lwm2m.h:123
Definition: m2mb_lwm2m.h:581
Definition: m2mb_lwm2m.h:830
Definition: m2mb_lwm2m.h:345
M2MB_LWM2M_EVENT_E
Definition: m2mb_lwm2m.h:74
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_RESULT_E result
Definition: m2mb_lwm2m.h:832
Definition: m2mb_lwm2m.h:317
Definition: m2mb_lwm2m.h:559
Definition: m2mb_lwm2m.h:386
the m2mb_lwm2m_get_list_entries response data structure
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:927
Definition: m2mb_lwm2m.h:96
Definition: m2mb_lwm2m.h:590
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:717
M2MB_RESULT_E m2mb_lwm2m_odis_reset(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_odis_reset is in charge of resetting the handler data fields reserved for odis.
CHAR endpoint_name[M2MB_LWM2M_MAX_ENDPOINT_NAME_LEN+1]
Definition: m2mb_lwm2m.h:495
BOOLEAN enabled
Definition: m2mb_lwm2m.h:694
the m2mb_lwm2m_fota_cfg response data structure
Definition: m2mb_lwm2m.h:774
M2MB_RESULT_E m2mb_lwm2m_odis(M2MB_LWM2M_HANDLE h)
m2mb_lwm2m_odis allows the user to store the odis data set into nv memory.
CHAR secret_key[M2MB_LWM2M_DTLS_PSK_MAX_KEY_LEN+1]
Definition: m2mb_lwm2m.h:497
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
the m2mb_lwm2m_fota_state data structure
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,...
Definition: m2mb_lwm2m.h:703
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:988
Definition: m2mb_lwm2m.h:330
Definition: m2mb_lwm2m.h:690
M2MB_RESULT_E m2mb_lwm2m_cfg(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_CFG_PARAM_T *cfgReq)
m2mb_lwm2m_cfg sets or retrieves the lwm2m configuration value related to a given parameter
Definition: m2mb_lwm2m.h:332
M2MB_RESULT_E m2mb_lwm2m_sts(M2MB_LWM2M_HANDLE h, M2MB_LWM2M_STS_URI_T *reqStsStructure)
m2mb_lwm2m_sts sets the next server address
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
Definition: m2mb_lwm2m.h:787
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:776
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
Definition: m2mb_lwm2m.h:105
M2MB_LWM2M_RESULT_E result
Definition: m2mb_lwm2m.h:583
the m2mb_lwm2m_cust response data structure
Definition: m2mb_lwm2m.h:1036
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_DATA_TYPE_E dataType
Definition: m2mb_lwm2m.h:1018
Definition: m2mb_lwm2m.h:124
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_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.
Definition: m2mb_lwm2m.h:1096
Definition: m2mb_lwm2m.h:814
UINT16 shServerId
Definition: m2mb_lwm2m.h:733
Definition: m2mb_lwm2m.h:477
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_RESULT_E result
Definition: m2mb_lwm2m.h:1038
Definition: m2mb_lwm2m.h:715