fix: new pair

(cherry picked from commit 30e11f0f76fff6035fd36908662c87ba55abdef7)
This commit is contained in:
awalol
2026-05-13 16:19:07 +08:00
parent 9c668a73e4
commit 897beedeac
+4 -5
View File
@@ -162,12 +162,9 @@ static void hci_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
break;
}
case GAP_EVENT_INQUIRY_COMPLETE: {
printf("[HCI] GAP Inquiry complete.\n");
break;
}
case GAP_EVENT_INQUIRY_COMPLETE:
case HCI_EVENT_INQUIRY_COMPLETE: {
printf("[HCI] HCI Inquiry complete.\n");
printf("[HCI] Inquiry complete.\n");
if (device_found) {
printf("[HCI] Connecting to %s...\n", bd_addr_to_str(current_device_addr));
new_pair = true;
@@ -175,10 +172,12 @@ static void hci_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
hci_usable_acl_packet_types(), 0, 0, 0, 1);
break;
}
if (event_type == HCI_EVENT_INQUIRY_COMPLETE) {
printf("[HCI] Restart inquiry\n");
gap_inquiry_start(30);
gap_connectable_control(1);
gap_discoverable_control(1);
}
break;
}
case HCI_EVENT_COMMAND_STATUS: {