mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-15 03:40:42 +00:00
don't return error when write fails, just wait and try again - kudos to Eric for pointing out this flaw
This commit is contained in:
parent
622d0de9a0
commit
b90ae666ea
@ -197,7 +197,8 @@ static int h4_send_packet(uint8_t packet_type, uint8_t * packet, int size){
|
|||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
int bytes_written = write(hci_transport_h4->ds->fd, data, size);
|
int bytes_written = write(hci_transport_h4->ds->fd, data, size);
|
||||||
if (bytes_written < 0) {
|
if (bytes_written < 0) {
|
||||||
return bytes_written;
|
usleep(5000);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
data += bytes_written;
|
data += bytes_written;
|
||||||
size -= bytes_written;
|
size -= bytes_written;
|
||||||
|
@ -179,7 +179,8 @@ static int h5_send_packet(uint8_t packet_type, uint8_t *packet, int size){
|
|||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
int bytes_written = write(hci_transport_h5->ds->fd, data, size);
|
int bytes_written = write(hci_transport_h5->ds->fd, data, size);
|
||||||
if (bytes_written < 0) {
|
if (bytes_written < 0) {
|
||||||
return bytes_written;
|
usleep(5000);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
data += bytes_written;
|
data += bytes_written;
|
||||||
size -= bytes_written;
|
size -= bytes_written;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user