move variants of setup into nRFDiscoveredCharacteristic.
parent
543e493d70
commit
12ed0b3884
|
@ -247,11 +247,13 @@ NordicServiceDiscovery::setupDiscoveredCharacteristics(const ble_gattc_evt_char_
|
|||
for (unsigned charIndex = 0; charIndex < numCharacteristics; charIndex++) {
|
||||
if (response->chars[charIndex].uuid.type == BLE_UUID_TYPE_UNKNOWN) {
|
||||
charUUIDDiscoveryQueue.enqueue(charIndex);
|
||||
characteristics[charIndex].setup(*(const uint8_t *)(&response->chars[charIndex].char_props),
|
||||
characteristics[charIndex].setup(connHandle,
|
||||
*(const uint8_t *)(&response->chars[charIndex].char_props),
|
||||
response->chars[charIndex].handle_decl,
|
||||
response->chars[charIndex].handle_value);
|
||||
} else {
|
||||
characteristics[charIndex].setup(response->chars[charIndex].uuid.uuid,
|
||||
characteristics[charIndex].setup(connHandle,
|
||||
response->chars[charIndex].uuid.uuid,
|
||||
*(const uint8_t *)(&response->chars[charIndex].char_props),
|
||||
response->chars[charIndex].handle_decl,
|
||||
response->chars[charIndex].handle_value);
|
||||
|
|
|
@ -23,6 +23,29 @@
|
|||
void bleGattcEventHandler(const ble_evt_t *p_ble_evt);
|
||||
|
||||
class nRFDiscoveredCharacteristic : public DiscoveredCharacteristic {
|
||||
public:
|
||||
void setup(Gap::Handle_t connectionHandleIn,
|
||||
Properties_t propsIn,
|
||||
GattAttribute::Handle_t declHandleIn,
|
||||
GattAttribute::Handle_t valueHandleIn) {
|
||||
connHandle = connectionHandleIn;
|
||||
props = propsIn;
|
||||
declHandle = declHandleIn;
|
||||
valueHandle = valueHandleIn;
|
||||
}
|
||||
|
||||
void setup(Gap::Handle_t connectionHandleIn,
|
||||
UUID::ShortUUIDBytes_t uuidIn,
|
||||
Properties_t propsIn,
|
||||
GattAttribute::Handle_t declHandleIn,
|
||||
GattAttribute::Handle_t valueHandleIn) {
|
||||
connHandle = connectionHandleIn;
|
||||
uuid = uuidIn;
|
||||
props = propsIn;
|
||||
declHandle = declHandleIn;
|
||||
valueHandle = valueHandleIn;
|
||||
}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Initiate (or continue) a read for the value attribute, optionally at a
|
||||
|
|
Loading…
Reference in New Issue