project
Fork of X_NUCLEO_IDB0XA1 by
BlueNRGDevice
BlueNRG BLE_API Device Adaptation. More...
Functions | |
BlueNRGDevice | bluenrgDeviceInstance (IDB0XA1_PIN_SPI_MOSI, IDB0XA1_PIN_SPI_MISO, IDB0XA1_PIN_SPI_SCK, IDB0XA1_PIN_SPI_nCS, IDB0XA1_PIN_SPI_RESET, IDB0XA1_PIN_SPI_IRQ) |
The singleton which represents the BlueNRG transport for the BLEDevice. | |
BLEInstanceBase * | createBLEInstance (void) |
BLE-API requires an implementation of the following function in order to obtain its transport handle. | |
BlueNRGDevice (PinName mosi, PinName miso, PinName sck, PinName cs, PinName rst, PinName irq) | |
Constructor. | |
virtual | ~BlueNRGDevice (void) |
Destructor. | |
virtual ble_error_t | init (BLE::InstanceID_t instanceID, FunctionPointerWithContext< BLE::InitializationCompleteCallbackContext * > callback) |
Initialises anything required to start using BLE. | |
ble_error_t | reset (void) |
Resets the BLE HW, removing any existing services and characteristics. | |
virtual void | waitForEvent (void) |
Wait for any BLE Event like BLE Connection, Read Request etc. | |
virtual const char * | getVersion (void) |
get GAP version | |
virtual Gap & | getGap () |
get reference to GAP object | |
virtual GattServer & | getGattServer () |
get reference to GATT server object | |
virtual ble_error_t | shutdown (void) |
shut down the the BLE device | |
int32_t | spiRead (uint8_t *buffer, uint8_t buff_size) |
Reads from BlueNRG SPI buffer and store data into local buffer. | |
int32_t | spiWrite (uint8_t *data1, uint8_t *data2, uint8_t Nb_bytes1, uint8_t Nb_bytes2) |
Writes data from local buffer to SPI. |
Detailed Description
BlueNRG BLE_API Device Adaptation.
Function Documentation
BlueNRGDevice | ( | PinName | mosi, |
PinName | miso, | ||
PinName | sck, | ||
PinName | cs, | ||
PinName | rst, | ||
PinName | irq | ||
) | [inherited] |
Constructor.
- Parameters:
-
mosi mbed pin to use for MOSI line of SPI interface miso mbed pin to use for MISO line of SPI interface sck mbed pin to use for SCK line of SPI interface cs mbed pin to use for not chip select line of SPI interface rst mbed pin to use for BlueNRG reset irq mbed pin for BlueNRG IRQ
Definition at line 94 of file BlueNRGDevice.cpp.
BlueNRGDevice bluenrgDeviceInstance | ( | IDB0XA1_PIN_SPI_MOSI | , |
IDB0XA1_PIN_SPI_MISO | , | ||
IDB0XA1_PIN_SPI_SCK | , | ||
IDB0XA1_PIN_SPI_nCS | , | ||
IDB0XA1_PIN_SPI_RESET | , | ||
IDB0XA1_PIN_SPI_IRQ | |||
) |
The singleton which represents the BlueNRG transport for the BLEDevice.
See file 'x_nucleo_idb0xa1_targets.h' for details regarding the peripheral pins used!
BLEInstanceBase* createBLEInstance | ( | void | ) |
BLE-API requires an implementation of the following function in order to obtain its transport handle.
Definition at line 78 of file BlueNRGDevice.cpp.
Gap & getGap | ( | ) | [virtual, inherited] |
get reference to GAP object
- Parameters:
-
[in] void
- Returns:
- Gap&
Definition at line 225 of file BlueNRGDevice.cpp.
GattServer & getGattServer | ( | ) | [virtual, inherited] |
get reference to GATT server object
- Parameters:
-
[in] void
- Returns:
- GattServer&
Definition at line 242 of file BlueNRGDevice.cpp.
const char * getVersion | ( | void | ) | [virtual, inherited] |
get GAP version
- Parameters:
-
[in] void
- Returns:
- char *
Definition at line 211 of file BlueNRGDevice.cpp.
ble_error_t init | ( | BLE::InstanceID_t | instanceID, |
FunctionPointerWithContext< BLE::InitializationCompleteCallbackContext * > | callback | ||
) | [virtual, inherited] |
Initialises anything required to start using BLE.
- Parameters:
-
[in] void
- Returns:
- ble_error_t
Definition at line 128 of file BlueNRGDevice.cpp.
ble_error_t reset | ( | void | ) | [inherited] |
Resets the BLE HW, removing any existing services and characteristics.
- Parameters:
-
[in] void
- Returns:
- ble_error_t
Definition at line 164 of file BlueNRGDevice.cpp.
ble_error_t shutdown | ( | void | ) | [virtual, inherited] |
shut down the the BLE device
- Parameters:
-
[out] error if any
Definition at line 258 of file BlueNRGDevice.cpp.
int32_t spiRead | ( | uint8_t * | buffer, |
uint8_t | buff_size | ||
) | [inherited] |
Reads from BlueNRG SPI buffer and store data into local buffer.
- Parameters:
-
buffer : Buffer where data from SPI are stored buff_size,: Buffer size
- Return values:
-
int32_t : Number of read bytes
Definition at line 268 of file BlueNRGDevice.cpp.
int32_t spiWrite | ( | uint8_t * | data1, |
uint8_t * | data2, | ||
uint8_t | Nb_bytes1, | ||
uint8_t | Nb_bytes2 | ||
) | [inherited] |
Writes data from local buffer to SPI.
- Parameters:
-
data1 : First data buffer to be written data2 : Second data buffer to be written Nb_bytes1,: Size of first data buffer to be written Nb_bytes2,: Size of second data buffer to be written
- Return values:
-
Number of read bytes
Definition at line 336 of file BlueNRGDevice.cpp.
void waitForEvent | ( | void | ) | [virtual, inherited] |
Wait for any BLE Event like BLE Connection, Read Request etc.
- Parameters:
-
[in] void
- Returns:
- char *
Definition at line 187 of file BlueNRGDevice.cpp.
~BlueNRGDevice | ( | void | ) | [virtual, inherited] |
Destructor.
Definition at line 118 of file BlueNRGDevice.cpp.
Generated on Tue Jul 12 2022 19:31:15 by 1.7.2