clean up notify API

This commit is contained in:
hathach committed 2017-03-27 20:09:40 +07:00
1 parent adffcef44f
commit 1cc6654adf
3 files changed
+3 -10

No files matched your search

@@ -452,7 +452,7 @@ bool BLECharacteristic::notifyEnabled(void)
return (cccd & BLE_GATT_HVX_NOTIFICATION);
}
err_t BLECharacteristic::notify(const void* data, int len, uint16_t offset)
err_t BLECharacteristic::notify(const void* data, int len)
{
VERIFY( _properties.notify, NRF_ERROR_INVALID_PARAM);
@@ -478,7 +478,7 @@ err_t BLECharacteristic::notify(const void* data, int len, uint16_t offset)
{
.handle = _handles.value_handle,
.type = BLE_GATT_HVX_NOTIFICATION,
.offset = offset,
.offset = 0,
.p_len = &packet_len,
.p_data = (uint8_t*) u8data,
};
@@ -487,8 +487,6 @@ err_t BLECharacteristic::notify(const void* data, int len, uint16_t offset)
actual_len -= packet_len;
u8data += packet_len;
if ( offset ) offset += packet_len;
}
}
else
@@ -500,11 +498,6 @@ err_t BLECharacteristic::notify(const void* data, int len, uint16_t offset)
return ERROR_NONE;
}
err_t BLECharacteristic::notify(const void* data, int len)
{
return notify(data, len, 0);
}
err_t BLECharacteristic::notify(const char * str)
{
return notify( (const uint8_t*) str, strlen(str) );