Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 144c4854 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

[20/25] stack::l2cap Use stack::l2cap::get_interface() am: fe338f83 am: 1c5f0bc4

parents 4c1485eb 1c5f0bc4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -877,6 +877,7 @@ cc_test {
        ":TestMockMainShim",
        ":TestMockMainShimEntry",
        ":TestMockStackBtm",
        ":TestMockStackL2capInterface",
        ":TestMockStackMetrics",
        "rfcomm/port_api.cc",
        "rfcomm/port_rfc.cc",
@@ -2095,6 +2096,7 @@ cc_test {
        "l2cap/l2c_link.cc",
        "l2cap/l2c_main.cc",
        "l2cap/l2c_utils.cc",
        "l2cap/l2cap_api.cc",
        "test/stack_l2cap_test.cc",
    ],
    static_libs: [
+1 −8
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include "l2cdefs.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/l2cap_interface.h"
#include "stack/include/l2cap_types.h"
#include "types/bt_transport.h"
#include "types/hci_role.h"
#include "types/raw_address.h"
@@ -97,12 +98,6 @@ typedef uint8_t tL2CAP_CHNL_DATA_RATE;
#define SVC_TYPE_BEST_EFFORT 1
#define SVC_TYPE_GUARANTEED 2

/* Define a structure to hold the configuration parameters. Since the
 * parameters are optional, for each parameter there is a boolean to
 * use to signify its presence or absence.
 */
constexpr uint16_t L2CAP_LE_CREDIT_THRESHOLD = 64;

// This is initial amout of credits we send, and amount to which we increase
// credits once they fall below threshold
uint16_t L2CA_LeCreditDefault();
@@ -136,8 +131,6 @@ typedef void(tL2CA_CONNECT_CFM_CB)(uint16_t, tL2CAP_CONN);
 */
typedef void(tL2CA_CONFIG_IND_CB)(uint16_t, tL2CAP_CFG_INFO*);

constexpr uint16_t L2CAP_INITIATOR_LOCAL = 1;
constexpr uint16_t L2CAP_INITIATOR_REMOTE = 0;
/* Configuration confirm callback prototype. Parameters are
 *              Local CID assigned to the connection
 *              Initiator (1 for local, 0 for remote)
+783 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@

#define LOG_TAG "bt_l2cap"

#include "stack/include/l2c_api.h"
#include "stack/l2cap/internal/l2c_api.h"

#include <base/location.h>
#include <base/strings/stringprintf.h>
@@ -45,7 +45,6 @@
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_psm_types.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/l2c_api.h"
#include "stack/include/main_thread.h"
#include "stack/l2cap/l2c_int.h"
#include "types/raw_address.h"
@@ -55,6 +54,8 @@ using namespace bluetooth;
extern fixed_queue_t* btu_general_alarm_queue;
tL2C_AVDT_CHANNEL_INFO av_media_channels[MAX_ACTIVE_AVDT_CONN];

constexpr uint16_t L2CAP_LE_CREDIT_THRESHOLD = 64;

tBT_TRANSPORT l2c_get_transport_from_fixed_cid(uint16_t fixed_cid) {
  if (fixed_cid >= L2CAP_ATT_CID && fixed_cid <= L2CAP_SMP_CID) {
    return BT_TRANSPORT_LE;
+2 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@
#include "stack/include/btm_status.h"
#include "stack/include/l2c_api.h"
#include "stack/include/l2cap_acl_interface.h"
#include "stack/include/l2cap_interface.h"
#include "stack/include/l2cdefs.h"
#include "stack/include/main_thread.h"
#include "stack/l2cap/l2c_int.h"
@@ -305,7 +306,7 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
      STREAM_TO_UINT16(timeout, p);      /* 0x000A - 0x0C80 */
      /* If we are a central, the peripheral wants to update the parameters */
      if (p_lcb->IsLinkRoleCentral()) {
        L2CA_AdjustConnectionIntervals(
        stack::l2cap::get_interface().L2CA_AdjustConnectionIntervals(
                &min_interval, &max_interval,
                osi_property_get_int32("bluetooth.core.le.min_connection_interval",
                                       BTM_BLE_CONN_INT_MIN_LIMIT));
Loading