mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Report an error if enabling notifications fails
If enabling the notification fails, receiving data packets is not possible. Instead of silently ignoring this fatal problem and trying to continue, report the error back to the caller. Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
This commit is contained in:
parent
81f35c1ecf
commit
97a76a6615
1 changed files with 6 additions and 0 deletions
|
@ -673,6 +673,12 @@ dc_status_t qt_ble_open(void **io, dc_context_t *, const char *devaddr, device_d
|
|||
|
||||
ble->preferredService()->writeDescriptor(d, QByteArray::fromHex("0100"));
|
||||
WAITFOR(ble->descriptorWritten(), 1000);
|
||||
if (!ble->descriptorWritten()) {
|
||||
qDebug() << "Bluetooth: Failed to enable notifications for characteristic" << c.uuid();
|
||||
report_error("Bluetooth: Failed to enable notifications.");
|
||||
delete ble;
|
||||
return DC_STATUS_TIMEOUT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue