When hci event missed, send tx timeout error 77/213677/1
authorinjun.yang <injun.yang@samsung.com>
Tue, 10 Sep 2019 05:54:56 +0000 (14:54 +0900)
committerinjun.yang <injun.yang@samsung.com>
Tue, 10 Sep 2019 05:54:56 +0000 (14:54 +0900)
Change-Id: I84a677862e82aac4ad280db740d0e535b170870b
Signed-off-by: injun.yang <injun.yang@samsung.com>
src/adapter_le_vsc_features.c

index 518252e..771a88f 100755 (executable)
@@ -39,6 +39,12 @@ static int update_le_address(const bdaddr_t *le_addr)
        if (ret < 0 || status) {
                error("Cannot set random address [ret : %d] / errno : %d", ret, errno);
                hci_close_dev(hdev);
+               if (errno == ETIMEDOUT) {
+                       error("hci vendor command 0x%02x tx timeout", OCF_LE_SET_RANDOM_ADDRESS);
+                       adapter_send_event("TxTimeoutError");
+               } else
+                       adapter_send_event("HardwareError");
+
                return -1;
        }
 
@@ -68,8 +74,14 @@ static int send_vsc_command(uint16_t ocf, uint8_t *cp, uint8_t cp_len,
        rq.rlen   = rp_len;
 
        if (hci_send_req(dd, &rq, 5000) < 0) {
-               error("Fail to send VSC");
+               error("Fail to send VSC  : %s (%d)", strerror(errno), errno);
                hci_close_dev(dd);
+               if (errno == ETIMEDOUT) {
+                       error("hci vendor command 0x%02x tx timeout", ocf);
+                       adapter_send_event("TxTimeoutError");
+               } else
+                       adapter_send_event("HardwareError");
+
                return -1;
        }