# SMP Pair options (formatted as hex bytes) auth, io, ikey, rkey, ksize
#PTS_SmpOptions=0xD,0x4,0xf,0xf,0x10
+# PTS AVRCP Test mode
+#PTS_AvrcpTest=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.
typedef struct {
bool (*get_trace_config_enabled)(void);
+ bool (*get_pts_avrcp_test)(void);
bool (*get_pts_secure_only_mode)(void);
bool (*get_pts_conn_updates_disabled)(void);
bool (*get_pts_crosskey_sdp_disable)(void);
namespace {
const char* TRACE_CONFIG_ENABLED_KEY = "TraceConf";
+const char* PTS_AVRCP_TEST = "PTS_AvrcpTest";
const char* PTS_SECURE_ONLY_MODE = "PTS_SecurePairOnly";
const char* PTS_LE_CONN_UPDATED_DISABLED = "PTS_DisableConnUpdates";
const char* PTS_DISABLE_SDP_LE_PAIR = "PTS_DisableSDPOnLEPair";
TRACE_CONFIG_ENABLED_KEY, false);
}
+static bool get_pts_avrcp_test(void) {
+ return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_AVRCP_TEST,
+ false);
+}
+
static bool get_pts_secure_only_mode(void) {
return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_SECURE_ONLY_MODE,
false);
static config_t* get_all(void) { return config.get(); }
-const stack_config_t interface = {get_trace_config_enabled,
- get_pts_secure_only_mode,
- get_pts_conn_updates_disabled,
- get_pts_crosskey_sdp_disable,
- get_pts_smp_options,
- get_pts_smp_failure_case,
- get_all};
+const stack_config_t interface = {
+ get_trace_config_enabled, get_pts_avrcp_test,
+ get_pts_secure_only_mode, get_pts_conn_updates_disabled,
+ get_pts_crosskey_sdp_disable, get_pts_smp_options,
+ get_pts_smp_failure_case, get_all};
const stack_config_t* stack_config_get_interface(void) { return &interface; }
host_supported: true,
include_dirs: [
"system/bt",
+ "system/bt/btcore/include",
"system/bt/internal_include",
"system/bt/stack/include",
],
host_supported: true,
include_dirs: [
"system/bt",
+ "system/bt/btcore/include",
"system/bt/internal_include",
"system/bt/stack/include",
],
#include "connection_handler.h"
#include "device.h"
+#include "stack_config.h"
namespace bluetooth {
namespace avrcp {
if (curr_song_id == "") {
DEVICE_LOG(WARNING) << "Empty media ID";
uid = 0;
+ if (stack_config_get_interface()->get_pts_avrcp_test()) {
+ DEVICE_LOG(WARNING) << __func__ << ": pts test mode";
+ uid = 0xffffffffffffffff;
+ }
}
auto response = RegisterNotificationResponseBuilder::MakeTrackChangedBuilder(
#include "avrcp_packet.h"
#include "avrcp_test_helper.h"
#include "device.h"
+#include "stack_config.h"
#include "tests/avrcp/avrcp_test_packets.h"
#include "tests/packet_test_helper.h"
using ::testing::NiceMock;
using ::testing::Return;
+bool get_pts_avrcp_test(void) { return false; }
+
+const stack_config_t interface = {
+ nullptr, get_pts_avrcp_test, 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.
class AvrcpDeviceTest : public ::testing::Test {
} // namespace avrcp
} // namespace bluetooth
+
+const stack_config_t* stack_config_get_interface(void) {
+ return &bluetooth::avrcp::interface;
+}