![]() |
m2mb API docs
37.00.006.0
m2mb API sets documentation
|
Header file for m2mb_ati APIs. More...
Go to the source code of this file.
Typedefs | |
| typedef HANDLE | M2MB_ATI_HANDLE |
| typedef void(* | m2mb_ati_callback) (M2MB_ATI_HANDLE h, M2MB_ATI_EVENTS_E ati_event, UINT16 resp_size, void *resp_struct, void *userdata) |
| Transmit and receive operation callback type. More... | |
Enumerations | |
| enum | M2MB_ATI_EVENTS_E { M2MB_RX_DATA_EVT = 0x01, M2MB_STATE_IDLE_EVT = 0x02, M2MB_STATE_RUNNING_EVT = 0x04, M2MB_STATE_CMD_MODE_EVT = 0x08, M2MB_STATE_ONLINE_MODE_EVT = 0x10 } |
| ATI event type. More... | |
Functions | |
| M2MB_RESULT_E | m2mb_ati_init (M2MB_ATI_HANDLE *pHandle, INT16 atInstance, m2mb_ati_callback callback, void *userdata) |
| m2mb_ati_init initializes a ATI interface for current client. More... | |
| M2MB_RESULT_E | m2mb_ati_deinit (M2MB_ATI_HANDLE handle) |
| m2mb_ati_deinit deinitializes ATI interface for current client. More... | |
| M2MB_RESULT_E | m2mb_ati_send_cmd (M2MB_ATI_HANDLE handle, void *buf, SIZE_T nbyte) |
| m2mb_ati_send_cmd sends a command to an initialized ATI interface. More... | |
| SSIZE_T | m2mb_ati_rcv_resp (M2MB_ATI_HANDLE handle, void *buf, SIZE_T nbyte) |
| m2mb_ati_rcv_resp receives data from an initialized ATI interface. More... | |
Header file for m2mb_ati APIs.
m2m/m2m_generic/common/m2nb_inc/m2mb_ati.h
m2mb_ati APIs provide actions and events for AT interface.
@notes
| typedef void( * m2mb_ati_callback) (M2MB_ATI_HANDLE h, M2MB_ATI_EVENTS_E ati_event, UINT16 resp_size, void *resp_struct, void *userdata) |
Transmit and receive operation callback type.
This type defines the callback functions that the client can set in the m2mb_ati_init API.
| enum M2MB_ATI_EVENTS_E |
ATI event type.
This type defines the indications which can be passed to the callback.
| M2MB_RESULT_E m2mb_ati_deinit | ( | M2MB_ATI_HANDLE | handle | ) |
m2mb_ati_deinit deinitializes ATI interface for current client.
m2mb_ati_deinit deinitialize ATI interface for current client freeing the handle passed as first parameter. Calling the m2mb_ati_deinit is useful after using the ATI interface in order to free memory space and to restore the previous scenario.
| [in] | handle | first parameter is the handle to the ATI interface, that will be deinitialized by the function. |
m2mb_ati_deinit(h);
| M2MB_RESULT_E m2mb_ati_init | ( | M2MB_ATI_HANDLE * | pHandle, |
| INT16 | atInstance, | ||
| m2mb_ati_callback | callback, | ||
| void * | userdata | ||
| ) |
m2mb_ati_init initializes a ATI interface for current client.
m2mb_ati_init initializes a ATI interface for current client returning the handle that must be passed as first parameter for all ATI actions. Every ATI interface is linked to a AT parser instance. Calling the m2mb_ati_init is mandatory before using the ATI interface.
| [in,out] | *pHandle | first parameter is the handle to the ATI interface, that will be initialized by the function. |
| [in] | atInstance | second parameter is the index of the AT parser instance that will be reserved to the current ATI interface. If the At instance is already reseved to another ATI interface or to a physical port, an error is returned. |
| [in] | callback | third parameter is the callback that will be called if an event or a response happens. |
| [in] | userdata | fourth parameter is a pointer to generic user data that will be returned as it is in the callback. |
m2mb_ati_init(&h, instanceID, myCallback, myUserdata);
| SSIZE_T m2mb_ati_rcv_resp | ( | M2MB_ATI_HANDLE | handle, |
| void * | buf, | ||
| SIZE_T | nbyte | ||
| ) |
m2mb_ati_rcv_resp receives data from an initialized ATI interface.
m2mb_ati_rcv_resp reads a message (response or indication) of maximum nbyte Bytes from an previously initialized ATI interface into the destination buffer buf.
| [in] | handle | first parameter is the handle to the ATI interface, previously initialized by the m2mb_ati_init function. |
| [in] | buf | second parameter is the destination buffer, previously allocated. |
| [in] | nbyte | third parameter is the length of the destination buffer in Bytes. |
m2mb_ati_rcv_resp(h, resp_str, max_rsp_len);
| M2MB_RESULT_E m2mb_ati_send_cmd | ( | M2MB_ATI_HANDLE | handle, |
| void * | buf, | ||
| SIZE_T | nbyte | ||
| ) |
m2mb_ati_send_cmd sends a command to an initialized ATI interface.
m2mb_ati_send_cmd writes a command of nbyte Bytes from the source buffer buf to a previously initialized ATI interface.
| [in] | handle | first parameter is the handle to the ATI interface, previously initialized by the m2mb_ati_init function. |
| [in] | buf | second parameter is the source buffer, previously allocated, containing the command string. |
| [in] | nbyte | third parameter is the length of the command string. |
m2mb_ati_send_cmd(h, cmd_str, cmd_len);