l2cap.c (bbc80a48cd3e8446adbd88810be85e4051af78dc) l2cap.c (b4eb44208c0f004b1854916fa565b0e565f94ef8)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 1447 unchanged lines hidden (view full) ---

1456 break;
1457
1458 case L2CAP_STATE_WILL_SEND_CREATE_CONNECTION:
1459 if (!hci_can_send_command_packet_now()) break;
1460 // send connection request - set state first
1461 channel->state = L2CAP_STATE_WAIT_CONNECTION_COMPLETE;
1462 // BD_ADDR, Packet_Type, Page_Scan_Repetition_Mode, Reserved, Clock_Offset, Allow_Role_Switch
1463 (void)memcpy(l2cap_outgoing_classic_addr, channel->address, 6);
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 1447 unchanged lines hidden (view full) ---

1456 break;
1457
1458 case L2CAP_STATE_WILL_SEND_CREATE_CONNECTION:
1459 if (!hci_can_send_command_packet_now()) break;
1460 // send connection request - set state first
1461 channel->state = L2CAP_STATE_WAIT_CONNECTION_COMPLETE;
1462 // BD_ADDR, Packet_Type, Page_Scan_Repetition_Mode, Reserved, Clock_Offset, Allow_Role_Switch
1463 (void)memcpy(l2cap_outgoing_classic_addr, channel->address, 6);
1464 hci_send_cmd(&hci_create_connection, channel->address, hci_usable_acl_packet_types(), 0, 0, 0, 1);
1464 hci_send_cmd(&hci_create_connection, channel->address, hci_usable_acl_packet_types(), 0, 0, 0, hci_get_allow_role_switch());
1465 break;
1466
1467 case L2CAP_STATE_WILL_SEND_CONNECTION_RESPONSE_DECLINE:
1468 if (!hci_can_send_acl_packet_now(channel->con_handle)) break;
1469 channel->state = L2CAP_STATE_INVALID;
1470 l2cap_send_signaling_packet(channel->con_handle, CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->remote_cid, channel->reason, 0);
1471 // discard channel - l2cap_finialize_channel_close without sending l2cap close event
1472 btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);

--- 2613 unchanged lines hidden ---
1465 break;
1466
1467 case L2CAP_STATE_WILL_SEND_CONNECTION_RESPONSE_DECLINE:
1468 if (!hci_can_send_acl_packet_now(channel->con_handle)) break;
1469 channel->state = L2CAP_STATE_INVALID;
1470 l2cap_send_signaling_packet(channel->con_handle, CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->remote_cid, channel->reason, 0);
1471 // discard channel - l2cap_finialize_channel_close without sending l2cap close event
1472 btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);

--- 2613 unchanged lines hidden ---