Loading system/conf/bt_stack.conf +29 −0 Original line number Diff line number Diff line Loading @@ -47,13 +47,39 @@ TRC_HID_DEV=2 # Use EATT for the notifications #PTS_ForceEattForNotifications=true # PTS L2CAP Ecoc upper tester (hijack eatt) #PTS_L2capEcocUpperTester=true # PTS L2CAP initial number of channels #note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocInitialChanCnt=3 # PTS Min key size for L2CAP ECOC upper tester # note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocMinKeySize=16 # PTS Send connect request after connect confirmation # note: PTS_L2capEcocInitialChanCnt shall be less than 5 #PTS_L2capEcocConnectRemaining=true #PTS L2CAP CoC schedule sending data after connection # note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocSendNumOfSdu=2 # Start EATT without validation Server Supported Features # note: PTS_EnableL2capUpperTester shall be true #PTS_ConnectEattUncondictionally=true # Trigger reconfiguration after connection # note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocReconfigure=true # Start EATT on unecrypted link # note: PTS_EnableL2capUpperTester shall be true #PTS_ConnectEattUnencrypted=true # Force EATT implementation to connect EATT as a peripheral for collision test case # note: PTS_EnableL2capUpperTester shall be true #PTS_EattPeripheralCollionSupport=true # Disable BR/EDR discovery after LE pairing to avoid cross key derivation errors Loading @@ -68,6 +94,9 @@ TRC_HID_DEV=2 # Start broadcast with unecryption mode #PTS_BroadcastUnencrypted=true # Use EATT for all services #PTS_UseEattForAllServices=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. Loading system/internal_include/stack_config.h +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,13 @@ typedef struct { bool (*get_pts_connect_eatt_before_encryption)(void); bool (*get_pts_unencrypt_broadcast)(void); bool (*get_pts_eatt_peripheral_collision_support)(void); bool (*get_pts_use_eatt_for_all_services)(void); bool (*get_pts_l2cap_ecoc_upper_tester)(void); int (*get_pts_l2cap_ecoc_min_key_size)(void); int (*get_pts_l2cap_ecoc_initial_chan_cnt)(void); bool (*get_pts_l2cap_ecoc_connect_remaining)(void); int (*get_pts_l2cap_ecoc_send_num_of_sdu)(void); bool (*get_pts_l2cap_ecoc_reconfigure)(void); const std::string* (*get_pts_broadcast_audio_config_options)(void); config_t* (*get_all)(void); } stack_config_t; Loading system/main/stack_config.cc +49 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,13 @@ const char* PTS_CONNECT_EATT_UNENCRYPTED = "PTS_ConnectEattUnencrypted"; const char* PTS_BROADCAST_UNENCRYPTED = "PTS_BroadcastUnencrypted"; const char* PTS_EATT_PERIPHERAL_COLLISION_SUPPORT = "PTS_EattPeripheralCollionSupport"; const char* PTS_EATT_USE_FOR_ALL_SERVICES = "PTS_UseEattForAllServices"; const char* PTS_L2CAP_ECOC_UPPER_TESTER = "PTS_L2capEcocUpperTester"; const char* PTS_L2CAP_ECOC_MIN_KEY_SIZE = "PTS_L2capEcocMinKeySize"; const char* PTS_L2CAP_ECOC_INITIAL_CHAN_CNT = "PTS_L2capEcocInitialChanCnt"; const char* PTS_L2CAP_ECOC_CONNECT_REMAINING = "PTS_L2capEcocConnectRemaining"; const char* PTS_L2CAP_ECOC_SEND_NUM_OF_SDU = "PTS_L2capEcocSendNumOfSdu"; const char* PTS_L2CAP_ECOC_RECONFIGURE = "PTS_L2capEcocReconfigure"; const char* PTS_BROADCAST_AUDIO_CONFIG_OPTION = "PTS_BroadcastAudioConfigOption"; Loading Loading @@ -144,6 +151,41 @@ static bool get_pts_eatt_peripheral_collision_support(void) { PTS_EATT_PERIPHERAL_COLLISION_SUPPORT, false); } static bool get_pts_use_eatt_for_all_services(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_EATT_USE_FOR_ALL_SERVICES, false); } static bool get_pts_l2cap_ecoc_upper_tester(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_UPPER_TESTER, false); } static int get_pts_l2cap_ecoc_min_key_size(void) { return config_get_int(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_MIN_KEY_SIZE, -1); } static int get_pts_l2cap_ecoc_initial_chan_cnt(void) { return config_get_int(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_INITIAL_CHAN_CNT, -1); } static bool get_pts_l2cap_ecoc_connect_remaining(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_CONNECT_REMAINING, false); } static int get_pts_l2cap_ecoc_send_num_of_sdu(void) { return config_get_int(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_SEND_NUM_OF_SDU, -1); } static bool get_pts_l2cap_ecoc_reconfigure(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_RECONFIGURE, false); } static const std::string* get_pts_broadcast_audio_config_options(void) { if (!config) { LOG_INFO("Config isn't ready, use default option"); Loading @@ -167,6 +209,13 @@ const stack_config_t interface = {get_trace_config_enabled, get_pts_connect_eatt_before_encryption, get_pts_unencrypt_broadcast, get_pts_eatt_peripheral_collision_support, get_pts_use_eatt_for_all_services, get_pts_l2cap_ecoc_upper_tester, get_pts_l2cap_ecoc_min_key_size, get_pts_l2cap_ecoc_initial_chan_cnt, get_pts_l2cap_ecoc_connect_remaining, get_pts_l2cap_ecoc_send_num_of_sdu, get_pts_l2cap_ecoc_reconfigure, get_pts_broadcast_audio_config_options, get_all}; Loading system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc +5 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,11 @@ const stack_config_t interface = {nullptr, get_pts_avrcp_test, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; void Callback(uint8_t, bool, std::unique_ptr<::bluetooth::PacketBuilder>) {} Loading system/profile/avrcp/tests/avrcp_device_test.cc +5 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,11 @@ const stack_config_t interface = {nullptr, get_pts_avrcp_test, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; 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 Loading
system/conf/bt_stack.conf +29 −0 Original line number Diff line number Diff line Loading @@ -47,13 +47,39 @@ TRC_HID_DEV=2 # Use EATT for the notifications #PTS_ForceEattForNotifications=true # PTS L2CAP Ecoc upper tester (hijack eatt) #PTS_L2capEcocUpperTester=true # PTS L2CAP initial number of channels #note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocInitialChanCnt=3 # PTS Min key size for L2CAP ECOC upper tester # note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocMinKeySize=16 # PTS Send connect request after connect confirmation # note: PTS_L2capEcocInitialChanCnt shall be less than 5 #PTS_L2capEcocConnectRemaining=true #PTS L2CAP CoC schedule sending data after connection # note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocSendNumOfSdu=2 # Start EATT without validation Server Supported Features # note: PTS_EnableL2capUpperTester shall be true #PTS_ConnectEattUncondictionally=true # Trigger reconfiguration after connection # note: PTS_EnableL2capUpperTester shall be true #PTS_L2capEcocReconfigure=true # Start EATT on unecrypted link # note: PTS_EnableL2capUpperTester shall be true #PTS_ConnectEattUnencrypted=true # Force EATT implementation to connect EATT as a peripheral for collision test case # note: PTS_EnableL2capUpperTester shall be true #PTS_EattPeripheralCollionSupport=true # Disable BR/EDR discovery after LE pairing to avoid cross key derivation errors Loading @@ -68,6 +94,9 @@ TRC_HID_DEV=2 # Start broadcast with unecryption mode #PTS_BroadcastUnencrypted=true # Use EATT for all services #PTS_UseEattForAllServices=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. Loading
system/internal_include/stack_config.h +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,13 @@ typedef struct { bool (*get_pts_connect_eatt_before_encryption)(void); bool (*get_pts_unencrypt_broadcast)(void); bool (*get_pts_eatt_peripheral_collision_support)(void); bool (*get_pts_use_eatt_for_all_services)(void); bool (*get_pts_l2cap_ecoc_upper_tester)(void); int (*get_pts_l2cap_ecoc_min_key_size)(void); int (*get_pts_l2cap_ecoc_initial_chan_cnt)(void); bool (*get_pts_l2cap_ecoc_connect_remaining)(void); int (*get_pts_l2cap_ecoc_send_num_of_sdu)(void); bool (*get_pts_l2cap_ecoc_reconfigure)(void); const std::string* (*get_pts_broadcast_audio_config_options)(void); config_t* (*get_all)(void); } stack_config_t; Loading
system/main/stack_config.cc +49 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,13 @@ const char* PTS_CONNECT_EATT_UNENCRYPTED = "PTS_ConnectEattUnencrypted"; const char* PTS_BROADCAST_UNENCRYPTED = "PTS_BroadcastUnencrypted"; const char* PTS_EATT_PERIPHERAL_COLLISION_SUPPORT = "PTS_EattPeripheralCollionSupport"; const char* PTS_EATT_USE_FOR_ALL_SERVICES = "PTS_UseEattForAllServices"; const char* PTS_L2CAP_ECOC_UPPER_TESTER = "PTS_L2capEcocUpperTester"; const char* PTS_L2CAP_ECOC_MIN_KEY_SIZE = "PTS_L2capEcocMinKeySize"; const char* PTS_L2CAP_ECOC_INITIAL_CHAN_CNT = "PTS_L2capEcocInitialChanCnt"; const char* PTS_L2CAP_ECOC_CONNECT_REMAINING = "PTS_L2capEcocConnectRemaining"; const char* PTS_L2CAP_ECOC_SEND_NUM_OF_SDU = "PTS_L2capEcocSendNumOfSdu"; const char* PTS_L2CAP_ECOC_RECONFIGURE = "PTS_L2capEcocReconfigure"; const char* PTS_BROADCAST_AUDIO_CONFIG_OPTION = "PTS_BroadcastAudioConfigOption"; Loading Loading @@ -144,6 +151,41 @@ static bool get_pts_eatt_peripheral_collision_support(void) { PTS_EATT_PERIPHERAL_COLLISION_SUPPORT, false); } static bool get_pts_use_eatt_for_all_services(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_EATT_USE_FOR_ALL_SERVICES, false); } static bool get_pts_l2cap_ecoc_upper_tester(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_UPPER_TESTER, false); } static int get_pts_l2cap_ecoc_min_key_size(void) { return config_get_int(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_MIN_KEY_SIZE, -1); } static int get_pts_l2cap_ecoc_initial_chan_cnt(void) { return config_get_int(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_INITIAL_CHAN_CNT, -1); } static bool get_pts_l2cap_ecoc_connect_remaining(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_CONNECT_REMAINING, false); } static int get_pts_l2cap_ecoc_send_num_of_sdu(void) { return config_get_int(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_SEND_NUM_OF_SDU, -1); } static bool get_pts_l2cap_ecoc_reconfigure(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_L2CAP_ECOC_RECONFIGURE, false); } static const std::string* get_pts_broadcast_audio_config_options(void) { if (!config) { LOG_INFO("Config isn't ready, use default option"); Loading @@ -167,6 +209,13 @@ const stack_config_t interface = {get_trace_config_enabled, get_pts_connect_eatt_before_encryption, get_pts_unencrypt_broadcast, get_pts_eatt_peripheral_collision_support, get_pts_use_eatt_for_all_services, get_pts_l2cap_ecoc_upper_tester, get_pts_l2cap_ecoc_min_key_size, get_pts_l2cap_ecoc_initial_chan_cnt, get_pts_l2cap_ecoc_connect_remaining, get_pts_l2cap_ecoc_send_num_of_sdu, get_pts_l2cap_ecoc_reconfigure, get_pts_broadcast_audio_config_options, get_all}; Loading
system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc +5 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,11 @@ const stack_config_t interface = {nullptr, get_pts_avrcp_test, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; void Callback(uint8_t, bool, std::unique_ptr<::bluetooth::PacketBuilder>) {} Loading
system/profile/avrcp/tests/avrcp_device_test.cc +5 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,11 @@ const stack_config_t interface = {nullptr, get_pts_avrcp_test, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; 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