From b3ebfa0e6e69efbbe04538c8931ccc906d4b0ca7 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 13 Apr 2018 22:09:38 +0200 Subject: [PATCH] Skip the handshake for BLE communication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Scubapro LogTrak application doesn't send the handshake commands for BLE communication. Also the Aladin Sport Matrix, which supports only BLE, responds with a 0x01 byte instead of the expected 0x01 byte and that causes the handshaking to fail. Thus simply omit the handshaking for BLE communication. Reported-by: Berthold Stöger --- src/uwatec_smart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/uwatec_smart.c b/src/uwatec_smart.c index 47e8000..c3e66b1 100644 --- a/src/uwatec_smart.c +++ b/src/uwatec_smart.c @@ -382,6 +382,10 @@ uwatec_smart_handshake (uwatec_smart_device_t *device) const unsigned char params[] = {0x10, 0x27, 0, 0}; unsigned char answer[1] = {0}; + // Skip the handshake for BLE communication. + if (dc_iostream_get_transport (device->iostream) == DC_TRANSPORT_BLE) + return DC_STATUS_SUCCESS; + // Handshake (stage 1). dc_status_t rc = uwatec_smart_transfer (device, CMD_HANDSHAKE1, NULL, 0, answer, sizeof(answer)); if (rc != DC_STATUS_SUCCESS)