Skip the handshake for BLE communication

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 <berthold.stoeger@tuwien.ac.at>
This commit is contained in:
Jef Driesen 2018-04-13 22:09:38 +02:00
parent 8aef4a49a0
commit b3ebfa0e6e

View File

@ -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)