Lines Matching +full:read +full:- +full:cmd
2 * Copyright (c) 2019 - 2021 Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
97 FAIL("Player Name read failed (%d)\n", err); in mcc_read_player_name_cb()
107 FAIL("Icon Object ID read failed (%d)", err); in mcc_read_icon_obj_id_cb()
118 FAIL("Icon URL read failed (%d)", err); in mcc_read_icon_url_cb()
138 FAIL("Track title read failed (%d)", err); in mcc_read_track_title_cb()
148 FAIL("Track duration read failed (%d)", err); in mcc_read_track_duration_cb()
158 FAIL("Track position read failed (%d)", err); in mcc_read_track_position_cb()
181 FAIL("Playback speed read failed (%d)", err); in mcc_read_playback_speed_cb()
204 FAIL("Seeking speed read failed (%d)", err); in mcc_read_seeking_speed_cb()
215 FAIL("Track Segments ID read failed (%d)\n", err); in mcc_read_segments_obj_id_cb()
227 FAIL("Current Track Object ID read failed (%d)\n", err); in mcc_read_current_track_obj_id_cb()
251 FAIL("Next Track Object ID read failed (%d)\n", err); in mcc_read_next_track_obj_id_cb()
275 FAIL("Current Group Object ID read failed (%d)\n", err); in mcc_read_current_group_obj_id_cb()
299 FAIL("Parent Group Object ID read failed (%d)\n", err); in mcc_read_parent_group_obj_id_cb()
310 FAIL("Playing order read failed (%d)", err); in mcc_read_playing_order_cb()
333 FAIL("Playing orders supported read failed (%d)", err); in mcc_read_playing_orders_supported_cb()
343 FAIL("Media State read failed (%d)", err); in mcc_read_media_state_cb()
351 static void mcc_send_command_cb(struct bt_conn *conn, int err, const struct mpl_cmd *cmd) in mcc_send_command_cb() argument
354 FAIL("Command send failed (%d) - opcode: %u, param: %d", in mcc_send_command_cb()
355 err, cmd->opcode, cmd->param); in mcc_send_command_cb()
365 FAIL("Command notification error (%d) - opcode: %u, result: %u", in mcc_cmd_ntf_cb()
366 err, ntf->requested_opcode, ntf->result_code); in mcc_cmd_ntf_cb()
370 g_command_result = ntf->result_code; in mcc_cmd_ntf_cb()
378 FAIL("Media State read failed (%d)", err); in mcc_read_opcodes_supported_cb()
413 FAIL("Search Results Object ID read failed (%d)", err); in mcc_read_search_results_obj_id_cb()
424 FAIL("Content control ID read failed (%d)", err); in mcc_read_content_control_id_cb()
477 FAIL("Current Track Object read failed (%d)", err); in mcc_otc_read_current_track_object_cb()
488 FAIL("Next Track Object read failed (%d)", err); in mcc_otc_read_next_track_object_cb()
499 FAIL("Parent Group Object read failed (%d)", err); in mcc_otc_read_parent_group_object_cb()
510 FAIL("Current Group Object read failed (%d)", err); in mcc_otc_read_current_group_object_cb()
564 /* Helper function - select object and read the object metadata
566 * Will FAIL the test on errors calling select and read metadata.
570 * @param object_id ID of the object to select and read metadata for
590 invalid_id = BT_OTS_OBJ_ID_MIN - 1; in test_select_obj_id()
637 FAIL("Failed to read object metadata\n"); in test_read_object_meta()
645 /* Helper function to read the media state and verify that it is as expected
659 FAIL("Failed to read media state: %d", err); in test_verify_media_state_wait_flags()
688 FAIL("Failed to read supported opcodes: %d", err); in test_read_supported_opcodes()
693 printk("Supported opcodes read succeeded\n"); in test_read_supported_opcodes()
701 struct mpl_cmd cmd = { 0 }; in test_invalid_send_cmd() local
704 err = bt_mcc_send_cmd(NULL, &cmd); in test_invalid_send_cmd()
712 FAIL("bt_mcc_send_cmd did not fail with NULL cmd"); in test_invalid_send_cmd()
716 cmd.opcode = 0; /* Invalid opcode */ in test_invalid_send_cmd()
718 err = bt_mcc_send_cmd(default_conn, &cmd); in test_invalid_send_cmd()
720 FAIL("bt_mcc_send_cmd did not fail with invalid opcode %u", cmd.opcode); in test_invalid_send_cmd()
724 cmd.opcode = 0x80; /* Invalid opcode */ in test_invalid_send_cmd()
726 err = bt_mcc_send_cmd(default_conn, &cmd); in test_invalid_send_cmd()
728 FAIL("bt_mcc_send_cmd did not fail with invalid opcode %u", cmd.opcode); in test_invalid_send_cmd()
738 static void test_send_cmd_wait_flags(struct mpl_cmd *cmd) in test_send_cmd_wait_flags() argument
749 err = bt_mcc_send_cmd(default_conn, cmd); in test_send_cmd_wait_flags()
752 err, cmd->opcode); in test_send_cmd_wait_flags()
762 struct mpl_cmd cmd; in test_cp_play() local
764 cmd.opcode = BT_MCS_OPC_PLAY; in test_cp_play()
765 cmd.use_param = false; in test_cp_play()
767 test_send_cmd_wait_flags(&cmd); in test_cp_play()
781 struct mpl_cmd cmd; in test_cp_pause() local
783 cmd.opcode = BT_MCS_OPC_PAUSE; in test_cp_pause()
784 cmd.use_param = false; in test_cp_pause()
786 test_send_cmd_wait_flags(&cmd); in test_cp_pause()
801 struct mpl_cmd cmd; in test_cp_fast_rewind() local
803 cmd.opcode = BT_MCS_OPC_FAST_REWIND; in test_cp_fast_rewind()
804 cmd.use_param = false; in test_cp_fast_rewind()
808 test_send_cmd_wait_flags(&cmd); in test_cp_fast_rewind()
830 struct mpl_cmd cmd; in test_cp_fast_forward() local
832 cmd.opcode = BT_MCS_OPC_FAST_FORWARD; in test_cp_fast_forward()
833 cmd.use_param = false; in test_cp_fast_forward()
837 test_send_cmd_wait_flags(&cmd); in test_cp_fast_forward()
858 struct mpl_cmd cmd; in test_cp_stop() local
860 cmd.opcode = BT_MCS_OPC_STOP; in test_cp_stop()
861 cmd.use_param = false; in test_cp_stop()
863 test_send_cmd_wait_flags(&cmd); in test_cp_stop()
870 /* There is no "STOPPED" state in the spec - STOP goes to PAUSED */ in test_cp_stop()
879 struct mpl_cmd cmd; in test_cp_move_relative() local
889 FAIL("Failed to read track position: %d\n", err); in test_cp_move_relative()
896 cmd.opcode = BT_MCS_OPC_MOVE_RELATIVE; in test_cp_move_relative()
897 cmd.use_param = true; in test_cp_move_relative()
898 cmd.param = 1000; /* Position change, measured in 1/100 of a second */ in test_cp_move_relative()
900 test_send_cmd_wait_flags(&cmd); in test_cp_move_relative()
910 FAIL("Failed to read track position: %d\n", err); in test_cp_move_relative()
926 struct mpl_cmd cmd; in test_cp_prev_segment() local
941 cmd.opcode = BT_MCS_OPC_PREV_SEGMENT; in test_cp_prev_segment()
942 cmd.use_param = false; in test_cp_prev_segment()
944 test_send_cmd_wait_flags(&cmd); in test_cp_prev_segment()
956 struct mpl_cmd cmd; in test_cp_next_segment() local
958 cmd.opcode = BT_MCS_OPC_NEXT_SEGMENT; in test_cp_next_segment()
959 cmd.use_param = false; in test_cp_next_segment()
961 test_send_cmd_wait_flags(&cmd); in test_cp_next_segment()
973 struct mpl_cmd cmd; in test_cp_first_segment() local
975 cmd.opcode = BT_MCS_OPC_FIRST_SEGMENT; in test_cp_first_segment()
976 cmd.use_param = false; in test_cp_first_segment()
978 test_send_cmd_wait_flags(&cmd); in test_cp_first_segment()
990 struct mpl_cmd cmd; in test_cp_last_segment() local
992 cmd.opcode = BT_MCS_OPC_LAST_SEGMENT; in test_cp_last_segment()
993 cmd.use_param = false; in test_cp_last_segment()
995 test_send_cmd_wait_flags(&cmd); in test_cp_last_segment()
1007 struct mpl_cmd cmd; in test_cp_goto_segment() local
1009 cmd.opcode = BT_MCS_OPC_GOTO_SEGMENT; in test_cp_goto_segment()
1010 cmd.use_param = true; in test_cp_goto_segment()
1011 cmd.param = 2; /* Second segment - not the first, maybe not last */ in test_cp_goto_segment()
1013 test_send_cmd_wait_flags(&cmd); in test_cp_goto_segment()
1023 /* Helper function to read the current track object ID, including flag handling
1025 * Will WAIT until the read is completed (object ID flag read flag is set)
1034 FAIL("Failed to read current track object ID: %d", err); in test_read_current_track_object_id_wait_flags()
1044 struct mpl_cmd cmd; in test_cp_prev_track() local
1054 cmd.opcode = BT_MCS_OPC_PREV_TRACK; in test_cp_prev_track()
1055 cmd.use_param = false; in test_cp_prev_track()
1060 test_send_cmd_wait_flags(&cmd); in test_cp_prev_track()
1081 struct mpl_cmd cmd; in test_cp_next_track_and_track_changed() local
1086 cmd.opcode = BT_MCS_OPC_NEXT_TRACK; in test_cp_next_track_and_track_changed()
1087 cmd.use_param = false; in test_cp_next_track_and_track_changed()
1092 test_send_cmd_wait_flags(&cmd); in test_cp_next_track_and_track_changed()
1115 struct mpl_cmd cmd; in test_cp_first_track() local
1117 cmd.opcode = BT_MCS_OPC_FIRST_TRACK; in test_cp_first_track()
1118 cmd.use_param = false; in test_cp_first_track()
1123 test_send_cmd_wait_flags(&cmd); in test_cp_first_track()
1143 struct mpl_cmd cmd; in test_cp_last_track() local
1145 cmd.opcode = BT_MCS_OPC_LAST_TRACK; in test_cp_last_track()
1146 cmd.use_param = false; in test_cp_last_track()
1151 test_send_cmd_wait_flags(&cmd); in test_cp_last_track()
1171 struct mpl_cmd cmd; in test_cp_goto_track() local
1173 cmd.opcode = BT_MCS_OPC_GOTO_TRACK; in test_cp_goto_track()
1174 cmd.use_param = true; in test_cp_goto_track()
1175 cmd.param = 2; /* Second track, not the first, maybe not the last */ in test_cp_goto_track()
1180 test_send_cmd_wait_flags(&cmd); in test_cp_goto_track()
1197 /* Helper function to read the current group object ID, including flag handling
1199 * Will WAIT until the read is completed (object ID flag read flag is set)
1208 FAIL("Failed to read current group object ID: %d", err); in test_read_current_group_object_id_wait_flags()
1218 struct mpl_cmd cmd; in test_cp_prev_group() local
1228 cmd.opcode = BT_MCS_OPC_PREV_GROUP; in test_cp_prev_group()
1229 cmd.use_param = false; in test_cp_prev_group()
1234 test_send_cmd_wait_flags(&cmd); in test_cp_prev_group()
1255 struct mpl_cmd cmd; in test_cp_next_group() local
1257 cmd.opcode = BT_MCS_OPC_NEXT_GROUP; in test_cp_next_group()
1258 cmd.use_param = false; in test_cp_next_group()
1263 test_send_cmd_wait_flags(&cmd); in test_cp_next_group()
1283 struct mpl_cmd cmd; in test_cp_first_group() local
1285 cmd.opcode = BT_MCS_OPC_FIRST_GROUP; in test_cp_first_group()
1286 cmd.use_param = false; in test_cp_first_group()
1291 test_send_cmd_wait_flags(&cmd); in test_cp_first_group()
1311 struct mpl_cmd cmd; in test_cp_last_group() local
1313 cmd.opcode = BT_MCS_OPC_LAST_GROUP; in test_cp_last_group()
1314 cmd.use_param = false; in test_cp_last_group()
1319 test_send_cmd_wait_flags(&cmd); in test_cp_last_group()
1339 struct mpl_cmd cmd; in test_cp_goto_group() local
1341 cmd.opcode = BT_MCS_OPC_GOTO_GROUP; in test_cp_goto_group()
1342 cmd.use_param = true; in test_cp_goto_group()
1343 cmd.param = 2; /* Second group, not the first, maybe not the last */ in test_cp_goto_group()
1348 test_send_cmd_wait_flags(&cmd); in test_cp_goto_group()
1398 search.len = SEARCH_LEN_MIN - 1; in test_search()
1408 * - verify that the search results object ID is zero before search in test_search()
1409 * - write a search (one search control item) to the search control point, in test_search()
1411 * - verify that the search results object ID is non-zero in test_search()
1418 FAIL("Failed to read search results object ID: %d", err); in test_search()
1513 FAIL("Failed to read media player name ID: %d", err); in test_read_player_name()
1518 printk("Player Name read succeeded\n"); in test_read_player_name()
1537 FAIL("Failed to read icon object ID: %d", err); in test_read_icon_obj_id()
1542 printk("Icon Object ID read succeeded\n"); in test_read_icon_obj_id()
1562 FAIL("Failed to read icon object\n"); in test_read_icon_obj()
1586 FAIL("Failed to read icon url: %d", err); in test_read_icon_url()
1591 printk("Icon URL read succeeded\n"); in test_read_icon_url()
1610 FAIL("Failed to read track_title: %d", err); in test_read_track_title()
1615 printk("Track title read succeeded\n"); in test_read_track_title()
1634 FAIL("Failed to read track_duration: %d", err); in test_read_track_duration()
1639 printk("Track duration read succeeded\n"); in test_read_track_duration()
1658 FAIL("Failed to read track position: %d", err); in test_read_track_position()
1663 printk("Track position read succeeded\n"); in test_read_track_position()
1670 /* Invalid behavior - There are no invalid positions to test so only test conn */ in test_write_track_position()
1712 FAIL("Failed to read playback speed: %d", err); in test_read_playback_speed()
1717 printk("Playback speed read succeeded\n"); in test_read_playback_speed()
1724 /* Invalid behavior - There are no invalid speeds to test so only test conn */ in test_set_playback_speed()
1764 FAIL("Failed to read seeking speed: %d", err); in test_read_seeking_speed()
1769 printk("Seeking speed read succeeded\n"); in test_read_seeking_speed()
1788 FAIL("Failed to read track segments object ID: %d", err); in test_read_track_segments_obj_id()
1793 printk("Track Segments Object ID read succeeded\n"); in test_read_track_segments_obj_id()
1812 FAIL("Failed to read track segments object\n"); in test_read_track_segments_object()
1832 invalid_id = BT_OTS_OBJ_ID_MIN - 1; in test_set_current_track_obj_id()
1891 FAIL("Failed to read current track object ID: %d", err); in test_read_current_track_obj_id()
1897 printk("Current Track Object ID read succeeded\n"); in test_read_current_track_obj_id()
1909 printk("Current Track Object ID read succeeded\n"); in test_read_current_track_obj_id_with_expect()
1934 printk("Current Track Object read succeeded\n"); in test_read_current_track_object()
1949 invalid_id = BT_OTS_OBJ_ID_MIN - 1; in test_set_next_track_obj_id()
2007 FAIL("Failed to read next track object ID: %d", err); in test_read_next_track_obj_id()
2013 printk("Next Track Object ID read succeeded\n"); in test_read_next_track_obj_id()
2025 printk("Next Track Object ID read succeeded\n"); in test_read_next_track_obj_id_with_expect()
2044 FAIL("Failed to read next track object\n"); in test_read_next_track_object()
2049 printk("Next Track Object read succeeded\n"); in test_read_next_track_object()
2068 FAIL("Failed to read parent group object ID: %d", err); in test_read_parent_group_obj_id()
2073 printk("Parent Group Object ID read succeeded\n"); in test_read_parent_group_obj_id()
2092 FAIL("Failed to read parent group object\n"); in test_read_parent_group_object()
2097 printk("Parent Group Object read succeeded\n"); in test_read_parent_group_object()
2112 invalid_id = BT_OTS_OBJ_ID_MIN - 1; in test_set_current_group_obj_id()
2169 FAIL("Failed to read current group object ID: %d", err); in test_read_current_group_obj_id()
2175 printk("Current Group Object ID read succeeded\n"); in test_read_current_group_obj_id()
2187 printk("Current Group Object ID read succeeded\n"); in test_read_current_group_obj_id_with_expect()
2206 FAIL("Failed to read current group object\n"); in test_read_current_group_object()
2211 printk("Current Group Object read succeeded\n"); in test_read_current_group_object()
2230 FAIL("Failed to read playing order: %d", err); in test_read_playing_order()
2235 printk("Playing order read succeeded\n"); in test_read_playing_order()
2306 FAIL("Failed to read playing orders supported: %d", err); in test_read_playing_orders_supported()
2311 printk("Playing orders supported read succeeded\n"); in test_read_playing_orders_supported()
2330 FAIL("Failed to read media state: %d", err); in test_read_media_state()
2335 printk("Media state read succeeded\n"); in test_read_media_state()
2354 FAIL("Failed to read content control ID: %d", err); in test_read_content_control_id()
2359 printk("Content control ID read succeeded\n"); in test_read_content_control_id()
2364 struct mpl_cmd cmd; in reset_test_iteration() local
2386 cmd.opcode = BT_MCS_OPC_FIRST_GROUP; in reset_test_iteration()
2387 cmd.use_param = false; in reset_test_iteration()
2388 test_send_cmd_wait_flags(&cmd); in reset_test_iteration()
2394 cmd.opcode = BT_MCS_OPC_FIRST_TRACK; in reset_test_iteration()
2395 cmd.use_param = false; in reset_test_iteration()
2396 test_send_cmd_wait_flags(&cmd); in reset_test_iteration()
2402 cmd.opcode = BT_MCS_OPC_FIRST_SEGMENT; in reset_test_iteration()
2403 cmd.use_param = false; in reset_test_iteration()
2404 test_send_cmd_wait_flags(&cmd); in reset_test_iteration()
2569 /* Control point - move relative opcode */ in test_main()
2572 /* Control point - segment change opcodes */ in test_main()
2579 /* Control point - track change opcodes */ in test_main()
2588 /* Control point - group change opcodes *******************************/ in test_main()