![]() |
m2mb API docs
30.00.007
m2mb API sets documentation
|
Base system functions for m2m application. 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 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 information about operating mode. More... | |
| M2MB_RESULT_E | m2mb_sys_reboot (int Type) |
| m2mb_sys_reboot restarts all the system More... | |
Base system functions for m2m application.
m2m/m2m_generic/common/m2mb_inc/m2mb_sys.h
@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. Calling the m2mb_sys_deinit is useful after using the SYS service in order to free memory space.
| [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 operating mode.
m2mb_sys_get_operating_mode gets information about 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. |
| [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_reboot | ( | int | Type | ) |
m2mb_sys_reboot restarts all the system
This function performs a system reboot
| [in] | Type | Unused, usually must be set to 0 |
m2mb_sys_reboot(0)
| 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 information about operating mode.
m2mb_sys_set_operating_mode sets information about 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 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.
| [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);