![]() |
m2mb API docs
25.21.002
m2mb API sets documentation
|
Header file for m2mb_bt_spp APIs. More...
Go to the source code of this file.
Typedefs | |
| typedef void(* | m2mb_bt_spp_event_callback) (M2MB_BT_HANDLE bt_handle, M2MB_BT_USER_EVENTS_T bt_event, UINT16 resp_size, void *resp, void *userdata) |
Functions | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_init (M2MB_BT_HANDLE bt_handle, m2mb_bt_spp_event_callback bt_spp_cb, void *user_data) |
| m2mb_bt_spp_init - initializes BT SPP module More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_deinit (M2MB_BT_HANDLE bt_handle) |
| m2mb_bt_spp_deinit - deinitialize the BT SPP module More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_init_state_get (M2MB_BT_HANDLE bt_handle, M2MB_BT_INIT_STATE_T *state) |
| m2mb_bt_spp_init_state_get - To get the current state of SPP module More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_server_start (M2MB_BT_HANDLE bt_handle, char *server_name) |
| m2mb_bt_spp_server_start - Start SPP server More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_server_stop (M2MB_BT_HANDLE bt_handle) |
| m2mb_bt_spp_server_stop - Stop the SPP server More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_send_data (M2MB_BT_HANDLE bt_handle, INT32 con_id, char *send_data, int data_length) |
| m2mb_bt_spp_send_data - Send data to SPP client More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_recv_data (M2MB_BT_HANDLE bt_handle, INT32 con_id) |
| m2mb_bt_spp_recv_data - To recieve data More... | |
| M2MB_BT_STATUS_T | m2mb_bt_spp_disconnect (M2MB_BT_HANDLE bt_handle, INT32 con_id) |
| m2mb_bt_spp_disconnect - To disconnect SPP connection More... | |
Header file for m2mb_bt_spp APIs.
m2m/m2m_generic/common/m2mb_inc/m2mb_bt_spp.h
m2mb_bt_spp APIs provide actions and events for BT SPP.
| M2MB_BT_STATUS_T m2mb_bt_spp_deinit | ( | M2MB_BT_HANDLE | bt_handle | ) |
m2mb_bt_spp_deinit - deinitialize the BT SPP module
m2mb_bt_spp_deinit deinitialize the BT SPP module. It will release the resources. m2mb_bt_spp_init() API must have been called before using m2mb_bt_spp_deinit() API.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
m2mb_bt_spp_deinit(M2MB_BT_HANDLE bt_handle);
| M2MB_BT_STATUS_T m2mb_bt_spp_disconnect | ( | M2MB_BT_HANDLE | bt_handle, |
| INT32 | con_id | ||
| ) |
m2mb_bt_spp_disconnect - To disconnect SPP connection
m2mb_bt_spp_disconnect disconnect SPP connection m2mb_bt_spp_disconnect() API must be called in connected state.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
| [in] | con_id | Second parameter is connection ID. Connection ID shall be retrieved from M2MB_BT_SPP_PEER_CONNECT_IND |
m2mb_bt_spp_server_stop(M2MB_BT_HANDLE bt_handle);
| M2MB_BT_STATUS_T m2mb_bt_spp_init | ( | M2MB_BT_HANDLE | bt_handle, |
| m2mb_bt_spp_event_callback | bt_spp_cb, | ||
| void * | user_data | ||
| ) |
m2mb_bt_spp_init - initializes BT SPP module
m2mb_bt_spp_init initialize BT SPP module. m2mb_bt_initialize() API must be called before using m2mb_bt_spp_init() API. Calling the m2mb_bt_spp_init is mandatory before using the SPP service.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
m2mb_bt_spp_init(M2MB_BT_HANDLE bt_handle,m2mb_bt_spp_event_callback bt_spp_cb, void *user_data);
| M2MB_BT_STATUS_T m2mb_bt_spp_init_state_get | ( | M2MB_BT_HANDLE | bt_handle, |
| M2MB_BT_INIT_STATE_T * | state | ||
| ) |
m2mb_bt_spp_init_state_get - To get the current state of SPP module
m2mb_bt_spp_init_state_get will return the current state of SPP module. Status will indicate whether SPP module is initialized or not.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
| [in] | *state | second parameter is init state, which will be updated by the function |
m2mb_bt_spp_init_state_get(M2MB_BT_HANDLE bt_handle,M2MB_BT_INIT_STATE_T *state);
| M2MB_BT_STATUS_T m2mb_bt_spp_recv_data | ( | M2MB_BT_HANDLE | bt_handle, |
| INT32 | con_id | ||
| ) |
m2mb_bt_spp_recv_data - To recieve data
m2mb_bt_spp_recv_data Data send request. Its non-blocking call. Recieved data will be indicated via async callback event M2MB_BT_SPP_SERVER_RX_DATA_EVENT_E. m2mb_bt_spp_recv_data() API must be called once client device is connected and SPP is in connected state. i.e. after recieving M2MB_BT_SPP_PEER_CONNECT_IND event from SPP module.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
| [in] | con_id | Second parameter is connection ID. Connection ID shall be retrieved from M2MB_BT_SPP_PEER_CONNECT_IND |
m2mb_bt_spp_recv_data(M2MB_BT_HANDLE bt_handle ,INT32 con_id);
| M2MB_BT_STATUS_T m2mb_bt_spp_send_data | ( | M2MB_BT_HANDLE | bt_handle, |
| INT32 | con_id, | ||
| char * | send_data, | ||
| int | data_length | ||
| ) |
m2mb_bt_spp_send_data - Send data to SPP client
m2mb_bt_spp_send_data Data send request. Its blocking call. m2mb_bt_spp_send_data() API must be called once client device is connected and SPP is in connected state. i.e. after recieving M2MB_BT_SPP_PEER_CONNECT_IND event from SPP module.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
| [in] | con_id | Second parameter is connection ID. Connection ID shall be retrieved from M2MB_BT_SPP_PEER_CONNECT_IND |
| [in] | send_data | Third parameter is pointer to send buffer. |
| [in] | data_length | Fourth parameter is number of bytes to transfer. |
m2mb_bt_spp_send_data(M2MB_BT_HANDLE bt_handle ,INT32 con_id, char *send_data, int data_length);
| M2MB_BT_STATUS_T m2mb_bt_spp_server_start | ( | M2MB_BT_HANDLE | bt_handle, |
| char * | server_name | ||
| ) |
m2mb_bt_spp_server_start - Start SPP server
m2mb_bt_spp_server_start SPP server start request m2mb_bt_spp_init() API must be called before using m2mb_bt_spp_server_start() API.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
| [in] | server_name | Second parameter is the SPP server name. |
m2mb_bt_spp_server_start(M2MB_BT_HANDLE bt_handle, char *server_name);
| M2MB_BT_STATUS_T m2mb_bt_spp_server_stop | ( | M2MB_BT_HANDLE | bt_handle | ) |
m2mb_bt_spp_server_stop - Stop the SPP server
m2mb_bt_spp_server_stop SPP server start request m2mb_bt_spp_server_start() API must be called before using m2mb_bt_spp_server_stop() API.
| [in] | bt_handle | first parameter is the handle to the BT interface. BT handle which was returned during m2mb_bt_initialize() must be used here. |
m2mb_bt_spp_server_stop(M2MB_BT_HANDLE bt_handle);