Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 166debb

Browse files
committed
restore handleInd and handleNotify original interfaces
1 parent c81df43 commit 166debb

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

‎src/local/BLELocalCharacteristic.cpp‎

Lines changed: 3 additions & 3 deletions
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
}

‎src/utility/ATT.cpp‎

Lines changed: 10 additions & 0 deletions
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;

‎src/utility/ATT.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ class ATTClass {
8383

8484
virtual BLEDevice central();
8585

86+
virtual bool handleNotify(uint16_t handle, const uint8_t* value, int length);
8687
virtual bool handleNotify(uint16_t handle, const uint8_t* value, uint16_t *length);
88+
virtual bool handleInd(uint16_t handle, const uint8_t* value, int length);
8789
virtual bool handleInd(uint16_t handle, const uint8_t* value, uint16_t *length);
8890

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /