l2cap.c (eb7f386b261fdeafef0efb359325d2643a3e14ed) | l2cap.c (4ff786cfeb2543e74cf07b4d076fcaeb2b47e4e1) |
---|---|
1/* 2 * Copyright (C) 2009-2012 by Matthias Ringwald 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 --- 673 unchanged lines hidden (view full) --- 682 break; 683 default: 684 break; 685 } 686 } 687} 688 689uint16_t l2cap_max_mtu(void){ | 1/* 2 * Copyright (C) 2009-2012 by Matthias Ringwald 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 --- 673 unchanged lines hidden (view full) --- 682 break; 683 default: 684 break; 685 } 686 } 687} 688 689uint16_t l2cap_max_mtu(void){ |
690 int classic_acl_length = hci_max_acl_data_packet_length(); 691 if (classic_acl_length == 0) return 0; 692 return classic_acl_length - L2CAP_HEADER_SIZE; | 690 return HCI_ACL_PAYLOAD_SIZE - L2CAP_HEADER_SIZE; |
693} 694 695uint16_t l2cap_max_le_mtu(){ | 691} 692 693uint16_t l2cap_max_le_mtu(){ |
696 int le_acl_length = hci_max_acl_le_data_packet_length(); 697 if (le_acl_length == 0) return 0; 698 return le_acl_length - L2CAP_HEADER_SIZE; | 694 return l2cap_max_mtu(); |
699} 700 701static void l2cap_handle_connection_complete(uint16_t handle, l2cap_channel_t * channel){ 702 if (channel->state == L2CAP_STATE_WAIT_CONNECTION_COMPLETE || channel->state == L2CAP_STATE_WILL_SEND_CREATE_CONNECTION) { 703 log_info("l2cap_handle_connection_complete expected state"); 704 // success, start l2cap handshake 705 channel->handle = handle; 706 channel->local_cid = l2cap_next_local_cid(); --- 811 unchanged lines hidden --- | 695} 696 697static void l2cap_handle_connection_complete(uint16_t handle, l2cap_channel_t * channel){ 698 if (channel->state == L2CAP_STATE_WAIT_CONNECTION_COMPLETE || channel->state == L2CAP_STATE_WILL_SEND_CREATE_CONNECTION) { 699 log_info("l2cap_handle_connection_complete expected state"); 700 // success, start l2cap handshake 701 channel->handle = handle; 702 channel->local_cid = l2cap_next_local_cid(); --- 811 unchanged lines hidden --- |