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

Commit 4d19ade5 authored by Patty Huang's avatar Patty Huang Committed by Alice Kuo
Browse files

Use pts flag to create broadcast without encryption

Allow to start broadcast without encrytion.

To enable it use:
PTS_BroadcastUnencrypted=true

Bug: 238151156
Test: atest BluetoothInstrumentationTests
Tag: #feature

Merged-In: Ie7aff67cdca7f25008237f5f50e89502ab81ab77
Change-Id: Ie7aff67cdca7f25008237f5f50e89502ab81ab77
(cherry picked from commit 5508eee1)
parent dda99544
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ TRC_HID_DEV=2
# PTS AVRCP Test mode
#PTS_AvrcpTest=true

# Start broadcast with unecryption mode
#PTS_BroadcastUnencrypted=true

# SMP Certification Failure Cases
# Set any of the following SMP error values (from smp_api_types.h)
# to induce pairing failues for various PTS SMP test cases.
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ typedef struct {
  bool (*get_pts_force_eatt_for_notifications)(void);
  bool (*get_pts_connect_eatt_unconditionally)(void);
  bool (*get_pts_connect_eatt_before_encryption)(void);
  bool (*get_pts_unencrypt_broadcast)(void);
  config_t* (*get_all)(void);
} stack_config_t;

+7 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ const char* PTS_FORCE_EATT_FOR_NOTIFICATIONS = "PTS_ForceEattForNotifications";
const char* PTS_CONNECT_EATT_UNCONDITIONALLY =
    "PTS_ConnectEattUncondictionally";
const char* PTS_CONNECT_EATT_UNENCRYPTED = "PTS_ConnectEattUnencrypted";
const char* PTS_BROADCAST_UNENCRYPTED = "PTS_BroadcastUnencrypted";

static std::unique_ptr<config_t> config;
}  // namespace
@@ -129,6 +130,11 @@ static bool get_pts_connect_eatt_before_encryption(void) {
                         PTS_CONNECT_EATT_UNENCRYPTED, false);
}

static bool get_pts_unencrypt_broadcast(void) {
  return config_get_bool(*config, CONFIG_DEFAULT_SECTION,
                         PTS_BROADCAST_UNENCRYPTED, false);
}

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

const stack_config_t interface = {get_trace_config_enabled,
@@ -141,6 +147,7 @@ const stack_config_t interface = {get_trace_config_enabled,
                                  get_pts_force_eatt_for_notifications,
                                  get_pts_connect_eatt_unconditionally,
                                  get_pts_connect_eatt_before_encryption,
                                  get_pts_unencrypt_broadcast,
                                  get_all};

const stack_config_t* stack_config_get_interface(void) { return &interface; }
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,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
@@ -55,7 +55,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