![]() |
m2mb API docs
30.00.007
m2mb API sets documentation
|
Header file for m2mb_lwm2m APIs. More...
Go to the source code of this file.
Typedefs | |
| typedef HANDLE | M2MB_LWM2M_HANDLE |
| typedef void(* | m2mb_lwm2m_ind_callback) (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size, void *resp_struct, void *userdata) |
Enumerations | |
| enum | M2MB_LWM2M_URI_LENGTH_E { M2MB_LWM2M_URI_0_FIELDS = 0, M2MB_LWM2M_URI_1_FIELDS, M2MB_LWM2M_URI_2_FIELDS, M2MB_LWM2M_URI_3_FIELDS, M2MB_LWM2M_URI_4_FIELDS, M2MB_LWM2M_URI_MAX_NUM } |
| enum | M2MB_LWM2M_EN_MODE_E { M2MB_LWM2M_MODE_NO_ACK, M2MB_LWM2M_MODE_ACK, M2MB_LWM2M_MODE_MAX_NUM } |
| enum | M2MB_LWM2M_ACK_ACTION_E { M2MB_LWM2M_ACTION_ACK = 1, M2MB_LWM2M_ACTION_DEFER, M2MB_LWM2M_ACTION_MAX_NUM } |
| enum | M2MB_LWM2MENA_CMD_TYPE_E { M2MB_LWM2MENA_CMD_TYPE_SET = 0, M2MB_LWM2MENA_CMD_TYPE_READ, M2MB_LWM2MENA_CMD_TYPE_MAX_NUM } |
| enum | M2MB_LWM2M_EVENT_E { M2MB_LWM2M_ENABLE_RES = 0, M2MB_LWM2M_DISABLE_RES, M2MB_LWM2M_ACK_RES, M2MB_LWM2M_READ_RES, M2MB_LWM2M_WRITE_RES, M2MB_LWM2M_EXEC_RES, M2MB_LWM2M_SET_RES, M2MB_LWM2M_GET_RES, M2MB_LWM2M_GET_STAT_RES, M2MB_LWM2M_STS_RES, M2MB_LWM2M_MON_RES, M2MB_LWM2M_NEW_INST_RES, M2MB_LWM2M_NFYACK_STATUS_RES, M2MB_LWM2M_NFYACK_URI_RES, M2MB_LWM2M_NFYACK_LIST_RES, M2MB_LWM2M_GET_TYPE_RES, M2MB_LWM2M_FOTA_CFG_RES, M2MB_LWM2M_FOTA_ACK_RES, M2MB_LWM2M_INJKEYS_RES, M2MB_LWM2M_UPD_REG_IND = 30, M2MB_LWM2M_SMS_PUSH_IND, M2MB_LWM2M_NOTIFY_IND, M2MB_LWM2M_NOTIFY_MON_IND, M2MB_LWM2M_CONN_REQ_IND = 60, M2MB_LWM2M_SESSION_END_IND, M2MB_LWM2M_SESSION_INFO_IND, M2MB_LWM2M_SRV_INFO_IND, M2MB_LWM2M_MON_INFO_IND, M2MB_LWM2M_NFYACK_INFO_IND, M2MB_LWM2M_EVENT_MAX_NUM } |
| enum | M2MB_LWM2M_CONNREQ_CAUSE_E { M2MB_LWM2M_CONNREQ_CAUSE_BOOTSTRAP, M2MB_LWM2M_CONNREQ_CAUSE_REGISTRATION, M2MB_LWM2M_CONNREQ_CAUSE_REREG, M2MB_LWM2M_CONNREQ_CAUSE_UPDATE, M2MB_LWM2M_CONNREQ_CAUSE_SMS, M2MB_LWM2M_CONNREQ_CAUSE_NOTIFY, M2MB_LWM2M_CONNREQ_CAUSE_DEREGISTRATION, M2MB_LWM2M_CONNREQ_CAUSE_MAX_NUM } |
| enum | M2MB_LWM2M_RESULT_E { M2MB_LWM2M_RES_SUCCESS = 0, M2MB_LWM2M_RES_FAIL, M2MB_LWM2M_RES_FAIL_NO_ACTION, M2MB_LWM2M_RES_FAIL_UNSUPPORTED, M2MB_LWM2M_RES_FAIL_NOT_ALLOWED, M2MB_LWM2M_RES_FAIL_BAD_ARGS, M2MB_LWM2M_RES_FAIL_BAD_URI, M2MB_LWM2M_RES_NETWORK_ERROR = 50, M2MB_LWM2M_RES_HOST_UNREACH, M2MB_LWM2M_RES_SOCKET_ERROR, M2MB_LWM2M_RES_DTLS_ERROR, M2MB_LWM2M_RES_PROT_SUCCESS = 200, M2MB_LWM2M_RES_PROT_NOT_FOUND, M2MB_LWM2M_RES_PROT_NOT_ALLOWED, M2MB_LWM2M_RES_PROT_UNSUPPORTED, M2MB_LWM2M_RES_PROT_INTERNAL, M2MB_LWM2M_RES_PROT_UNKNOWN } |
| enum | M2MB_LWM2M_IF_STATE_E { M2MB_LWM2M_IF_STATE_NONE, M2MB_LWM2M_IF_STATE_DISABLED, M2MB_LWM2M_IF_STATE_ACK_WAIT, M2MB_LWM2M_IF_STATE_ACTIVE, M2MB_LWM2M_IF_STATE_IDLE, M2MB_LWM2M_IF_STATE_DEREG_WAIT, M2MB_LWM2M_IF_STATE_DEREGISTERING, M2MB_LWM2M_IF_STATE_MAX } |
| enum | M2MB_LWM2M_CL_STATE_E { M2MB_LWM2M_CL_STATE_DISABLED, M2MB_LWM2M_CL_STATE_BOOTSTRAPPING, M2MB_LWM2M_CL_STATE_BOOTSTRAPPED, M2MB_LWM2M_CL_STATE_REGISTERING, M2MB_LWM2M_CL_STATE_REGISTERED, M2MB_LWM2M_CL_STATE_DEREGISTERING, M2MB_LWM2M_CL_STATE_SUSPENDED, M2MB_LWM2M_CL_STATE_MAX } |
| enum | M2MB_LWM2M_SET_DATA_TYPE_E { M2MB_LWM2M_SET_DATA_TYPE_INTEGER, M2MB_LWM2M_SET_DATA_TYPE_FLOAT, M2MB_LWM2M_SET_DATA_TYPE_STRING, M2MB_LWM2M_SET_DATA_TYPE_HEX_BINARY, M2MB_LWM2M_SET_DATA_TYPE_MAX } |
| enum | M2MB_LWM2M_INFO_ID_E { M2MB_LWM2M_INFO_FOTA_REBOOT, M2MB_LWM2M_INFO_DEVICE_REBOOT, M2MB_LWM2M_INFO_RESOURCE_EXECUTE, M2MB_LWM2M_INFO_ID_MAX } |
| enum | M2MB_LWM2M_MON_ACTION_E { M2MB_LWM2M_MON_DISABLE = 0, M2MB_LWM2M_MON_ENABLE, M2MB_LWM2M_MON_MAX_NUM } |
| enum | M2MB_LWM2M_MON_MODE_E { M2MB_LWM2M_MON_MODE_SET_CMD = 0, M2MB_LWM2M_MON_MODE_READ_CMD, M2MB_LWM2M_MON_MODE_MAX_NUM } |
| enum | M2MB_LWM2M_FOTA_MODE_E { M2MB_LWM2M_FOTA_MODE_DEFAULT = 0, M2MB_LWM2M_FOTA_MODE_ACK_DWL = 1, M2MB_LWM2M_FOTA_MODE_ACK_UPD = 2, M2MB_LWM2M_FOTA_MODE_ACK_ALL = 3, M2MB_LWM2M_FOTA_MODE_MAX_NUM } |
| the fota modes supported by the m2mb lwm2m More... | |
| enum | M2MB_LWM2M_FOTA_ACK_E { M2MB_LWM2M_FOTA_ACK_ALL = 1, M2MB_LWM2M_FOTA_ACK_MAX_NUM } |
| enum | M2MB_LWM2M_NFY_STATE_E { M2MB_LWM2M_NFY_STATE_MISSING = 0, M2MB_LWM2M_NFY_STATE_ACK_RECEIVED, M2MB_LWM2M_NFY_STATE_MAX_NUM } |
| enum | M2MB_LWM2M_KEY_ACTION_E { M2MB_LWM2M_KEY_CREATE, M2MB_LWM2M_KEY_DELETE_EP_NAME, M2MB_LWM2M_KEY_DELETE_ID_AND_SECRET, M2MB_LWM2M_KEY_DELETE_ALL, M2MB_LWM2M_KEY_MAX_ACTION } |
| enum | M2MB_LWM2M_DATA_TYPE_E { M2MB_LWM2M_DATA_TYPE_INVALID = 0, M2MB_LWM2M_DATA_TYPE_NONE, M2MB_LWM2M_DATA_TYPE_STRING, M2MB_LWM2M_DATA_TYPE_INTEGER, M2MB_LWM2M_DATA_TYPE_FLOAT, M2MB_LWM2M_DATA_TYPE_BOOLEAN, M2MB_LWM2M_DATA_TYPE_OPAQUE, M2MB_LWM2M_DATA_TYPE_TIME, M2MB_LWM2M_DATA_TYPE_OBJECTLINK, M2MB_LWM2M_DATA_TYPE_STRINGARRAY, M2MB_LWM2M_DATA_TYPE_INTEGERARRAY, M2MB_LWM2M_DATA_TYPE_FLOATARRAY, M2MB_LWM2M_DATA_TYPE_BOOLEANARRAY, M2MB_LWM2M_DATA_TYPE_OPAQUEARRAY, M2MB_LWM2M_DATA_TYPE_TIMEARRAY, M2MB_LWM2M_DATA_TYPE_OBJECTLINKARRAY, M2MB_LWM2M_DATA_TYPE_LAST, M2MB_LWM2M_DATA_TYPE_FIRSTARRAYTYPE = M2MB_LWM2M_DATA_TYPE_STRINGARRAY, M2MB_LWM2M_DATA_TYPE_LASTARRAYTYPE = M2MB_LWM2M_DATA_TYPE_OBJECTLINKARRAY } |
Functions | |
| M2MB_RESULT_E | m2mb_lwm2m_init (M2MB_LWM2M_HANDLE *h, m2mb_lwm2m_ind_callback cb, void *cb_user_param) |
| m2mb_lwm2m_init initializes, for current client, the capability to interact with LwM2M agent. More... | |
| M2MB_RESULT_E | m2mb_lwm2m_deinit (M2MB_LWM2M_HANDLE h) |
| m2mb_lwm2m_deinit deinitializes LwM2M service for current client. More... | |
| M2MB_RESULT_E | m2mb_lwm2m_enable (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ENABLE_REQ_T *en_params) |
| m2mb_lwm2m_enable starts LwM2M client registration More... | |
| M2MB_RESULT_E | m2mb_lwm2m_disable (M2MB_LWM2M_HANDLE h) |
| m2mb_lwm2m_disable triggers LwM2M client deregistration. More... | |
| M2MB_RESULT_E | m2mb_lwm2m_ack (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_ACK_REQ_T *ack) |
| m2mb_lwm2m_ack informs LwM2M client about network availability More... | |
| M2MB_RESULT_E | m2mb_lwm2m_read (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *outbuf, UINT16 outbuflen) |
| m2mb_lwm2m_read reads the LwM2M resource at the given URI More... | |
| M2MB_RESULT_E | m2mb_lwm2m_write (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *inbuf, UINT16 inbuflen) |
| m2mb_lwm2m_write writes the LwM2M resource at the given URI More... | |
| M2MB_RESULT_E | m2mb_lwm2m_exec (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri) |
| m2mb_lwm2m_exec executes the LwM2M resource at the given URI More... | |
| M2MB_RESULT_E | m2mb_lwm2m_set (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *inbuf, UINT16 inbuflen) |
| m2mb_lwm2m_set sets the value of a LwM2M resource at module side More... | |
| M2MB_RESULT_E | m2mb_lwm2m_get (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, void *outbuf, UINT16 outbuflen) |
| m2mb_lwm2m_get reads the value of a LwM2M resource at module side More... | |
| M2MB_RESULT_E | m2mb_lwm2m_get_stat (M2MB_LWM2M_HANDLE h) |
| m2mb_lwm2m_get_stat reads the current status of the LwM2M client More... | |
| M2MB_RESULT_E | m2mb_lwm2m_sts (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_STS_URI_T *reqStsStructure) |
| m2mb_lwm2m_sts sets the next server's address More... | |
| M2MB_RESULT_E | m2mb_lwm2m_mon (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, M2MB_LWM2M_MON_REQ_T *mon_params) |
| m2mb_lwm2m_mon sets the monitoring status an LwM2M resource at module side More... | |
| M2MB_RESULT_E | m2mb_lwm2m_newinst (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, M2MB_LWM2M_NEW_INST_REQ_T *new_inst_params) |
| m2mb_lwm2m_newinst creates a specified instance for a specified object More... | |
| M2MB_RESULT_E | m2mb_lwm2m_nfy_ack_status (M2MB_LWM2M_HANDLE h, BOOLEAN set, BOOLEAN enable) |
| m2mb_lwm2m_nfy_ack_status sets or gets the flag to enable or disable Notify Ack reporting More... | |
| M2MB_RESULT_E | m2mb_lwm2m_nfy_ack_uri (M2MB_LWM2M_HANDLE h, BOOLEAN add, M2MB_LWM2M_OBJ_URI_T *uri) |
| m2mb_lwm2m_nfy_ack_uri adds or removes a resource URI to the list for Notify Ack reporting More... | |
| M2MB_RESULT_E | m2mb_lwm2m_nfy_ack_list (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uriList, UINT8 listElementsNumber) |
| m2mb_lwm2m_nfy_ack_list retrieves the list for Notify Ack reporting More... | |
| M2MB_RESULT_E | m2mb_lwm2m_agent_config (M2MB_LWM2M_HANDLE h, UINT16 agentID) |
| m2mb_lwm2m_agent_config propagates the specified client for a specific operation (such as read, write or execute resource) More... | |
| M2MB_RESULT_E | m2mb_lwm2m_get_resource_type (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_OBJ_URI_T *uri, UINT16 *resType) |
| m2mb_lwm2m_get_resource_type propagates the resource type for a required resource. More... | |
| M2MB_RESULT_E | m2mb_lwm2m_fota_cfg (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_CFG_REQ_T *cfg_params) |
| m2mb_lwm2m_fota_cfg sets and stores the fota mode. More... | |
| M2MB_RESULT_E | m2mb_lwm2m_fota_ack (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_FOTA_ACK_REQ_T *ack_params) |
| m2mb_lwm2m_fota_ack sends the ack for the required operation. More... | |
| M2MB_RESULT_E | m2mb_lwm2m_injkeys (M2MB_LWM2M_HANDLE h, M2MB_LWM2M_KEY_ACTION_E action, M2MB_LWM2M_KEYS_T *keys) |
| m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent. More... | |
Header file for m2mb_lwm2m APIs.
m2m/m2m_common/m2mb_inc/m2mb_lwm2m.h
m2mb_lwm2m APIs provide actions and events for LWM2M management.
@notes
| enum M2MB_LWM2M_EVENT_E |
the fota modes supported by the m2mb lwm2m
| M2MB_RESULT_E m2mb_lwm2m_ack | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_ACK_REQ_T * | ack | ||
| ) |
m2mb_lwm2m_ack informs LwM2M client about network availability
m2mb_lwm2m_ack allows the user to acknowledge client's request for network availability. It has to be issued in case of client enabled in "M2MB_LWM2M_MODE_ACK" mode. An ACK will be required after enable, disable, sms_push, notify and upd_reg events.
| [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. |
m2mb_lwm2m_ack( h, ack_params );
| 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.
| [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). |
m2mb_lwm2m_agent_config( h, agentID );
| 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.
| [in] | h | the handle to the LwM2M service, that will be deinitialized by the function. |
m2mb_lwm2m_deinit( &h );
| 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.
| [in] | h | the handle to the LwM2M service, previously initialized by the m2mb_lwm2m_init function. |
m2mb_lwm2m_disable( h );
| M2MB_RESULT_E m2mb_lwm2m_enable | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_ENABLE_REQ_T * | en_params | ||
| ) |
m2mb_lwm2m_enable starts LwM2M client registration
m2mb_lwm2m_enable starts the procedure for LwM2M client registration. It is non-blocking, so it returns immediately with an error code. It may fail if some basic conditions are not satisfied (PDP context not activated). If it returns successfully the registration result is provided through the callback defined by the user. If called in M2MB_LWM2M_MODE_ACK mode, a call to m2mb_lwm2m_ack() is be required in order to assure network availability. The actual result of the API is returned through the callback with M2MB_LWM2M_ENABLE_RES event.
| [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. |
m2mb_lwm2m_enable( h, params );
| M2MB_RESULT_E m2mb_lwm2m_exec | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_OBJ_URI_T * | uri | ||
| ) |
m2mb_lwm2m_exec executes the LwM2M resource at the given URI
m2mb_lwm2m_exec executes the LwM2M resource at the URI specified by parameter 'uri', performing an operation equivalent to an execution from server side. The function returns immediately, and the result of the required operation is sent along with the callback defined in m2mb_lwm2m_init. In case of fatal error (example: client not ready), the function fails immediately and no callback is issued.
| [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. |
m2mb_lwm2m_execute( h, uri, );
| M2MB_RESULT_E m2mb_lwm2m_fota_ack | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_FOTA_ACK_REQ_T * | ack_params | ||
| ) |
m2mb_lwm2m_fota_ack sends the ack for the required operation.
m2mb_lwm2m_fota_ack allows the user to acknoledge (and authorize) the current fota operation (i.e.: download or delta application). The function is non-blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_FOTA_ACK_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_FOTA_ACK_RES_T type.
| [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. |
m2mb_lwm2m_fota_ack( h, ack_params );
| M2MB_RESULT_E m2mb_lwm2m_fota_cfg | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_FOTA_CFG_REQ_T * | cfg_params | ||
| ) |
m2mb_lwm2m_fota_cfg sets and stores the fota mode.
m2mb_lwm2m_fota_cfg allows the user to set the proper fota modality by requiring an 'ack' to proceed with the delta download or to proceed with the delta application, or to confirm both download and update. The function is non-blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_FOTA_CFG_RES. In this case the resp_struct must be cast to the M2MB_LWM2M_FOTA_CFG_RES_T type.
| [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. |
m2mb_lwm2m_fota_cfg( h, cfg_params );
| 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.
| [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. |
m2mb_lwm2m_get( h, uri, buf, len );
| 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.
| [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. |
m2mb_lwm2m_get_resource_type( h, uri, resType );
| M2MB_RESULT_E m2mb_lwm2m_get_stat | ( | M2MB_LWM2M_HANDLE | h | ) |
m2mb_lwm2m_get_stat reads the current status of the LwM2M client
m2mb_lwm2m_get_stat reads the current status of the LwM2M client, allowing the user to know what action is currently performed and to retrieve piece of informations such as the remaining time before the following registration update.
| [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. |
m2mb_lwm2m_get_stat( h );
| 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!!!
| [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. |
m2mb_lwm2m_init( &h, myCallback, myUserdata );
| M2MB_RESULT_E m2mb_lwm2m_injkeys | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_KEY_ACTION_E | action, | ||
| M2MB_LWM2M_KEYS_T * | keys | ||
| ) |
m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent.
m2mb_lwm2m_injkeys allows to inject or delete Endpoint Name and Keys for a given agent. The function is asynchronous. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_INJKEYS_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_RES_T type.
| [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). |
m2mb_lwm2m_injkeys( h, action, keys );
| M2MB_RESULT_E m2mb_lwm2m_mon | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_OBJ_URI_T * | uri, | ||
| M2MB_LWM2M_MON_REQ_T * | mon_params | ||
| ) |
m2mb_lwm2m_mon sets the monitoring status an LwM2M resource at module side
m2mb_lwm2m_mon allows the user to enable or disable the monitoring of resource changes. The changes can occur both from AT command side (#LWM2MW or #LWM2MSET) or from a server request. The function is asynchronous. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_MON_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_MON_RES_T type. The user is allowed to enable the object monitoring and it will be advised of each resource change in this object with an URC. The object to be monitored should be specified by parameter inserting it in the parameter 'uri', although only the object identifier field in 'uri' is currently taken into account.
Once the monitoring is activated, each resource change will generate an event that should be managed in the same callback. This event is the M2MB_LWM2M_MON_INFO_IND; in this case, it is reported the uri of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_MON_INFO_IND_T type.
Please notice that, in case of full monitoring list retrieve, the list is returned as a M2MB_LWM2M_OBJ_URI_T array of MAX_MONITOR_LIST_COUNT elements; only the ObjectID field will contain data; please notice that object '0' (Security) is not monitorable, so its value in this list indicates an empty item.
In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.
| [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. |
m2mb_lwm2m_mon( h, uri, mon );
| M2MB_RESULT_E m2mb_lwm2m_newinst | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_OBJ_URI_T * | uri, | ||
| M2MB_LWM2M_NEW_INST_REQ_T * | new_inst_params | ||
| ) |
m2mb_lwm2m_newinst creates a specified instance for a specified object
m2mb_lwm2m_newinst allows the user to create am instance for a specified object, filling all its resources with their proper default values (0 for numeric types, "" for strings) according to the resource types. The function is asynchronous. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NEW_INST_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NEW_INST_RES_T type. The user can create a new object instance only when the LwM2M client is up and running.
In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.
| [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. |
m2mb_lwm2m_newinst( h, uri, new_inst_params );
| M2MB_RESULT_E m2mb_lwm2m_nfy_ack_list | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_OBJ_URI_T * | uriList, | ||
| UINT8 | listElementsNumber | ||
| ) |
m2mb_lwm2m_nfy_ack_list retrieves the list for Notify Ack reporting
m2mb_lwm2m_nfy_ack_list allows the user to retrieve the list for Notify Ack reporting.
The function is not blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NFYACK_LIST_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NFYACK_LIST_RES_T type.
Once the Notify Ack reporting is enabled, each change of a resource (whose URI has been previously added in the list by using the m2mb_lwm2m_nfy_ack_uri) will generate an event (M2MB_LWM2M_NFYACK_INFO_IND) that should be managed in the same callback. The M2MB_LWM2M_NFYACK_INFO_IND event reports the URI of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_NFYACK_INFO_IND_T type.
In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.
| [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. |
m2mb_lwm2m_nfy_ack_list( h, uriList, listElementsNumber );
| M2MB_RESULT_E m2mb_lwm2m_nfy_ack_status | ( | M2MB_LWM2M_HANDLE | h, |
| BOOLEAN | set, | ||
| BOOLEAN | enable | ||
| ) |
m2mb_lwm2m_nfy_ack_status sets or gets the flag to enable or disable Notify Ack reporting
m2mb_lwm2m_nfy_ack_status allows the user to enable or disable the reporting of Acknowledgments sent by a server that receives a Notify message for a resource under observation. The function is not blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NFYACK_STATUS_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NFYACK_STATUS_RES_T type.
Once the Notify Ack reporting is enabled, each change of a resource (whose URI has been previously added in the list by using the m2mb_lwm2m_nfy_ack_uri) will generate an event (M2MB_LWM2M_NFYACK_INFO_IND) that should be managed in the same callback. The M2MB_LWM2M_NFYACK_INFO_IND event reports the URI of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_NFYACK_INFO_IND_T type.
In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.
| [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. |
m2mb_lwm2m_nfy_ack_status( h, set, enable );
| M2MB_RESULT_E m2mb_lwm2m_nfy_ack_uri | ( | M2MB_LWM2M_HANDLE | h, |
| BOOLEAN | add, | ||
| M2MB_LWM2M_OBJ_URI_T * | uri | ||
| ) |
m2mb_lwm2m_nfy_ack_uri adds or removes a resource URI to the list for Notify Ack reporting
m2mb_lwm2m_nfy_ack_uri allows the user to add or remove a resource URI to the list for Notify Ack reporting; if that resource is under observation and its URI is in this list, the Notify Ack will be reported. The function is not blocking. This means that the function returns immediately, but the response information is received in the callback previously set by the m2mb_lwm2m_init function. The event received in the callback is M2MB_LWM2M_NFYACK_URI_RES. In this case the resp_struct must be casted to the M2MB_LWM2M_NFYACK_URI_RES_T type.
Once the Notify Ack reporting is enabled, each change of a resource (whose URI has been previously added in the list by using the m2mb_lwm2m_nfy_ack_uri) will generate an event (M2MB_LWM2M_NFYACK_INFO_IND) that should be managed in the same callback. The M2MB_LWM2M_NFYACK_INFO_IND event reports the URI of the resource that has changed; resp_struct must be casted to the M2MB_LWM2M_NFYACK_INFO_IND_T type.
In case of fatal error (example: not enough heap memory for internal use), the function fails immediately and no callback is issued.
| [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). |
m2mb_lwm2m_nfy_ack_uri( h, add, uri );
| 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.
| [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. |
m2mb_lwm2m_read( h, uri, buf, len );
| 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.
| [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. |
m2mb_lwm2m_set( h, uri, buf, len );
| M2MB_RESULT_E m2mb_lwm2m_sts | ( | M2MB_LWM2M_HANDLE | h, |
| M2MB_LWM2M_STS_URI_T * | reqStsStructure | ||
| ) |
m2mb_lwm2m_sts sets the next server's address
m2mb_lwm2m_sts allows either setting the next server's address loaded by the LwM2M client at the next startup or restoring a previously server chosen. This function should be used only for certification purposes, where the certification tests server differs from the ordinary one.
| [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 |
| 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.
| [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. |
m2mb_lwm2m_write( h, uri, buf, len );