move conn_hdl to 1st parameter in indicate API
This commit is contained in:
1 parent
3b9805f124
commit
9b0bf8b817
2 files changed
+61
-19
No files matched your search
@@ -750,7 +750,7 @@ bool BLECharacteristic::notify32(int num)
|
||||
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* INDICATE
|
||||
/* INDICATE multiple connections
|
||||
*------------------------------------------------------------------*/
|
||||
bool BLECharacteristic::indicateEnabled(void)
|
||||
{
|
||||
@@ -763,7 +763,7 @@ bool BLECharacteristic::indicateEnabled(uint16_t conn_hdl)
|
||||
return (getCccd(conn_hdl) & BLE_GATT_HVX_INDICATION);
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate(const void* data, uint16_t len, uint16_t conn_hdl)
|
||||
bool BLECharacteristic::indicate(uint16_t conn_hdl, const void* data, uint16_t len)
|
||||
{
|
||||
VERIFY( _properties.indicate );
|
||||
|
||||
@@ -813,27 +813,60 @@ bool BLECharacteristic::indicate(const void* data, uint16_t len, uint16_t conn_h
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate(const char * str, uint16_t conn_hdl)
|
||||
bool BLECharacteristic::indicate(uint16_t conn_hdl, const char * str)
|
||||
{
|
||||
return indicate((const uint8_t*) str, strlen(str), conn_hdl);
|
||||
return indicate(conn_hdl, (const uint8_t*) str, strlen(str));
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate8(uint8_t num, uint16_t conn_hdl)
|
||||
bool BLECharacteristic::indicate8(uint16_t conn_hdl, uint8_t num)
|
||||
{
|
||||
return indicate((uint8_t*) &num, sizeof(num), conn_hdl);
|
||||
return indicate(conn_hdl, (uint8_t*) &num, sizeof(num));
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate16(uint16_t num, uint16_t conn_hdl)
|
||||
bool BLECharacteristic::indicate16(uint16_t conn_hdl, uint16_t num)
|
||||
{
|
||||
return indicate((uint8_t*) &num, sizeof(num), conn_hdl);
|
||||
return indicate(conn_hdl, (uint8_t*) &num, sizeof(num));
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate32(uint32_t num, uint16_t conn_hdl)
|
||||
bool BLECharacteristic::indicate32(uint16_t conn_hdl, uint32_t num)
|
||||
{
|
||||
return indicate((uint8_t*) &num, sizeof(num), conn_hdl);
|
||||
return indicate(conn_hdl, (uint8_t*) &num, sizeof(num));
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate32(int num, uint16_t conn_hdl)
|
||||
bool BLECharacteristic::indicate32(uint16_t conn_hdl, int num)
|
||||
{
|
||||
return indicate32((uint32_t) num, conn_hdl);
|
||||
return indicate32(conn_hdl, (uint32_t) num);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* INDICATE single connections
|
||||
*------------------------------------------------------------------*/
|
||||
bool BLECharacteristic::indicate(const void* data, uint16_t len)
|
||||
{
|
||||
return indicate(BLE_CONN_HANDLE_INVALID, data, len);
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate(const char* str)
|
||||
{
|
||||
return indicate(BLE_CONN_HANDLE_INVALID, str);
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate8(uint8_t num)
|
||||
{
|
||||
return indicate8(BLE_CONN_HANDLE_INVALID, num);
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate16(uint16_t num)
|
||||
{
|
||||
return indicate16(BLE_CONN_HANDLE_INVALID, num);
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate32(uint32_t num)
|
||||
{
|
||||
return indicate32(BLE_CONN_HANDLE_INVALID, num);
|
||||
}
|
||||
|
||||
bool BLECharacteristic::indicate32(int num)
|
||||
{
|
||||
return indicate32(BLE_CONN_HANDLE_INVALID, num);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class BLECharacteristic
|
||||
bool notify32 (uint32_t num);
|
||||
bool notify32 (int num);
|
||||
|
||||
/*------------- Notify -------------*/
|
||||
/*------------- Notify multiple connections -------------*/
|
||||
bool notify (uint16_t conn_hdl, const void* data, uint16_t len);
|
||||
bool notify (uint16_t conn_hdl, const char* str);
|
||||
|
||||
@@ -160,13 +160,22 @@ class BLECharacteristic
|
||||
bool indicateEnabled(void);
|
||||
bool indicateEnabled(uint16_t conn_hdl);
|
||||
|
||||
bool indicate (const void* data, uint16_t len, uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
|
||||
bool indicate (const char* str, uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
|
||||
bool indicate (const void* data, uint16_t len);
|
||||
bool indicate (const char* str);
|
||||
|
||||
bool indicate8 (uint8_t num, uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
|
||||
bool indicate16 (uint16_t num, uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
|
||||
bool indicate32 (uint32_t num, uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
|
||||
bool indicate32 (int num, uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
|
||||
bool indicate8 (uint8_t num);
|
||||
bool indicate16 (uint16_t num);
|
||||
bool indicate32 (uint32_t num);
|
||||
bool indicate32 (int num);
|
||||
|
||||
/*------------- Indicate multiple connections -------------*/
|
||||
bool indicate (uint16_t conn_hdl, const void* data, uint16_t len);
|
||||
bool indicate (uint16_t conn_hdl, const char* str);
|
||||
|
||||
bool indicate8 (uint16_t conn_hdl, uint8_t num);
|
||||
bool indicate16 (uint16_t conn_hdl, uint16_t num);
|
||||
bool indicate32 (uint16_t conn_hdl, uint32_t num);
|
||||
bool indicate32 (uint16_t conn_hdl, int num);
|
||||
|
||||
/*------------- Internal Functions -------------*/
|
||||
virtual void _eventHandler(ble_evt_t* event);
|
||||
|
||||
Reference in new issue
Block a user