diff --git a/example/gap_le_advertisements.c b/example/gap_le_advertisements.c index 89656ce76..1322dccf8 100644 --- a/example/gap_le_advertisements.c +++ b/example/gap_le_advertisements.c @@ -72,6 +72,7 @@ static void gap_le_advertisements_setup(void){ hci_add_event_handler(&hci_event_callback_registration); // Active scanning, 100% (scan interval = scan window) gap_set_scan_parameters(1,48,48); + gap_start_scan(); } /* LISTING_END */ @@ -241,14 +242,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe if (packet_type != HCI_EVENT_PACKET) return; switch (hci_event_packet_get_type(packet)) { - case BTSTACK_EVENT_STATE: - // BTstack activated, get started - if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){ - printf("Start scaning!\n"); - gap_set_scan_parameters(0,0x0030, 0x0030); - gap_start_scan(); - } - break; case GAP_EVENT_ADVERTISING_REPORT:{ bd_addr_t address; gap_event_advertising_report_get_address(packet, address); @@ -281,4 +274,4 @@ int btstack_main(void) return 0; } -/* EXAMPLE_END */ \ No newline at end of file +/* EXAMPLE_END */