mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 09:35:42 +00:00
pts: le_data_channel sets up hci connection
This commit is contained in:
parent
6af1053c16
commit
48af0c56d8
@ -1723,7 +1723,7 @@ uint8_t l2cap_le_create_channel(btstack_packet_handler_t packet_handler, bd_addr
|
||||
|
||||
// start connection
|
||||
uint8_t res = gap_auto_connection_start(address_type, address);
|
||||
if (!res){
|
||||
if (res){
|
||||
// discard channel object
|
||||
btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);
|
||||
btstack_memory_l2cap_channel_free(channel);
|
||||
|
@ -184,6 +184,7 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac
|
||||
switch (buffer){
|
||||
case 'a':
|
||||
printf("Creating connection to %s\n", bd_addr_to_str(pts_address));
|
||||
gap_advertisements_enable(0);
|
||||
l2cap_le_create_channel(&app_packet_handler,pts_address, pts_address_type, psm_x, buffer_x, sizeof(buffer_x), 1, LEVEL_0, &cid_x);
|
||||
break;
|
||||
|
||||
@ -219,9 +220,10 @@ int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
btstack_stdin_setup(stdin_process);
|
||||
|
||||
gap_random_address_set_update_period(5000);
|
||||
gap_random_address_set_mode(GAP_RANDOM_ADDRESS_RESOLVABLE);
|
||||
// gap_random_address_set_update_period(5000);
|
||||
// gap_random_address_set_mode(GAP_RANDOM_ADDRESS_RESOLVABLE);
|
||||
gap_advertisements_set_data(sizeof(adv_general_discoverable), adv_general_discoverable);
|
||||
gap_advertisements_enable(1);
|
||||
sm_set_io_capabilities(IO_CAPABILITY_NO_INPUT_NO_OUTPUT);
|
||||
sm_set_authentication_requirements(0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user