Flying Silicon Sensor
|
#include <bleInterface.h>
Public Member Functions | |
void | init (const char *deviceName) |
void | startAdv (void) |
void | sendData (const char *buf, int len) |
void | poll (void) |
void | shutdown (void) |
int | isConnected (void) |
Static Public Attributes | |
static const int | MtuSize = BLE_ATT_LEN + 3 |
BLE MTU size. | |
Static Protected Member Functions | |
static void | cbDisconnect (uint16_t conn_handle, uint8_t reason) |
static void | cbConnect (uint16_t conn_handle) |
Protected Attributes | |
FsUart | bleuart |
Customized UART service. | |
Encapsulates BLE connection details
Definition at line 40 of file bleInterface.h.
|
staticprotected |
Callback invoked when central connects
Definition at line 35 of file bleInterface.cpp.
References MtuSize.
Referenced by init().
|
staticprotected |
Callback invoked when central disconnects
Definition at line 66 of file bleInterface.cpp.
Referenced by init().
void BleInterface::init | ( | const char * | deviceName | ) |
Initialise the Adafruit BLE library
deviceName | Name of the device visible at BLE central |
Definition at line 166 of file bleInterface.cpp.
References bleuart, cbConnect(), cbDisconnect(), and MtuSize.
Referenced by appSetup().
int BleInterface::isConnected | ( | void | ) |
BLE connected query
Definition at line 87 of file bleInterface.cpp.
Referenced by appLoop(), and PtvBleInterface::poll().
void BleInterface::poll | ( | void | ) |
Should be called periodically to poll BLE UART FIFO (default implementation, does nothing with data)
Definition at line 75 of file bleInterface.cpp.
References bleuart.
void BleInterface::sendData | ( | const char * | buf, |
int | len | ||
) |
Transmit a string via BLE
buf | String / Data |
len | Length |
Definition at line 119 of file bleInterface.cpp.
References bleuart.
Referenced by PtvBleInterface::sendChunked().
void BleInterface::shutdown | ( | void | ) |
Stop BLE advertising and force disconnect
Definition at line 95 of file bleInterface.cpp.
void BleInterface::startAdv | ( | void | ) |
Setup and start BLE advertising
Definition at line 127 of file bleInterface.cpp.
References bleuart.
Referenced by enable().
|
protected |
Customized UART service.
Definition at line 57 of file bleInterface.h.
Referenced by init(), PtvBleInterface::poll(), poll(), sendData(), and startAdv().
|
static |
BLE MTU size.
NOTE: The connection interval must be rather short for constant data flow anyway, so there is no benefit in using a larger MTU size for the messages we send.
Definition at line 53 of file bleInterface.h.
Referenced by cbConnect(), and init().