bluez: Fix warning

pull/166/head
Olivier Martin 2020-04-08 22:22:23 +02:00 committed by Olivier Martin
parent ddc790358f
commit a8a06114e2
1 changed files with 9 additions and 1 deletions

View File

@ -127,6 +127,10 @@ static int ble_scan(void *adapter, int device_desc, gattlib_discovered_device_t
}
len = read(device_desc, buffer, sizeof(buffer));
if (len < 0) {
fprintf(stderr, "Read error\n");
break;
}
if (meta->subevent != 0x02 || (uint8_t)buffer[BLE_EVENT_TYPE] != BLE_SCAN_RESPONSE)
continue;
@ -142,7 +146,7 @@ static int ble_scan(void *adapter, int device_desc, gattlib_discovered_device_t
int elapsed = time(NULL) - ts;
if (elapsed >= timeout) {
printf("Err2");
fprintf(stderr, "Timeout error\n");
break;
}
@ -162,6 +166,10 @@ static int ble_scan(void *adapter, int device_desc, gattlib_discovered_device_t
}
len = read(device_desc, buffer, sizeof(buffer));
if (len < 0) {
fprintf(stderr, "Read error\n");
break;
}
if (meta->subevent != 0x02 || (uint8_t)buffer[BLE_EVENT_TYPE] != BLE_SCAN_RESPONSE)
continue;