main.c (3e05a31cbd503892bcff143e59a77d53aca83151) | main.c (daa2e90cf24e5bf3332f97f7b7b6cedf00b32a36) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 184 unchanged lines hidden (view full) --- 193 194 // init HCI 195 const btstack_uart_block_t * uart_driver = btstack_uart_block_posix_instance(); 196 const hci_transport_t * transport = hci_transport_h5_instance(uart_driver); 197 const btstack_link_key_db_t * link_key_db = btstack_link_key_db_fs_instance(); 198 hci_init(transport, (void*) &config); 199 hci_set_link_key_db(link_key_db); 200 | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 184 unchanged lines hidden (view full) --- 193 194 // init HCI 195 const btstack_uart_block_t * uart_driver = btstack_uart_block_posix_instance(); 196 const hci_transport_t * transport = hci_transport_h5_instance(uart_driver); 197 const btstack_link_key_db_t * link_key_db = btstack_link_key_db_fs_instance(); 198 hci_init(transport, (void*) &config); 199 hci_set_link_key_db(link_key_db); 200 |
201 // enable BCSP mode for CSR chipsets - auto detect might not work 202 // hci_transport_h5_enable_bcsp_mode(); 203 |
|
201 // enable auto-sleep mode 202 // hci_transport_h5_set_auto_sleep(300); 203 204 // register for HCI events 205 hci_event_callback_registration.callback = &packet_handler; 206 hci_add_event_handler(&hci_event_callback_registration); 207 208 // handle CTRL-c 209 signal(SIGINT, sigint_handler); 210 211 // setup app 212 btstack_main(argc, argv); 213 214 // go 215 btstack_run_loop_execute(); 216 217 return 0; 218} | 204 // enable auto-sleep mode 205 // hci_transport_h5_set_auto_sleep(300); 206 207 // register for HCI events 208 hci_event_callback_registration.callback = &packet_handler; 209 hci_add_event_handler(&hci_event_callback_registration); 210 211 // handle CTRL-c 212 signal(SIGINT, sigint_handler); 213 214 // setup app 215 btstack_main(argc, argv); 216 217 // go 218 btstack_run_loop_execute(); 219 220 return 0; 221} |