int btstack_main(int argc, const char * argv[]){ hci_register_packet_handler(packet_handler); // turn on! hci_power_control(HCI_POWER_ON); return 0; }
int btstack_main(int argc, const char * argv[]) { hci_register_packet_handler(packet_handler); // turn on! hci_power_control(HCI_POWER_ON); // go! run_loop_execute(); // happy compiler! return 0; }
void l2cap_init(){ new_credits_blocked = 0; signaling_responses_pending = 0; l2cap_channels = NULL; l2cap_services = NULL; packet_handler = null_packet_handler; // // register callback with HCI // hci_register_packet_handler(&l2cap_packet_handler); hci_connectable_control(0); // no services yet }
void setup(void){ /// GET STARTED with BTstack /// btstack_memory_init(); run_loop_init(RUN_LOOP_POSIX); // use logger: format HCI_DUMP_PACKETLOGGER, HCI_DUMP_BLUEZ or HCI_DUMP_STDOUT hci_dump_open("/tmp/hci_dump.pklg", HCI_DUMP_PACKETLOGGER); // init HCI hci_transport_t * transport = hci_transport_usb_instance(); hci_uart_config_t * config = NULL; bt_control_t * control = NULL; remote_device_db_t * remote_db = (remote_device_db_t *) &remote_device_db_memory; hci_init(transport, config, control, remote_db); hci_register_packet_handler(packet_handler); }
void btstack_libusb_device_base::init() { /// GET STARTED with BTstack /// btstack_memory_init(); run_loop_init(RUN_LOOP_POSIX); hci_dump_open( nullptr, HCI_DUMP_STDOUT ); // init HCI hci_init( hci_transport_usb_instance(), nullptr, nullptr, nullptr ); // handle CTRL-c signal(SIGINT, sigint_handler); // setup app hci_register_packet_handler( &btstack_libusb_device_base::btstack_packet_handler ); hci_connectable_control(0); // no services yet // turn on! hci_power_control(HCI_POWER_ON); // go run_loop_execute(); }
static void gap_le_advertisements_setup(void){ hci_register_packet_handler(handle_hci_event); }