Closed corbinstreehouse closed 8 years ago
Howdy! The code below is wrong; it clearly returns 0 when the in BLUEFRUIT_MODE_DATA, but should return the amount written.
while(size) { size_t len = min(size, SDEP_MAX_PACKETSIZE); size -= len; sendPacket(SDEP_CMDTYPE_BLE_UARTTX, buf, (uint8_t) len, size ? 1 : 0); buf += len; } getResponse(); } return size;
It should be more like this:
if (size > 0) { size_t amountLeft = size; while(amountLeft) { size_t len = min(amountLeft, SDEP_MAX_PACKETSIZE); amountLeft -= len; sendPacket(SDEP_CMDTYPE_BLE_UARTTX, buf, (uint8_t) len, amountLeft ? 1 : 0); buf += len; } getResponse(); } return size;
I fixed it on my branch..but I have tons of other hacks that you probably don't want..
holy cow, that is a stupid mistake thanks for reporting :+1:
Howdy! The code below is wrong; it clearly returns 0 when the in BLUEFRUIT_MODE_DATA, but should return the amount written.
It should be more like this:
I fixed it on my branch..but I have tons of other hacks that you probably don't want..