l2cap.c (0c2bf521da213d00402c5e0dd9d731b3644a0aa8) | l2cap.c (a536dfcc0cc0eb4d5bd5adb4f8c62edc50e38e9a) |
---|---|
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 --- 2042 unchanged lines hidden (view full) --- 2051 if (out_local_cid){ 2052 *out_local_cid = channel->local_cid; 2053 } 2054 2055 // state: L2CAP_STATE_WILL_SEND_CREATE_CONNECTION 2056 2057 // check if hci connection is already usable, 2058 hci_connection_t * conn = hci_connection_for_bd_addr_and_type(address, BD_ADDR_TYPE_ACL); | 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 --- 2042 unchanged lines hidden (view full) --- 2051 if (out_local_cid){ 2052 *out_local_cid = channel->local_cid; 2053 } 2054 2055 // state: L2CAP_STATE_WILL_SEND_CREATE_CONNECTION 2056 2057 // check if hci connection is already usable, 2058 hci_connection_t * conn = hci_connection_for_bd_addr_and_type(address, BD_ADDR_TYPE_ACL); |
2059 if (conn && conn->con_handle != HCI_CON_HANDLE_INVALID){ | 2059 if (conn && conn->state == OPEN){ |
2060 // simulate connection complete 2061 l2cap_handle_connection_complete(conn->con_handle, channel); 2062 2063 // state: L2CAP_STATE_WAIT_REMOTE_SUPPORTED_FEATURES 2064 2065 // check if remote supported features are already received 2066 if (conn->bonding_flags & BONDING_RECEIVED_REMOTE_FEATURES) { 2067 // simulate remote features received --- 2227 unchanged lines hidden --- | 2060 // simulate connection complete 2061 l2cap_handle_connection_complete(conn->con_handle, channel); 2062 2063 // state: L2CAP_STATE_WAIT_REMOTE_SUPPORTED_FEATURES 2064 2065 // check if remote supported features are already received 2066 if (conn->bonding_flags & BONDING_RECEIVED_REMOTE_FEATURES) { 2067 // simulate remote features received --- 2227 unchanged lines hidden --- |