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

Commit fb42ad05 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

eatt: Use pts mode to pass some L2CAP test cases

PTS uses EATT for some L2CAP test cases.
Allow to start ECOC just after device got connected.

To enable it use:
PTS_ConnectEattUncondictionally=true

Bug: 236216322
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: I855a9babf6a24284fca46607b767a661e8d30740
parent b5b15083
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ TRC_HID_DEV=2
# Use EATT for the notifications
#PTS_ForceEattForNotifications=true

# Start EATT without validation Server Supported Features
#PTS_ConnectEattUncondictionally=true

# Disable BR/EDR discovery after LE pairing to avoid cross key derivation errors
#PTS_DisableSDPOnLEPair=true

+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ typedef struct {
  const std::string* (*get_pts_smp_options)(void);
  int (*get_pts_smp_failure_case)(void);
  bool (*get_pts_force_eatt_for_notifications)(void);
  bool (*get_pts_connect_eatt_unconditionally)(void);
  config_t* (*get_all)(void);
} stack_config_t;

+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ const char* PTS_DISABLE_SDP_LE_PAIR = "PTS_DisableSDPOnLEPair";
const char* PTS_SMP_PAIRING_OPTIONS_KEY = "PTS_SmpOptions";
const char* PTS_SMP_FAILURE_CASE_KEY = "PTS_SmpFailureCase";
const char* PTS_FORCE_EATT_FOR_NOTIFICATIONS = "PTS_ForceEattForNotifications";
const char* PTS_CONNECT_EATT_UNCONDITIONALLY =
    "PTS_ConnectEattUncondictionally";

static std::unique_ptr<config_t> config;
}  // namespace
@@ -116,6 +118,11 @@ static bool get_pts_force_eatt_for_notifications(void) {
                         PTS_FORCE_EATT_FOR_NOTIFICATIONS, false);
}

static bool get_pts_connect_eatt_unconditionally(void) {
  return config_get_bool(*config, CONFIG_DEFAULT_SECTION,
                         PTS_CONNECT_EATT_UNCONDITIONALLY, false);
}

static config_t* get_all(void) { return config.get(); }

const stack_config_t interface = {get_trace_config_enabled,
@@ -126,6 +133,7 @@ const stack_config_t interface = {get_trace_config_enabled,
                                  get_pts_smp_options,
                                  get_pts_smp_failure_case,
                                  get_pts_force_eatt_for_notifications,
                                  get_pts_connect_eatt_unconditionally,
                                  get_all};

const stack_config_t* stack_config_get_interface(void) { return &interface; }
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ const stack_config_t interface = {nullptr, get_pts_avrcp_test,
                                  nullptr, nullptr,
                                  nullptr, nullptr,
                                  nullptr, nullptr,
                                  nullptr};
                                  nullptr, nullptr};

void Callback(uint8_t, bool, std::unique_ptr<::bluetooth::PacketBuilder>) {}

+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ const stack_config_t interface = {nullptr, get_pts_avrcp_test,
                                  nullptr, nullptr,
                                  nullptr, nullptr,
                                  nullptr, nullptr,
                                  nullptr};
                                  nullptr, nullptr};

// TODO (apanicke): All the tests below are just basic positive unit tests.
// Add more tests to increase code coverage.
Loading