core/BLE: debug output for characteristics we read/write

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-06-27 17:14:03 -07:00
parent ac533a6433
commit 86c78d21ad

View file

@ -410,6 +410,19 @@ dc_status_t BLEObject::select_preferred_service(void)
return DC_STATUS_IO;
}
bool hasread = false;
bool haswrite = false;
foreach (const QLowEnergyCharacteristic &c, preferred->characteristics()) {
if (is_read_characteristic(c) && !hasread) {
qDebug() << " Reading from " << c.uuid();
hasread = true;
}
if (is_write_characteristic(c) && !haswrite) {
qDebug() << " Writing to " << c.uuid();
haswrite = true;
}
}
connect(preferred, &QLowEnergyService::stateChanged, this, &BLEObject::serviceStateChanged);
connect(preferred, &QLowEnergyService::characteristicChanged, this, &BLEObject::characteristcStateChanged);
connect(preferred, &QLowEnergyService::characteristicWritten, this, &BLEObject::characteristicWritten);