nRFDiscoveredCharacteristic: handle setup of properties correctly.
parent
7cf266a318
commit
4ec5b9443b
|
@ -249,13 +249,13 @@ NordicServiceDiscovery::setupDiscoveredCharacteristics(const ble_gattc_evt_char_
|
|||
if (response->chars[charIndex].uuid.type == BLE_UUID_TYPE_UNKNOWN) {
|
||||
charUUIDDiscoveryQueue.enqueue(charIndex);
|
||||
characteristics[charIndex].setup(connHandle,
|
||||
*(const uint8_t *)(&response->chars[charIndex].char_props),
|
||||
response->chars[charIndex].char_props,
|
||||
response->chars[charIndex].handle_decl,
|
||||
response->chars[charIndex].handle_value);
|
||||
} else {
|
||||
characteristics[charIndex].setup(connHandle,
|
||||
response->chars[charIndex].uuid.uuid,
|
||||
*(const uint8_t *)(&response->chars[charIndex].char_props),
|
||||
response->chars[charIndex].char_props,
|
||||
response->chars[charIndex].handle_decl,
|
||||
response->chars[charIndex].handle_value);
|
||||
}
|
||||
|
|
|
@ -20,25 +20,39 @@
|
|||
class nRFDiscoveredCharacteristic : public DiscoveredCharacteristic {
|
||||
public:
|
||||
void setup(Gap::Handle_t connectionHandleIn,
|
||||
Properties_t propsIn,
|
||||
ble_gatt_char_props_t propsIn,
|
||||
GattAttribute::Handle_t declHandleIn,
|
||||
GattAttribute::Handle_t valueHandleIn) {
|
||||
connHandle = connectionHandleIn;
|
||||
props = propsIn;
|
||||
declHandle = declHandleIn;
|
||||
valueHandle = valueHandleIn;
|
||||
|
||||
props._broadcast = propsIn.broadcast;
|
||||
props._read = propsIn.read;
|
||||
props._writeWoResp = propsIn.write_wo_resp;
|
||||
props._write = propsIn.write;
|
||||
props._notify = propsIn.notify;
|
||||
props._indicate = propsIn.indicate;
|
||||
props._authSignedWrite = propsIn.auth_signed_wr;
|
||||
}
|
||||
|
||||
void setup(Gap::Handle_t connectionHandleIn,
|
||||
UUID::ShortUUIDBytes_t uuidIn,
|
||||
Properties_t propsIn,
|
||||
ble_gatt_char_props_t propsIn,
|
||||
GattAttribute::Handle_t declHandleIn,
|
||||
GattAttribute::Handle_t valueHandleIn) {
|
||||
connHandle = connectionHandleIn;
|
||||
uuid = uuidIn;
|
||||
props = propsIn;
|
||||
declHandle = declHandleIn;
|
||||
valueHandle = valueHandleIn;
|
||||
|
||||
props._broadcast = propsIn.broadcast;
|
||||
props._read = propsIn.read;
|
||||
props._writeWoResp = propsIn.write_wo_resp;
|
||||
props._write = propsIn.write;
|
||||
props._notify = propsIn.notify;
|
||||
props._indicate = propsIn.indicate;
|
||||
props._authSignedWrite = propsIn.auth_signed_wr;
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue