mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-31 18:33:00 +00:00
examples: unify local names and append BD_ADDR
This commit is contained in:
parent
29af07f3ba
commit
0c2b8870c4
@ -969,8 +969,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
avrcp_controller_create_sdp_record(sdp_avrcp_controller_service_buffer, 0x10001, AVRCP_BROWSING_ENABLED, 1, NULL, NULL);
|
avrcp_controller_create_sdp_record(sdp_avrcp_controller_service_buffer, 0x10001, AVRCP_BROWSING_ENABLED, 1, NULL, NULL);
|
||||||
sdp_register_service(sdp_avrcp_controller_service_buffer);
|
sdp_register_service(sdp_avrcp_controller_service_buffer);
|
||||||
|
|
||||||
|
gap_set_local_name("A2DP Sink Demo 00:00:00:00:00:00");
|
||||||
gap_set_local_name("BTstack A2DP Sink Test");
|
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
gap_set_class_of_device(0x200408);
|
gap_set_class_of_device(0x200408);
|
||||||
printf("sdp, gap done\n");
|
printf("sdp, gap done\n");
|
||||||
|
@ -92,7 +92,7 @@ static const int16_t sine_int16[] = {
|
|||||||
-19260, -17557, -15786, -13952, -12062, -10126, -8149, -6140, -4107, -2057,
|
-19260, -17557, -15786, -13952, -12062, -10126, -8149, -6140, -4107, -2057,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char * device_name = "A2DP Source BTstack";
|
static const char * device_name = "A2DP Source Demo 00:00:00:00:00:00";
|
||||||
|
|
||||||
#ifdef HAVE_BTSTACK_STDIN
|
#ifdef HAVE_BTSTACK_STDIN
|
||||||
// mac 2011: static const char * device_addr_string = "04:0C:CE:E4:85:D3";
|
// mac 2011: static const char * device_addr_string = "04:0C:CE:E4:85:D3";
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
uint8_t hfp_service_buffer[150];
|
uint8_t hfp_service_buffer[150];
|
||||||
const uint8_t rfcomm_channel_nr = 1;
|
const uint8_t rfcomm_channel_nr = 1;
|
||||||
const char hfp_ag_service_name[] = "BTstack HFP AG Test";
|
const char hfp_ag_service_name[] = "HFP AG Demo";
|
||||||
|
|
||||||
static bd_addr_t device_addr;
|
static bd_addr_t device_addr;
|
||||||
static const char * device_addr_string = "00:15:83:5F:9D:46";
|
static const char * device_addr_string = "00:15:83:5F:9D:46";
|
||||||
@ -550,6 +550,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
hci_add_event_handler(&hci_event_callback_registration);
|
hci_add_event_handler(&hci_event_callback_registration);
|
||||||
hci_register_sco_packet_handler(&packet_handler);
|
hci_register_sco_packet_handler(&packet_handler);
|
||||||
|
|
||||||
|
gap_set_local_name("HFP AG Demo 00:00:00:00:00:00");
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
|
|
||||||
// L2CAP
|
// L2CAP
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
uint8_t hfp_service_buffer[150];
|
uint8_t hfp_service_buffer[150];
|
||||||
const uint8_t rfcomm_channel_nr = 1;
|
const uint8_t rfcomm_channel_nr = 1;
|
||||||
const char hfp_hf_service_name[] = "BTstack HFP HF Demo";
|
const char hfp_hf_service_name[] = "HFP HF Demo";
|
||||||
|
|
||||||
#ifdef HAVE_BTSTACK_STDIN
|
#ifdef HAVE_BTSTACK_STDIN
|
||||||
static const char * device_addr_string = "00:1B:DC:08:0A:A5";
|
static const char * device_addr_string = "00:1B:DC:08:0A:A5";
|
||||||
@ -571,6 +571,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
|
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
gap_set_class_of_device(0x200408);
|
gap_set_class_of_device(0x200408);
|
||||||
|
gap_set_local_name("HFP HF Demo 00:00:00:00:00:00");
|
||||||
|
|
||||||
// init L2CAP
|
// init L2CAP
|
||||||
l2cap_init();
|
l2cap_init();
|
||||||
|
@ -342,7 +342,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
|
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
gap_set_class_of_device(0x2540);
|
gap_set_class_of_device(0x2540);
|
||||||
gap_set_local_name(hid_device_name);
|
gap_set_local_name("HID Keyboard Demo 00:00:00:00:00:00");
|
||||||
|
|
||||||
// L2CAP
|
// L2CAP
|
||||||
l2cap_init();
|
l2cap_init();
|
||||||
|
@ -293,7 +293,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
btstack_stdin_setup(stdin_process);
|
btstack_stdin_setup(stdin_process);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gap_set_local_name("BTstack HSP AG");
|
gap_set_local_name("HSP AG Demo 00:00:00:00:00:00");
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
||||||
gap_set_class_of_device(0x400204);
|
gap_set_class_of_device(0x400204);
|
||||||
|
@ -299,7 +299,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
btstack_stdin_setup(stdin_process);
|
btstack_stdin_setup(stdin_process);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gap_set_local_name("BTstack HSP HS");
|
gap_set_local_name("HSP HS Demo 00:00:00:00:00:00");
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
||||||
gap_set_class_of_device(0x240404);
|
gap_set_class_of_device(0x240404);
|
||||||
|
@ -261,7 +261,6 @@ static void heartbeat_handler(struct btstack_timer_source *ts){
|
|||||||
int btstack_main(void);
|
int btstack_main(void);
|
||||||
int btstack_main(void)
|
int btstack_main(void)
|
||||||
{
|
{
|
||||||
gap_discoverable_control(1);
|
|
||||||
|
|
||||||
// register for HCI events
|
// register for HCI events
|
||||||
hci_event_callback_registration.callback = &packet_handler;
|
hci_event_callback_registration.callback = &packet_handler;
|
||||||
@ -279,7 +278,9 @@ int btstack_main(void)
|
|||||||
sdp_register_service(spp_service_buffer);
|
sdp_register_service(spp_service_buffer);
|
||||||
printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
|
printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
|
||||||
|
|
||||||
|
gap_set_local_name("SPP and LE Counter 00:00:00:00:00:00");
|
||||||
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
||||||
|
gap_discoverable_control(1);
|
||||||
|
|
||||||
// setup le device db
|
// setup le device db
|
||||||
le_device_db_init();
|
le_device_db_init();
|
||||||
|
@ -382,6 +382,7 @@ int btstack_main(int argc, const char * argv[])
|
|||||||
sdp_register_service(spp_service_buffer);
|
sdp_register_service(spp_service_buffer);
|
||||||
// printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
|
// printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
|
||||||
|
|
||||||
|
gap_set_local_name("SPP and LE Streamer 00:00:00:00:00:00");
|
||||||
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
||||||
|
|
||||||
// short-cut to find other SPP Streamer
|
// short-cut to find other SPP Streamer
|
||||||
|
@ -256,7 +256,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
|
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
||||||
gap_set_local_name("BTstack SPP Counter");
|
gap_set_local_name("SPP Counter 00:00:00:00:00:00");
|
||||||
|
|
||||||
// turn on!
|
// turn on!
|
||||||
hci_power_control(HCI_POWER_ON);
|
hci_power_control(HCI_POWER_ON);
|
||||||
|
@ -208,7 +208,7 @@ int btstack_main(int argc, const char * argv[]){
|
|||||||
one_shot_timer_setup();
|
one_shot_timer_setup();
|
||||||
|
|
||||||
puts("SPP FlowControl Demo: simulates processing on received data...\n\r");
|
puts("SPP FlowControl Demo: simulates processing on received data...\n\r");
|
||||||
gap_set_local_name("BTstack SPP Flow Control");
|
gap_set_local_name("SPP Flowcontrol 00:00:00:00:00:00");
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
|
|
||||||
// turn on!
|
// turn on!
|
||||||
|
@ -257,11 +257,11 @@ int btstack_main(int argc, const char * argv[])
|
|||||||
sdp_register_service(spp_service_buffer);
|
sdp_register_service(spp_service_buffer);
|
||||||
// printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
|
// printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
|
||||||
|
|
||||||
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
|
||||||
|
|
||||||
// short-cut to find other SPP Streamer
|
// short-cut to find other SPP Streamer
|
||||||
gap_set_class_of_device(TEST_COD);
|
gap_set_class_of_device(TEST_COD);
|
||||||
|
|
||||||
|
gap_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);
|
||||||
|
gap_set_local_name("SPP Streamer 00:00:00:00:00:00");
|
||||||
gap_discoverable_control(1);
|
gap_discoverable_control(1);
|
||||||
|
|
||||||
spp_create_test_data();
|
spp_create_test_data();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user