From 289689b72bf37be01d43e79ec559dc0d53917e1c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 22 Jan 2016 16:35:02 +0100 Subject: [PATCH] bt_control: remove valid field --- port/arduino/BTstack.cpp | 2 +- port/ios/src/bt_control_iphone.h | 1 + port/ios/src/bt_control_iphone.m | 3 +-- port/pic32-harmony/src/btstack_port.c | 3 +-- src/btstack_control.h | 8 +++++++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/port/arduino/BTstack.cpp b/port/arduino/BTstack.cpp index b2cde5fa7..af88478d1 100644 --- a/port/arduino/BTstack.cpp +++ b/port/arduino/BTstack.cpp @@ -749,7 +749,7 @@ void BTstackManager::setup(void){ btstack_run_loop_init(btstack_run_loop_embedded_get_instance()); hci_transport_t * transport = hci_transport_h4_instance(); - hci_init(transport, NULL, control, NULL); + hci_init(transport, NULL, NULL, NULL); hci_set_chipset(btstack_chipset_em9301_instance()); if (have_custom_addr){ diff --git a/port/ios/src/bt_control_iphone.h b/port/ios/src/bt_control_iphone.h index f459b14ff..637d7c92c 100644 --- a/port/ios/src/bt_control_iphone.h +++ b/port/ios/src/bt_control_iphone.h @@ -59,6 +59,7 @@ int iphone_system_bt_enabled(void); void iphone_system_bt_set_enabled(int enabled); int iphone_system_has_csr(void); +int iphone_system_is_valid(void); #if defined __cplusplus } diff --git a/port/ios/src/bt_control_iphone.m b/port/ios/src/bt_control_iphone.m index b7c0d3b49..ae9c58595 100644 --- a/port/ios/src/bt_control_iphone.m +++ b/port/ios/src/bt_control_iphone.m @@ -174,7 +174,7 @@ static char *get_machine_name(void){ /** * on iPhone/iPod touch */ -static int iphone_valid(void *config){ +int iphone_system_is_valid(void *config){ char * machine = get_machine_name(); if (!strncmp("iPod1", machine, strlen("iPod1"))) return 0; // 1st gen touch no BT return 1; @@ -760,7 +760,6 @@ bt_control_t bt_control_iphone = { .off = iphone_off, .sleep = iphone_sleep, .wake = iphone_wake, - .valid = iphone_valid, .name = iphone_name, .register_for_power_notifications = iphone_register_for_power_notifications }; diff --git a/port/pic32-harmony/src/btstack_port.c b/port/pic32-harmony/src/btstack_port.c index 760ddbbe1..391d1ceb3 100644 --- a/port/pic32-harmony/src/btstack_port.c +++ b/port/pic32-harmony/src/btstack_port.c @@ -226,8 +226,7 @@ void BTSTACK_Initialize ( void ) hci_dump_open(NULL, HCI_DUMP_STDOUT); hci_transport_t * transport = hci_transport_h4_instance(); - bt_control_t * control = bt_control_csr_instance(); - hci_init(transport, &config, control, NULL); + hci_init(transport, &config, NULL, NULL); hci_set_chipset(btstack_chipset_csr_instance()); // hci_power_control(HCI_POWER_ON); diff --git a/src/btstack_control.h b/src/btstack_control.h index 4758ff224..f10d73574 100644 --- a/src/btstack_control.h +++ b/src/btstack_control.h @@ -64,10 +64,16 @@ typedef struct { int (*off) (void *config); // <-- turn BT module off int (*sleep)(void *config); // <-- put BT module to sleep - only to be called after ON int (*wake) (void *config); // <-- wake BT module from sleep - only to be called after SLEEP - int (*valid)(void *config); // <-- test if hardware can be supported + + // check what it is needed for const char * (*name) (void *config); // <-- return hardware name + + // stays void (*register_for_power_notifications)(void (*cb)(POWER_NOTIFICATION_t event)); + + // move to hci.h void (*hw_error)(void); + } bt_control_t; #if defined __cplusplus