mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-08 12:50:52 +00:00
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
// *****************************************************************************
|
|
//
|
|
// minimal setup for HCI code
|
|
//
|
|
// *****************************************************************************
|
|
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "btstack-config.h"
|
|
|
|
#include <btstack/run_loop.h>
|
|
|
|
#include "debug.h"
|
|
#include "btstack_memory.h"
|
|
#include "hci.h"
|
|
#include "hci_dump.h"
|
|
|
|
int btstack_main(int argc, const char * argv[]);
|
|
|
|
int main(int argc, const char * argv[]){
|
|
|
|
/// 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);
|
|
|
|
btstack_main(argc, argv);
|
|
|
|
return 0;
|
|
}
|