BLE download: EON Steel doesn't want to loop over reads

This seems a bit brutal, but it does the trick and makes EON Steel
downloads work again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-07-04 09:30:02 -07:00
parent 8a1f5b9566
commit a4bb61b58a

View file

@ -24,6 +24,7 @@
#define IS_HW(_d) same_string((_d)->vendor, "Heinrichs Weikamp")
#define IS_SHEARWATER(_d) same_string((_d)->vendor, "Shearwater")
#define IS_EON_STEEL(_d) same_string((_d)->product, "EON Steel")
extern "C" {
@ -205,9 +206,13 @@ dc_status_t BLEObject::read(void *data, size_t size, size_t *actual)
memcpy((char *)data + offset, packet.data(), packet.size());
offset += packet.size();
*actual += packet.size();
// EON Steel wants to read only one packet at a time
if (IS_EON_STEEL(device))
goto we_are_done;
}
waitFor(50); // and process some Qt events to see if there is more data coming in.
}
we_are_done:
return DC_STATUS_SUCCESS;
}