hci/gap: move set_class_of_device to gap

This commit is contained in:
Matthias Ringwald 2016-03-26 23:14:43 +01:00
parent 4e5dfeb9a4
commit 60b9e82fcb
10 changed files with 18 additions and 15 deletions

View File

@ -334,7 +334,7 @@ int btstack_main(int argc, const char * argv[]){
gap_set_local_name("BTstack HSP AG");
gap_discoverable_control(1);
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
hci_set_class_of_device(0x400204);
gap_set_class_of_device(0x400204);
// turn on!
hci_power_control(HCI_POWER_ON);

View File

@ -343,7 +343,7 @@ int btstack_main(int argc, const char * argv[]){
gap_set_local_name("BTstack HSP HS");
gap_discoverable_control(1);
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
hci_set_class_of_device(0x240404);
gap_set_class_of_device(0x240404);
// turn on!
hci_power_control(HCI_POWER_ON);

View File

@ -128,6 +128,12 @@ gap_connection_type_t gap_get_connection_type(hci_con_handle_t connection_handle
*/
void gap_set_local_name(const char * local_name);
/**
* @brief Set class of device that will be set during Bluetooth init.
* @note has to be done before stack starts up
*/
void gap_set_class_of_device(uint32_t class_of_device);
/**
* @brief Enable/disable bonding. Default is enabled.
* @param enabled

View File

@ -1997,7 +1997,7 @@ void hci_close(void){
hci_stack = NULL;
}
void hci_set_class_of_device(uint32_t class_of_device){
void gap_set_class_of_device(uint32_t class_of_device){
hci_stack->class_of_device = class_of_device;
}

View File

@ -690,11 +690,6 @@ void hci_set_control(const btstack_control_t *hardware_control);
*/
void hci_set_link_key_db(btstack_link_key_db_t const * link_key_db);
/**
* @brief Set class of device that will be set during Bluetooth init.
*/
void hci_set_class_of_device(uint32_t class_of_device);
/**
* @brief Set callback for Bluetooth Hardware Error
*/

View File

@ -761,12 +761,14 @@ int btstack_main(int argc, const char * argv[]){
printf("Starting up..\n");
hci_set_class_of_device(0x220404);
hci_disable_l2cap_timeout_check();
gap_set_class_of_device(0x220404);
gap_ssp_set_io_capability(IO_CAPABILITY_NO_INPUT_NO_OUTPUT);
gap_io_capabilities = "IO_CAPABILITY_NO_INPUT_NO_OUTPUT";
gap_ssp_set_authentication_requirement(0);
gap_ssp_set_auto_accept(0);
update_auth_req();
// register for HCI events

View File

@ -226,7 +226,7 @@ int btstack_main(int argc, const char * argv[]){
sdp_register_service((uint8_t *)hsp_service_buffer);
gap_discoverable_control(1);
hci_set_class_of_device(0x200418);
gap_set_class_of_device(0x200418);
gap_set_local_name("BTstack HSP HS PTS");
btstack_stdin_setup(stdin_process);

View File

@ -87,9 +87,6 @@ static uint8_t hfp_hf_service_buffer[200]; // rfcomm 5
int btstack_main(int argc, const char * argv[]);
int btstack_main(int argc, const char * argv[]){
hci_set_class_of_device(0x220404);
gap_discoverable_control(1);
l2cap_init();
sdp_init();
@ -116,7 +113,9 @@ int btstack_main(int argc, const char * argv[]){
sdp_register_service((uint8_t *)hfp_hf_service_buffer);
// set CoD for all this
hci_set_class_of_device(0x6A0000); // Networking, Capturing, Audio, Telehpony / Misc
gap_set_class_of_device(0x6A0000); // Networking, Capturing, Audio, Telehpony / Misc
gap_discoverable_control(1);
// turn on!
hci_power_control(HCI_POWER_ON);

View File

@ -155,7 +155,7 @@ static int stdin_process(btstack_data_source_t *ds){
int btstack_main(int argc, const char * argv[]);
int btstack_main(int argc, const char * argv[]){
hci_set_class_of_device(0x220404);
gap_set_class_of_device(0x220404);
gap_discoverable_control(1);
/* Register for HCI events */

View File

@ -72,6 +72,7 @@ s/bt_store_24/little_endian_store_24/g
s/bt_store_32/little_endian_store_32/g
s/hci_discoverable_control/gap_discoverable_control/g
s/hci_ssp_set_io_capability/gap_ssp_set_io_capability/g
s/hci_set_class_of_device/gap_set_class_of_device/g
s/le_central_connect/gap_connect/g
s/le_central_connect_cancel/gap_connect_cancel/g
s/le_central_set_scan_parameters/gap_set_scan_parameters/g