Deprecated.
More...
|
void | pi_nina_b112_conf_init (pi_nina_ble_t *ble) |
| Initialize BLE configuration. More...
|
|
int32_t | pi_nina_b112_open (pi_nina_ble_t *ble) |
| Open BLE module. More...
|
|
void | pi_nina_b112_close (pi_nina_ble_t *ble) |
| Close BLE module. More...
|
|
void | pi_nina_b112_AT_cmd_send (pi_nina_ble_t *ble, const char *cmd) |
| Send an AT command to BLE module. More...
|
|
uint32_t | pi_nina_b112_AT_send (pi_nina_ble_t *ble, const char *cmd) |
| Send an AT command to BLE module. More...
|
|
void | pi_nina_b112_AT_query (pi_nina_ble_t *ble, const char *cmd, char *resp) |
| Send an AT command request to BLE module, and expect a response. More...
|
|
void | pi_nina_b112_wait_for_event (pi_nina_ble_t *ble, char *resp) |
| Wait for a (unsolicited) response. More...
|
|
void | pi_nina_b112_get_data_blocking (pi_nina_ble_t *ble, uint8_t *buffer, uint32_t size) |
| Get data from BLE module. Blocking API. More...
|
|
void | pi_nina_b112_get_data (pi_nina_ble_t *ble, uint8_t *buffer, uint32_t size, struct pi_task *task) |
| Get data from BLE module. Non blocking API. More...
|
|
void | pi_nina_b112_send_data_blocking (pi_nina_ble_t *ble, const uint8_t *buffer, uint32_t size) |
| Send data to BLE module. Blocking API. More...
|
|
void | pi_nina_b112_send_data (pi_nina_ble_t *ble, const uint8_t *buffer, uint32_t size, struct pi_task *task) |
| Send data from BLE module. Non blocking API. More...
|
|
void | pi_nina_b112_exit_data_mode (pi_nina_ble_t *ble) |
| Exit data mode when entered. More...
|
|
- Deprecated:
- This API is no longer supported. Please refer to BLE API.
The nina_b112 driver provides support for for data transfer using a BLE module, here a NINA B112 BLE module. This module is interfaced on GAPPOC through UART.
#define PI_AT_RESP_ARRAY_LENGTH |
typedef void(* ble_callback_f)(void *arg) |
void pi_nina_b112_AT_cmd_send |
( |
pi_nina_ble_t * |
ble, |
|
|
const char * |
cmd |
|
) |
| |
This function sends an AT command to a BLE module.
- Parameters
-
ble | Structure holding IO device. |
cmd | Command to send. |
- Note
- This function is used by pi_nina_b112_AT_send(). pi_nina_b112_AT_send() should be used to send AT commands since this function does not handle responses sent by BLE module.
void pi_nina_b112_AT_query |
( |
pi_nina_ble_t * |
ble, |
|
|
const char * |
cmd, |
|
|
char * |
resp |
|
) |
| |
This function sends an AT command request to a BLE module, and it should return a response for the command request.
- Parameters
-
ble | Structure holding IO device. |
cmd | Command request to send. |
resp | Buffer to store response. |
uint32_t pi_nina_b112_AT_send |
( |
pi_nina_ble_t * |
ble, |
|
|
const char * |
cmd |
|
) |
| |
This function sends an AT command to a BLE module, and waits for response from BLE module. This function should be used to configure BLE module(name, baudrate,...).
- Parameters
-
ble | Structure holding IO device. |
cmd | Command to send. |
- Return values
-
WR_RES_OK | if successfully configured. |
WR_RES_ERROR | in case an error occurred. |
WR_RES_UNSOL | Response sent when not waiting for a response. |
- Note
- Use this function to configure BLE module instead of pi_nina_b112_AT_cmd_send().
This function closes a BLE module. This function should be called to a BLE module once it is not needed and to free allocated objects.
- Parameters
-
ble | Structure holding IO device. |
This function initializes a BLE module, opening IO interface(UART here).
- Parameters
-
ble | Structure holding IO device. |
- Note
- This function is not implemented.
This function should be used to exit data mode. Data mode is entered after BLE module's configuration. In data mode, AT commands can not be sent, only data can be sent.
- Parameters
-
ble | Structure holding IO device. |
- Note
- For NINA B112 module, a delay of 1s is needed before and after the call to this function.
void pi_nina_b112_get_data |
( |
pi_nina_ble_t * |
ble, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size, |
|
|
struct pi_task * |
task |
|
) |
| |
This function is used to retrieve data from BLE module. The data is stored into given buffer. Given struct pi_task can be used to wait end of transfer if needed.
- Parameters
-
ble | Structure holding IO device. |
buffer | Buffer to store response. |
size | Size of response data. |
task | Task to use to check end of transfer. |
- Note
- This function is asynchronous, caller can do something else while transfer is enqueued The pending synchronous function is below : pi_nina_b112_get_data_blocking().
void pi_nina_b112_get_data_blocking |
( |
pi_nina_ble_t * |
ble, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
This function is used to retrieve data from BLE module. The data is stored into given buffer.
- Parameters
-
ble | Structure holding IO device. |
buffer | Buffer to store response. |
size | Size of response data. |
- Note
- This function is synchronous, caller can not do anything else until transfer is finished. The pending asynchronous function is below : pi_nina_b112_get_data().
This function initializes and sets up a BLE module. It does all the needed configuration to enable the BLE module(buffer allocation, opening IO interface, etc.). Thus this function must be called before using BLE module.
- Parameters
-
ble | Structure holding IO device. |
- Return values
-
0 | if the operation is successful. |
error | otherwise. |
void pi_nina_b112_send_data |
( |
pi_nina_ble_t * |
ble, |
|
|
const uint8_t * |
buffer, |
|
|
uint32_t |
size, |
|
|
struct pi_task * |
task |
|
) |
| |
This function is used to send data to BLE module. Given struct pi_task can be used to wait end of transfer if needed.
- Parameters
-
ble | Structure holding IO device. |
buffer | Buffer to send. |
size | Size of data to send. |
task | Task to use to check end of transfer. |
- Note
- This function is asynchronous, caller can dos something else while transfer is enqueued The pending synchronous function is below : pi_nina_b112_send_data_blocking().
void pi_nina_b112_send_data_blocking |
( |
pi_nina_ble_t * |
ble, |
|
|
const uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
This function is used to send data to BLE module.
- Parameters
-
ble | Structure holding IO device. |
buffer | Buffer to send. |
size | Size of data to send. |
- Note
- This function is synchronous, caller can not do anything else until transfer is finished. The pending asynchronous function is below : pi_nina_b112_send_data().
void pi_nina_b112_wait_for_event |
( |
pi_nina_ble_t * |
ble, |
|
|
char * |
resp |
|
) |
| |
This function sends an AT command request to a BLE module, and it should return a response for the command request.
- Parameters
-
ble | Structure holding IO device. |
resp | Buffer to store response. |