clean up
This commit is contained in:
1 parent
e175e7ff3d
commit
91f6de09f8
6 files changed
+28
-26
No files matched your search
@@ -103,7 +103,7 @@ public:
|
||||
/*------------- Client Service -------------*/
|
||||
bool addService(BLEClientService& service);
|
||||
|
||||
// Custom API
|
||||
// Functions to work with the raw advertising packet
|
||||
uint8_t count(void);
|
||||
uint8_t* getData(void);
|
||||
bool setData(const uint8_t* data, uint8_t count);
|
||||
|
||||
@@ -59,7 +59,7 @@ class BLECentral
|
||||
void begin(void);
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/*
|
||||
/* GAP
|
||||
*------------------------------------------------------------------*/
|
||||
bool setConnInterval(uint16_t min, uint16_t max);
|
||||
bool setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);
|
||||
|
||||
@@ -73,6 +73,7 @@ enum CharsProperties
|
||||
class BLECharacteristic
|
||||
{
|
||||
public:
|
||||
/*------------- Callback Signatures -------------*/
|
||||
typedef void (*read_authorize_cb_t) (BLECharacteristic& chr, ble_gatts_evt_read_t * request);
|
||||
typedef void (*write_authorize_cb_t) (BLECharacteristic& chr, ble_gatts_evt_write_t* request);
|
||||
typedef void (*write_cb_t) (BLECharacteristic& chr, uint8_t* data, uint16_t len, uint16_t offset);
|
||||
@@ -80,11 +81,11 @@ class BLECharacteristic
|
||||
|
||||
BLEUuid uuid;
|
||||
|
||||
typedef void (*chars_cb_t) (void);
|
||||
|
||||
// Constructors
|
||||
BLECharacteristic(void);
|
||||
BLECharacteristic(BLEUuid bleuuid);
|
||||
|
||||
// Destructor
|
||||
virtual ~BLECharacteristic();
|
||||
|
||||
BLEService& parentService(void);
|
||||
@@ -133,8 +134,10 @@ class BLECharacteristic
|
||||
|
||||
/*------------- Notify -------------*/
|
||||
bool notifyEnabled(void);
|
||||
|
||||
bool notify(const void* data, uint16_t len);
|
||||
bool notify(const char* str);
|
||||
|
||||
bool notify(int num);
|
||||
bool notify(uint32_t num);
|
||||
bool notify(uint16_t num);
|
||||
|
||||
@@ -46,6 +46,7 @@ class BLEClientService;
|
||||
class BLEClientCharacteristic
|
||||
{
|
||||
public:
|
||||
/*--------- Callback Signatures ----------*/
|
||||
typedef void (*notify_cb_t ) (BLEClientCharacteristic& chr, uint8_t* data, uint16_t len);
|
||||
typedef void (*indicate_cb_t) (BLEClientCharacteristic& chr, uint8_t* data, uint16_t len);
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ class BLEGap
|
||||
|
||||
BLEGap(void);
|
||||
|
||||
uint8_t getAddr (uint8_t mac[6]);
|
||||
bool setAddr (uint8_t mac[6], uint8_t type);
|
||||
uint8_t getAddr (uint8_t mac[6]);
|
||||
bool setAddr (uint8_t mac[6], uint8_t type);
|
||||
// bool setPrivacy (); sd_ble_gap_privacy_set()
|
||||
|
||||
bool connected (uint16_t conn_handle);
|
||||
@@ -66,19 +66,19 @@ class BLEGap
|
||||
ble_gap_addr_t getPeerAddr (uint16_t conn_handle);
|
||||
uint16_t getPeerName (uint16_t conn_handle, char* buf, uint16_t bufsize);
|
||||
|
||||
void configPrphConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
void configCentralConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
|
||||
uint16_t getMTU (uint16_t conn_handle);
|
||||
uint16_t getMaxMtuByConnCfg (uint8_t conn_cfg);
|
||||
uint16_t getMaxMtu (uint8_t conn_handle);
|
||||
|
||||
uint8_t getHvnQueueSize (uint8_t conn_handle);
|
||||
uint8_t getWriteCmdQueueSize (uint8_t conn_handle);
|
||||
|
||||
uint16_t getMTU (uint16_t conn_handle);
|
||||
|
||||
bool getHvnPacket (uint16_t conn_handle);
|
||||
bool getWriteCmdPacket (uint16_t conn_handle);
|
||||
|
||||
void configPrphConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
void configCentralConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* INTERNAL USAGE ONLY
|
||||
* Although declare as public, it is meant to be invoked by internal
|
||||
|
||||
@@ -107,8 +107,7 @@ extern "C"
|
||||
class AdafruitBluefruit
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
AdafruitBluefruit(void);
|
||||
AdafruitBluefruit(void); // Constructor
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* Lower Level Classes (Bluefruit.Advertising.*, etc.)
|
||||
@@ -124,22 +123,21 @@ class AdafruitBluefruit
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* SoftDevice Configure Functions, must call before begin().
|
||||
* These function affect the SRAM consumed by SoftDevice. Should the
|
||||
* required SRAM exceed numbered allocated by default linker, choose
|
||||
* another linker in the IDE menu
|
||||
* These function affect the SRAM consumed by SoftDevice.
|
||||
*------------------------------------------------------------------*/
|
||||
void configServiceChanged (bool changed);
|
||||
void configUuid128Count (uint8_t uuid128_max);
|
||||
void configAttrTableSize (uint32_t attr_table_size);
|
||||
void configServiceChanged (bool changed);
|
||||
void configUuid128Count (uint8_t uuid128_max);
|
||||
void configAttrTableSize (uint32_t attr_table_size);
|
||||
|
||||
// Config Bandwidth for connections
|
||||
void configPrphConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
void configCentralConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
// Convenient function to config connection
|
||||
void configPrphBandwidth (uint8_t bw);
|
||||
void configCentralBandwidth(uint8_t bw);
|
||||
void configPrphConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
void configCentralConn (uint16_t mtu_max, uint8_t event_len, uint8_t hvn_qsize, uint8_t wrcmd_qsize);
|
||||
|
||||
err_t begin(uint8_t prph_count = 1, uint8_t central_count = 0);
|
||||
// Convenient function to config connection
|
||||
void configPrphBandwidth (uint8_t bw);
|
||||
void configCentralBandwidth(uint8_t bw);
|
||||
|
||||
err_t begin(uint8_t prph_count = 1, uint8_t central_count = 0);
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* General Functions
|
||||
@@ -175,7 +173,7 @@ class AdafruitBluefruit
|
||||
ble_gap_addr_t getPeerAddr (void);
|
||||
uint8_t getPeerAddr (uint8_t addr[6]);
|
||||
|
||||
void printInfo(void);
|
||||
void printInfo(void);
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* Callbacks
|
||||
|
||||
Reference in new issue
Block a user