Skip to content

Commit 517881c

Browse files
committed
restore handleInd and handleNotify original interfaces
1 parent c81df43 commit 517881c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

Diff for: src/local/BLELocalCharacteristic.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ int BLELocalCharacteristic::writeValue(const uint8_t value[], int length)
119119
}
120120

121121
if ((_properties & BLEIndicate) && (_cccdValue & 0x0002)) {
122-
return ATT.handleInd(valueHandle(), _value,&_valueLength);
122+
return ATT.handleInd(valueHandle(), _value, _valueLength);
123123
} else if ((_properties & BLENotify) && (_cccdValue & 0x0001)) {
124-
return ATT.handleNotify(valueHandle(), _value, &_valueLength);
124+
return ATT.handleNotify(valueHandle(), _value, _valueLength);
125125
}
126126

127127
if (_broadcast) {
@@ -169,7 +169,7 @@ int BLELocalCharacteristic::write(const uint8_t value[], int length)
169169
uint16_t serviceUuid = GATT.serviceUuidForCharacteristic(this);
170170

171171
BLE.setAdvertisedServiceData(serviceUuid, value, length);
172-
172+
173173
if (!ATT.connected() && GAP.advertising()) {
174174
BLE.advertise();
175175
}

Diff for: src/utility/ATT.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,11 @@ BLEDevice ATTClass::central()
582582
return BLEDevice();
583583
}
584584

585+
bool ATTClass::handleNotify(uint16_t handle, const uint8_t *value, int length)
586+
{
587+
return handleNotify(handle, value, (uint16_t*)&length);
588+
}
589+
585590
bool ATTClass::handleNotify(uint16_t handle, const uint8_t* value, uint16_t *length)
586591
{
587592
int numNotifications = 0;
@@ -613,6 +618,11 @@ bool ATTClass::handleNotify(uint16_t handle, const uint8_t* value, uint16_t *len
613618
return (numNotifications > 0);
614619
}
615620

621+
bool ATTClass::handleInd(uint16_t handle, const uint8_t *value, int length)
622+
{
623+
return handleInd(handle, value, (uint16_t*)&length);
624+
}
625+
616626
bool ATTClass::handleInd(uint16_t handle, const uint8_t* value, uint16_t *length)
617627
{
618628
int numIndications = 0;

Diff for: src/utility/ATT.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ class ATTClass {
8282
virtual bool disconnect();
8383

8484
virtual BLEDevice central();
85-
85+
virtual bool handleNotify(uint16_t handle, const uint8_t* value, int length);
8686
virtual bool handleNotify(uint16_t handle, const uint8_t* value, uint16_t *length);
87+
virtual bool handleInd(uint16_t handle, const uint8_t* value, int length);
8788
virtual bool handleInd(uint16_t handle, const uint8_t* value, uint16_t *length);
8889

8990
virtual void setEventHandler(BLEDeviceEvent event, BLEDeviceEventHandler eventHandler);

0 commit comments

Comments
 (0)