, BT_UNIT_TEST_FUNCTION_LE_DEVICE_DATA_LENGTH_CHANGED_CB},
{"Select this menu to set parameters and then select the function again."
, BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
+ {"bt_device_set_profile_trusted_A2DP(true)"
+ , BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_A2DP_TRUE},
+ {"bt_device_set_profile_trusted_A2DP(false)"
+ , BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_A2DP_FALSE},
+ {"bt_device_set_profile_trusted_HFP_HF(true)"
+ , BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_HFP_TRUE},
+ {"bt_device_set_profile_trusted_HFP_HF(false)"
+ , BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_HFP_FALSE},
+ {"bt_device_set_trusted_profile_cb"
+ , BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_CB},
+ {"bt_device_unset_trusted_profile_cb"
+ , BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_PROFILE_TRUSTED_CB},
{NULL , 0x0000},
};
TC_PRT("address: %s", remote_address);
}
+void __bt_device_profile_trusted_cb(int result, char *remote_address,
+ int trusted_profile, bool supported,
+ bool trusted, void *user_data)
+{
+ TC_PRT("result [%s]", __bt_get_error_message(result));
+ TC_PRT("trusted profile [%d]", trusted_profile);
+ TC_PRT("Is supported [%d]", supported);
+ TC_PRT("Is trusted [%d]", trusted);
+ TC_PRT("address: %s", remote_address);
+}
+
void __bt_device_connection_state_changed_cb(bool connected,
bt_device_connection_info_s *conn_info, void *user_data)
{
case BT_UNIT_TEST_TABLE_DEVICE: {
switch (test_id) {
+ case BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_A2DP_TRUE: {
+ ret = bt_device_set_profile_trusted(remote_addr, BT_TRUSTED_PROFILE_A2DP, TRUE);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
+ case BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_A2DP_FALSE: {
+ ret = bt_device_set_profile_trusted(remote_addr, BT_TRUSTED_PROFILE_A2DP, FALSE);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
+ case BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_HFP_TRUE: {
+ ret = bt_device_set_profile_trusted(remote_addr, BT_TRUSTED_PROFILE_HFP_HF, TRUE);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
+ case BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_HFP_FALSE: {
+ ret = bt_device_set_profile_trusted(remote_addr, BT_TRUSTED_PROFILE_HFP_HF, FALSE);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
+ case BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_CB:
+ ret = bt_device_set_trusted_profile_cb(
+ __bt_device_profile_trusted_cb, NULL);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ case BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_PROFILE_TRUSTED_CB:
+ ret = bt_device_unset_trusted_profile_cb();
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
case BT_UNIT_TEST_FUNCTION_DEVICE_SET_AUTHORIZATION_TRUE: {
ret = bt_device_set_authorization(remote_addr, BT_DEVICE_AUTHORIZED);
TC_PRT("returns %s\n", __bt_get_error_message(ret));
BT_UNIT_TEST_FUNCTION_DEVICE_GET_ATT_MTU,
BT_UNIT_TEST_FUNCTION_LE_DEVICE_SET_DATA_LENGTH,
BT_UNIT_TEST_FUNCTION_LE_DEVICE_DATA_LENGTH_CHANGED_CB,
+ BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_A2DP_TRUE,
+ BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_A2DP_FALSE,
+ BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_HFP_TRUE,
+ BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_HFP_FALSE,
+ BT_UNIT_TEST_FUNCTION_DEVICE_SET_PROFILE_TRUSTED_CB,
+ BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_PROFILE_TRUSTED_CB,
BT_UNIT_TEST_FUNCTION_SOCKET_CREATE_RFCOMM = 1,
BT_UNIT_TEST_FUNCTION_SOCKET_DESTROY_RFCOMM,
BT_UNIT_TEST_FUNCTION_SOCKET_LISTEN_AND_ACCEPT_RFCOMM,