![]() |
m2mb API docs
25.30.003
m2mb API sets documentation
|
Base system functions for m2m application, following operations can be performed: -get/set operating modes: -Online Indicates that the device can make data traffic and make calls. More...
Go to the source code of this file.
Data Structures | |
| struct | M2MB_SYS_OPERATING_MODE_T |
| struct | M2MB_SYS_GET_OPERATING_MODE_RESP_T |
| struct | M2MB_SYS_GENERIC_RESP_T |
Typedefs | |
| typedef HANDLE | M2MB_SYS_HANDLE |
| typedef void(* | m2mb_sys_ind_callback) (M2MB_SYS_HANDLE h, M2MB_SYS_IND_E sys_event, UINT16 resp_size, void *resp_struct, void *userdata) |
Enumerations | |
| enum | M2MB_SYS_OP_MODE_E { M2MB_SYS_OP_MODE_ONLINE, M2MB_SYS_OP_MODE_LOW_POWER, M2MB_SYS_OP_MODE_FACTORY_TEST_MODE, M2MB_SYS_OP_MODE_OFFLINE, M2MB_SYS_OP_MODE_UNKNOWN, M2MB_SYS_OP_MODE_MAX_VAL } |
| enum | M2MB_SYS_IND_E { M2MB_SYS_NULL_RESP, M2MB_SYS_GET_OPERATING_MODE_RESP, M2MB_SYS_SET_OPERATING_MODE_RESP, M2MB_SYS_OPERATING_MODE_CHANGED_IND } |
| enum | M2MB_SYS_ERR_CAUSE_E { M2MB_SYS_ERR_OK, M2MB_SYS_ERR_UNKNOWN } |
Functions | |
| M2MB_RESULT_E | m2mb_sys_init (M2MB_SYS_HANDLE *h, m2mb_sys_ind_callback callback, void *userdata) |
| m2mb_sys_init initializes SYS service for current client. More... | |
| M2MB_RESULT_E | m2mb_sys_deinit (M2MB_SYS_HANDLE h) |
| m2mb_sys_deinit deinitializes SYS service for current client. More... | |
| M2MB_RESULT_E | m2mb_sys_get_operating_mode (M2MB_SYS_HANDLE h) |
| m2mb_sys_get_operating_mode gets information about the current operating mode. More... | |
| M2MB_RESULT_E | m2mb_sys_set_operating_mode (M2MB_SYS_HANDLE h, M2MB_SYS_OP_MODE_E operatingMode, BOOLEAN persistent) |
| m2mb_sys_set_operating_mode sets the operating mode. More... | |
Base system functions for m2m application, following operations can be performed: -get/set operating modes: -Online Indicates that the device can make data traffic and make calls.
m2m/m2m_generic/common/m2mb_inc/m2mb_sys.h
-Low Power Lowest power consumption state from which the device can return to Online mode; indicates that the device has temporarily disabled RF. If persistent flag is set, this mode persists even if the device is reset. Currently, persistent flag applies only to Low Power mode.
-Factory Test Mode Special mode for manufacturer use.
-Offline Phone has deactivated RF and partially shutdown; the device must be power cycled before it can reacquire service from this mode.
@notes Dependencies: m2m/m2m_generic/common/m2mb_inc/m2mb_types.h
| enum M2MB_SYS_OP_MODE_E |
| M2MB_RESULT_E m2mb_sys_deinit | ( | M2MB_SYS_HANDLE | h | ) |
m2mb_sys_deinit deinitializes SYS service for current client.
m2mb_sys_deinit deinitialize SYS service for current client freeing the handle passed as first parameter. Call to m2mb_sys_deinit should be performed in order to release memory resources when handle is no more used.
| [in] | h | first parameter is the handle to the SYS service, that will be deinitialized by the function. |
m2mb_sys_deinit(&h);
| M2MB_RESULT_E m2mb_sys_get_operating_mode | ( | M2MB_SYS_HANDLE | h | ) |
m2mb_sys_get_operating_mode gets information about the current operating mode.
The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_sys_init function.
The response event received in the callback will be the M2MB_SYS_GET_OPERATING_MODE_RESP. The resp_struct must be casted to the M2MB_SYS_GET_OPERATING_MODE_RESP_T type.
| [in] | h | the handle to the SYS service, previously initialized by the m2mb_sys_init function. |
m2mb_sys_get_operating_mode(h);
| M2MB_RESULT_E m2mb_sys_init | ( | M2MB_SYS_HANDLE * | h, |
| m2mb_sys_ind_callback | callback, | ||
| void * | userdata | ||
| ) |
m2mb_sys_init initializes SYS service for current client.
m2mb_sys_init initialize SYS service for current client returning the handle that must be passed as first parameter for all SYS actions. Calling the m2mb_sys_init is mandatory before using the SYS service.
| [in] | *h | first parameter is the handle to the SYS service, that will be initialized by the function. It has to be preallocated and initialized to NULL value. |
| [in] | callback | second parameter is the callback that will be called if an event or a response happens. |
| [in] | userdata | third parameter is a pointer to generic user data that will be returned as it is in the callback. |
m2mb_sys_init(&h, myCallback, myUserdata);
| M2MB_RESULT_E m2mb_sys_set_operating_mode | ( | M2MB_SYS_HANDLE | h, |
| M2MB_SYS_OP_MODE_E | operatingMode, | ||
| BOOLEAN | persistent | ||
| ) |
m2mb_sys_set_operating_mode sets the operating mode.
The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_sys_init function.
The response event received in the callback will be the M2MB_SYS_SET_OPERATING_MODE_RESP. The resp_struct must be casted to the M2MB_SYS_GENERIC_RESP_T type.
The indication event received in the callback will be the M2MB_SYS_OPERATING_MODE_CHANGED_IND. The resp_struct must be casted to the M2MB_SYS_OPERATING_MODE_T type.
The operation is considered successfully ended when both events above have been received.
| [in] | h | the handle to the SYS service, previously initialized by the m2mb_sys_init function. |
| [in] | operatingMode | operating mode to set |
| [in] | persistent | whether the operating mode must be persistent or not |
m2mb_sys_set_operating_mode(h, operatingMode, persistent);