bt_control: remove valid field

This commit is contained in:
Matthias Ringwald 2016-01-22 16:35:02 +01:00
parent 3fb36a2984
commit 289689b72b
5 changed files with 11 additions and 6 deletions

View File

@ -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){

View File

@ -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
}

View File

@ -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
};

View File

@ -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);

View File

@ -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