PMSIS BSP
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
NINA_B112_OLD

Deprecated. More...

Data Structures

struct  pi_nina_ble_t
 

Macros

#define PI_AT_RESP_ARRAY_LENGTH
 

Typedefs

typedef void(* ble_callback_f )(void *arg)
 

Functions

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...
 

Description

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.

Macro Definition Documentation

#define PI_AT_RESP_ARRAY_LENGTH

RESP array length.

Typedef Documentation

typedef void(* ble_callback_f)(void *arg)

Function Documentation

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
bleStructure holding IO device.
cmdCommand 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
bleStructure holding IO device.
cmdCommand request to send.
respBuffer 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
bleStructure holding IO device.
cmdCommand to send.
Return values
WR_RES_OKif successfully configured.
WR_RES_ERRORin case an error occurred.
WR_RES_UNSOLResponse sent when not waiting for a response.
Note
Use this function to configure BLE module instead of pi_nina_b112_AT_cmd_send().
void pi_nina_b112_close ( pi_nina_ble_t ble)

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
bleStructure holding IO device.
void pi_nina_b112_conf_init ( pi_nina_ble_t ble)

This function initializes a BLE module, opening IO interface(UART here).

Parameters
bleStructure holding IO device.
Note
This function is not implemented.
void pi_nina_b112_exit_data_mode ( pi_nina_ble_t ble)

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
bleStructure 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
bleStructure holding IO device.
bufferBuffer to store response.
sizeSize of response data.
taskTask 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
bleStructure holding IO device.
bufferBuffer to store response.
sizeSize 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().
int32_t pi_nina_b112_open ( pi_nina_ble_t ble)

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
bleStructure holding IO device.
Return values
0if the operation is successful.
errorotherwise.
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
bleStructure holding IO device.
bufferBuffer to send.
sizeSize of data to send.
taskTask 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
bleStructure holding IO device.
bufferBuffer to send.
sizeSize 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
bleStructure holding IO device.
respBuffer to store response.