mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-14 00:40:57 +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) {
|
||||
int bytes_written = write(hci_transport_h4->ds->fd, data, size);
|
||||
if (bytes_written < 0) {
|
||||
return bytes_written;
|
||||
usleep(5000);
|
||||
continue;
|
||||
}
|
||||
data += 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) {
|
||||
int bytes_written = write(hci_transport_h5->ds->fd, data, size);
|
||||
if (bytes_written < 0) {
|
||||
return bytes_written;
|
||||
usleep(5000);
|
||||
continue;
|
||||
}
|
||||
data += bytes_written;
|
||||
size -= bytes_written;
|
||||
|
Loading…
x
Reference in New Issue
Block a user