Lines Matching +full:static +full:- +full:address

1 /* btp_mcp.c - Bluetooth MCP Tester */
6 * SPDX-License-Identifier: Apache-2.0
35 static struct media_player *mcs_media_player;
36 static uint64_t current_track_obj_id;
37 static uint64_t next_track_obj_id;
38 static uint8_t media_player_state;
39 static uint64_t current_id;
40 static uint64_t parent_id;
85 static struct net_buf_simple *rx_ev_buf = NET_BUF_SIMPLE(SEARCH_LEN_MAX +
89 static void btp_send_mcp_found_ev(struct bt_conn *conn, uint8_t status, in btp_send_mcp_found_ev()
94 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_found_ev()
149 static void btp_send_mcp_track_duration_ev(struct bt_conn *conn, uint8_t status, int32_t dur) in btp_send_mcp_track_duration_ev()
153 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_track_duration_ev()
161 static void btp_send_mcp_track_position_ev(struct bt_conn *conn, uint8_t status, int32_t pos) in btp_send_mcp_track_position_ev()
165 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_track_position_ev()
173 static void btp_send_mcp_playback_speed_ev(struct bt_conn *conn, uint8_t status, int8_t speed) in btp_send_mcp_playback_speed_ev()
177 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_playback_speed_ev()
185 static void btp_send_mcp_seeking_speed_ev(struct bt_conn *conn, uint8_t status, int8_t speed) in btp_send_mcp_seeking_speed_ev()
189 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_seeking_speed_ev()
197 static void btp_send_mcp_icon_obj_id_ev(struct bt_conn *conn, uint8_t status, uint64_t id) in btp_send_mcp_icon_obj_id_ev()
201 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_icon_obj_id_ev()
209 static void btp_send_mcp_next_track_obj_id_ev(struct bt_conn *conn, uint8_t status, in btp_send_mcp_next_track_obj_id_ev()
214 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_next_track_obj_id_ev()
222 static void btp_send_parent_group_obj_id_ev(struct bt_conn *conn, uint8_t status, uint64_t id) in btp_send_parent_group_obj_id_ev()
226 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_parent_group_obj_id_ev()
234 static void btp_send_current_group_obj_id_ev(struct bt_conn *conn, uint8_t status, uint64_t id) in btp_send_current_group_obj_id_ev()
238 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_current_group_obj_id_ev()
246 static void btp_send_mcp_playing_order_ev(struct bt_conn *conn, uint8_t status, uint8_t order) in btp_send_mcp_playing_order_ev()
250 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_playing_order_ev()
258 static void btp_send_mcp_playing_orders_supported_ev(struct bt_conn *conn, uint8_t status, in btp_send_mcp_playing_orders_supported_ev()
263 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_playing_orders_supported_ev()
271 static void btp_send_mcp_media_state_ev(struct bt_conn *conn, uint8_t status, uint8_t state) in btp_send_mcp_media_state_ev()
275 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_media_state_ev()
283 static void btp_send_mcp_opcodes_supported_ev(struct bt_conn *conn, uint8_t status, in btp_send_mcp_opcodes_supported_ev()
288 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_opcodes_supported_ev()
296 static void btp_send_mcp_content_control_id_ev(struct bt_conn *conn, uint8_t status, in btp_send_mcp_content_control_id_ev()
301 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_mcp_content_control_id_ev()
309 static void btp_send_segments_obj_id_ev(struct bt_conn *conn, uint8_t status, uint64_t id) in btp_send_segments_obj_id_ev()
313 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_segments_obj_id_ev()
321 static void btp_send_current_track_obj_id_ev(struct bt_conn *conn, uint8_t status, uint64_t id) in btp_send_current_track_obj_id_ev()
325 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_current_track_obj_id_ev()
333 static void btp_send_media_cp_ev(struct bt_conn *conn, uint8_t status, in btp_send_media_cp_ev()
338 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_media_cp_ev()
341 ev.opcode = cmd->opcode; in btp_send_media_cp_ev()
342 ev.use_param = cmd->use_param; in btp_send_media_cp_ev()
343 ev.param = sys_cpu_to_le32(cmd->param); in btp_send_media_cp_ev()
348 static void btp_send_search_cp_ev(struct bt_conn *conn, uint8_t status, in btp_send_search_cp_ev()
358 bt_addr_le_copy(&ev->address, bt_conn_get_dst(conn)); in btp_send_search_cp_ev()
360 ev->status = status; in btp_send_search_cp_ev()
361 ev->param_len = (uint8_t)search->search[0]; in btp_send_search_cp_ev()
363 if (ev->param_len > (SEARCH_LEN_MAX - sizeof(ev->param_len))) { in btp_send_search_cp_ev()
367 ev->search_type = search->search[1]; in btp_send_search_cp_ev()
368 strcpy(param, &search->search[2]); in btp_send_search_cp_ev()
369 net_buf_simple_add_mem(rx_ev_buf, param, ev->param_len); in btp_send_search_cp_ev()
371 tester_event(BTP_SERVICE_ID_MCP, BTP_MCP_SEARCH_CP_EV, ev, sizeof(*ev) + ev->param_len); in btp_send_search_cp_ev()
374 static void btp_send_command_notifications_ev(struct bt_conn *conn, uint8_t status, in btp_send_command_notifications_ev()
379 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_command_notifications_ev()
382 ev.requested_opcode = ntf->requested_opcode; in btp_send_command_notifications_ev()
383 ev.result_code = ntf->result_code; in btp_send_command_notifications_ev()
388 static void btp_send_search_notifications_ev(struct bt_conn *conn, uint8_t status, in btp_send_search_notifications_ev()
393 bt_addr_le_copy(&ev.address, bt_conn_get_dst(conn)); in btp_send_search_notifications_ev()
401 static void mcc_discover_cb(struct bt_conn *conn, int err) in mcc_discover_cb()
411 svc_chrc_handles.gmcs_handles.player_name = mcc_inst->player_name_handle; in mcc_discover_cb()
412 svc_chrc_handles.gmcs_handles.icon_obj_id = mcc_inst->icon_obj_id_handle; in mcc_discover_cb()
413 svc_chrc_handles.gmcs_handles.icon_url = mcc_inst->icon_url_handle; in mcc_discover_cb()
414 svc_chrc_handles.gmcs_handles.track_changed = mcc_inst->track_changed_handle; in mcc_discover_cb()
415 svc_chrc_handles.gmcs_handles.track_title = mcc_inst->track_title_handle; in mcc_discover_cb()
416 svc_chrc_handles.gmcs_handles.track_duration = mcc_inst->track_duration_handle; in mcc_discover_cb()
417 svc_chrc_handles.gmcs_handles.track_position = mcc_inst->track_position_handle; in mcc_discover_cb()
418 svc_chrc_handles.gmcs_handles.playback_speed = mcc_inst->playback_speed_handle; in mcc_discover_cb()
419 svc_chrc_handles.gmcs_handles.seeking_speed = mcc_inst->seeking_speed_handle; in mcc_discover_cb()
420 svc_chrc_handles.gmcs_handles.segments_obj_id = mcc_inst->segments_obj_id_handle; in mcc_discover_cb()
421 svc_chrc_handles.gmcs_handles.current_track_obj_id = mcc_inst->current_track_obj_id_handle; in mcc_discover_cb()
422 svc_chrc_handles.gmcs_handles.next_track_obj_id = mcc_inst->next_track_obj_id_handle; in mcc_discover_cb()
423 svc_chrc_handles.gmcs_handles.current_group_obj_id = mcc_inst->current_group_obj_id_handle; in mcc_discover_cb()
424 svc_chrc_handles.gmcs_handles.parent_group_obj_id = mcc_inst->parent_group_obj_id_handle; in mcc_discover_cb()
425 svc_chrc_handles.gmcs_handles.playing_order = mcc_inst->playing_order_handle; in mcc_discover_cb()
427 mcc_inst->playing_orders_supported_handle; in mcc_discover_cb()
428 svc_chrc_handles.gmcs_handles.media_state = mcc_inst->media_state_handle; in mcc_discover_cb()
429 svc_chrc_handles.gmcs_handles.cp = mcc_inst->cp_handle; in mcc_discover_cb()
430 svc_chrc_handles.gmcs_handles.opcodes_supported = mcc_inst->opcodes_supported_handle; in mcc_discover_cb()
432 mcc_inst->search_results_obj_id_handle; in mcc_discover_cb()
433 svc_chrc_handles.gmcs_handles.scp = mcc_inst->scp_handle; in mcc_discover_cb()
434 svc_chrc_handles.gmcs_handles.content_control_id = mcc_inst->content_control_id_handle; in mcc_discover_cb()
435 svc_chrc_handles.ots_handles.feature = mcc_inst->otc.feature_handle; in mcc_discover_cb()
436 svc_chrc_handles.ots_handles.obj_name = mcc_inst->otc.obj_name_handle; in mcc_discover_cb()
437 svc_chrc_handles.ots_handles.obj_type = mcc_inst->otc.obj_type_handle; in mcc_discover_cb()
438 svc_chrc_handles.ots_handles.obj_size = mcc_inst->otc.obj_size_handle; in mcc_discover_cb()
439 svc_chrc_handles.ots_handles.obj_id = mcc_inst->otc.obj_id_handle; in mcc_discover_cb()
440 svc_chrc_handles.ots_handles.obj_properties = mcc_inst->otc.obj_properties_handle; in mcc_discover_cb()
441 svc_chrc_handles.ots_handles.obj_created = mcc_inst->otc.obj_created_handle; in mcc_discover_cb()
442 svc_chrc_handles.ots_handles.obj_modified = mcc_inst->otc.obj_modified_handle; in mcc_discover_cb()
443 svc_chrc_handles.ots_handles.oacp = mcc_inst->otc.oacp_handle; in mcc_discover_cb()
444 svc_chrc_handles.ots_handles.olcp = mcc_inst->otc.olcp_handle; in mcc_discover_cb()
449 static void mcc_read_track_duration_cb(struct bt_conn *conn, int err, int32_t dur) in mcc_read_track_duration_cb()
456 static void mcc_read_track_position_cb(struct bt_conn *conn, int err, int32_t pos) in mcc_read_track_position_cb()
463 static void mcc_set_track_position_cb(struct bt_conn *conn, int err, int32_t pos) in mcc_set_track_position_cb()
470 static void mcc_read_playback_speed_cb(struct bt_conn *conn, int err, int8_t speed) in mcc_read_playback_speed_cb()
477 static void mcc_set_playback_speed_cb(struct bt_conn *conn, int err, int8_t speed) in mcc_set_playback_speed_cb()
484 static void mcc_read_seeking_speed_cb(struct bt_conn *conn, int err, int8_t speed) in mcc_read_seeking_speed_cb()
491 static void mcc_read_icon_obj_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_read_icon_obj_id_cb()
498 static void mcc_read_next_track_obj_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_read_next_track_obj_id_cb()
505 static void mcc_set_next_track_obj_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_set_next_track_obj_id_cb()
512 static void mcc_read_parent_group_obj_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_read_parent_group_obj_id_cb()
519 static void mcc_read_current_group_obj_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_read_current_group_obj_id_cb()
526 static void mcc_set_current_group_obj_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_set_current_group_obj_id_cb()
533 static void mcc_read_playing_order_cb(struct bt_conn *conn, int err, uint8_t order) in mcc_read_playing_order_cb()
540 static void mcc_set_playing_order_cb(struct bt_conn *conn, int err, uint8_t order) in mcc_set_playing_order_cb()
547 static void mcc_read_playing_orders_supported_cb(struct bt_conn *conn, int err, uint16_t orders) in mcc_read_playing_orders_supported_cb()
556 static void mcc_media_state_read_cb(struct bt_conn *conn, int err, uint8_t state) in mcc_media_state_read_cb()
563 static void mcc_opcodes_supported_cb(struct bt_conn *conn, int err, uint32_t opcodes) in mcc_opcodes_supported_cb()
571 static void mcc_content_control_id_cb(struct bt_conn *conn, int err, uint8_t ccid) in mcc_content_control_id_cb()
579 static void mcc_segments_object_id_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_segments_object_id_cb()
586 static void mcc_current_track_obj_id_read_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_current_track_obj_id_read_cb()
593 static void mcc_current_track_obj_id_set_cb(struct bt_conn *conn, int err, uint64_t id) in mcc_current_track_obj_id_set_cb()
600 static void mcc_send_cmd_cb(struct bt_conn *conn, int err, const struct mpl_cmd *cmd) in mcc_send_cmd_cb()
607 static void mcc_send_search_cb(struct bt_conn *conn, int err, const struct mpl_search *search) in mcc_send_search_cb()
614 static void mcc_cmd_ntf_cb(struct bt_conn *conn, int err, const struct mpl_cmd_ntf *ntf) in mcc_cmd_ntf_cb()
621 static void mcc_search_ntf_cb(struct bt_conn *conn, int err, uint8_t result_code) in mcc_search_ntf_cb()
629 static struct bt_mcc_cb mcp_cb = {
660 static uint8_t mcp_supported_commands(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_supported_commands()
666 tester_set_bit(rp->data, BTP_MCP_READ_SUPPORTED_COMMANDS); in mcp_supported_commands()
667 tester_set_bit(rp->data, BTP_MCP_DISCOVER); in mcp_supported_commands()
668 tester_set_bit(rp->data, BTP_MCP_TRACK_DURATION_READ); in mcp_supported_commands()
669 tester_set_bit(rp->data, BTP_MCP_TRACK_POSITION_READ); in mcp_supported_commands()
670 tester_set_bit(rp->data, BTP_MCP_TRACK_POSITION_SET); in mcp_supported_commands()
671 tester_set_bit(rp->data, BTP_MCP_PLAYBACK_SPEED_READ); in mcp_supported_commands()
672 tester_set_bit(rp->data, BTP_MCP_PLAYBACK_SPEED_SET); in mcp_supported_commands()
675 tester_set_bit(rp->data, BTP_MCP_SEEKING_SPEED_READ); in mcp_supported_commands()
676 tester_set_bit(rp->data, BTP_MCP_ICON_OBJ_ID_READ); in mcp_supported_commands()
677 tester_set_bit(rp->data, BTP_MCP_NEXT_TRACK_OBJ_ID_READ); in mcp_supported_commands()
678 tester_set_bit(rp->data, BTP_MCP_NEXT_TRACK_OBJ_ID_SET); in mcp_supported_commands()
679 tester_set_bit(rp->data, BTP_MCP_PARENT_GROUP_OBJ_ID_READ); in mcp_supported_commands()
680 tester_set_bit(rp->data, BTP_MCP_CURRENT_GROUP_OBJ_ID_READ); in mcp_supported_commands()
681 tester_set_bit(rp->data, BTP_MCP_CURRENT_GROUP_OBJ_ID_SET); in mcp_supported_commands()
684 tester_set_bit(rp->data, BTP_MCP_PLAYING_ORDER_READ); in mcp_supported_commands()
685 tester_set_bit(rp->data, BTP_MCP_PLAYING_ORDER_SET); in mcp_supported_commands()
686 tester_set_bit(rp->data, BTP_MCP_PLAYING_ORDERS_SUPPORTED_READ); in mcp_supported_commands()
687 tester_set_bit(rp->data, BTP_MCP_MEDIA_STATE_READ); in mcp_supported_commands()
688 tester_set_bit(rp->data, BTP_MCP_OPCODES_SUPPORTED_READ); in mcp_supported_commands()
689 tester_set_bit(rp->data, BTP_MCP_CONTENT_CONTROL_ID_READ); in mcp_supported_commands()
690 tester_set_bit(rp->data, BTP_MCP_SEGMENTS_OBJ_ID_READ); in mcp_supported_commands()
693 tester_set_bit(rp->data, BTP_MCP_CURRENT_TRACK_OBJ_ID_READ); in mcp_supported_commands()
694 tester_set_bit(rp->data, BTP_MCP_CURRENT_TRACK_OBJ_ID_SET); in mcp_supported_commands()
695 tester_set_bit(rp->data, BTP_MCP_CMD_SEND); in mcp_supported_commands()
696 tester_set_bit(rp->data, BTP_MCP_CMD_SEARCH); in mcp_supported_commands()
703 static uint8_t mcp_discover(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) in mcp_discover()
709 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_discover()
724 static uint8_t mcp_track_duration_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_track_duration_read()
733 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_track_duration_read()
747 static uint8_t mcp_track_position_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_track_position_read()
756 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_track_position_read()
770 static uint8_t mcp_track_position_set(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_track_position_set()
774 uint32_t pos = sys_le32_to_cpu(cp->pos); in mcp_track_position_set()
780 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_track_position_set()
794 static uint8_t mcp_playback_speed_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_playback_speed_read()
803 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_playback_speed_read()
817 static uint8_t mcp_playback_speed_set(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_playback_speed_set()
826 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_playback_speed_set()
832 err = bt_mcc_set_playback_speed(conn, cp->speed); in mcp_playback_speed_set()
840 static uint8_t mcp_seeking_speed_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_seeking_speed_read()
849 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_seeking_speed_read()
863 static uint8_t mcp_read_icon_obj_id(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_read_icon_obj_id()
872 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_read_icon_obj_id()
886 static uint8_t mcp_read_next_track_obj_id(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_read_next_track_obj_id()
895 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_read_next_track_obj_id()
909 static uint8_t mcp_set_next_track_obj_id(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_set_next_track_obj_id()
913 uint64_t id = sys_get_le48(cp->id); in mcp_set_next_track_obj_id()
919 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_set_next_track_obj_id()
933 static uint8_t mcp_parent_group_obj_id_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_parent_group_obj_id_read()
942 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_parent_group_obj_id_read()
956 static uint8_t mcp_current_group_obj_id_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_current_group_obj_id_read()
965 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_current_group_obj_id_read()
979 static uint8_t mcp_set_current_group_obj_id(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_set_current_group_obj_id()
983 uint64_t id = sys_get_le48(cp->id); in mcp_set_current_group_obj_id()
989 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_set_current_group_obj_id()
1003 static uint8_t mcp_playing_order_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_playing_order_read()
1012 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_playing_order_read()
1026 static uint8_t mcp_playing_order_set(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_playing_order_set()
1035 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_playing_order_set()
1041 err = bt_mcc_set_playing_order(conn, cp->order); in mcp_playing_order_set()
1049 static uint8_t mcp_playing_orders_supported_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_playing_orders_supported_read()
1058 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_playing_orders_supported_read()
1072 static uint8_t mcp_media_state_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_media_state_read()
1081 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_media_state_read()
1095 static uint8_t mcp_opcodes_supported_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_opcodes_supported_read()
1104 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_opcodes_supported_read()
1118 static uint8_t mcp_content_control_id_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_content_control_id_read()
1127 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_content_control_id_read()
1141 static uint8_t mcp_segments_obj_id_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_segments_obj_id_read()
1150 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_segments_obj_id_read()
1164 static uint8_t mcp_current_track_obj_id_read(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_current_track_obj_id_read()
1173 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_current_track_obj_id_read()
1187 static uint8_t mcp_current_track_obj_id_set(const void *cmd, uint16_t cmd_len, void *rsp, in mcp_current_track_obj_id_set()
1191 uint64_t id = sys_get_le48(cp->id); in mcp_current_track_obj_id_set()
1197 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_current_track_obj_id_set()
1211 static uint8_t mcp_cmd_send(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) in mcp_cmd_send()
1220 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_cmd_send()
1226 mcp_cmd.opcode = cp->opcode; in mcp_cmd_send()
1227 mcp_cmd.use_param = cp->use_param; in mcp_cmd_send()
1228 mcp_cmd.param = sys_le32_to_cpu(cp->param); in mcp_cmd_send()
1238 static uint8_t mcp_cmd_search(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) in mcp_cmd_search()
1248 if (cmd_len < sizeof(*cp) || cmd_len != sizeof(*cp) + cp->param_len) { in mcp_cmd_search()
1252 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in mcp_cmd_search()
1259 scp_cmd.type = cp->type; in mcp_cmd_search()
1277 if (cp->param_len >= (SEARCH_LEN_MAX - 1)) { in mcp_cmd_search()
1281 strcpy(scp_cmd.param, cp->param); in mcp_cmd_search()
1309 static const struct btp_handler mcp_handlers[] = {
1460 static uint8_t mcs_supported_commands(const void *cmd, uint16_t cmd_len, void *rsp, in mcs_supported_commands()
1466 tester_set_bit(rp->data, BTP_MCS_READ_SUPPORTED_COMMANDS); in mcs_supported_commands()
1467 tester_set_bit(rp->data, BTP_MCS_CMD_SEND); in mcs_supported_commands()
1468 tester_set_bit(rp->data, BTP_MCS_CURRENT_TRACK_OBJ_ID_GET); in mcs_supported_commands()
1469 tester_set_bit(rp->data, BTP_MCS_NEXT_TRACK_OBJ_ID_GET); in mcs_supported_commands()
1470 tester_set_bit(rp->data, BTP_MCS_INACTIVE_STATE_SET); in mcs_supported_commands()
1471 tester_set_bit(rp->data, BTP_MCS_PARENT_GROUP_SET); in mcs_supported_commands()
1478 static uint8_t mcs_cmd_send(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) in mcs_cmd_send()
1486 mcp_cmd.opcode = cp->opcode; in mcs_cmd_send()
1487 mcp_cmd.use_param = cp->use_param; in mcs_cmd_send()
1488 mcp_cmd.param = (cp->use_param != 0) ? sys_le32_to_cpu(cp->param) : 0; in mcs_cmd_send()
1498 static uint8_t mcs_next_track_obj_id_get(const void *cmd, uint16_t cmd_len, void *rsp, in mcs_next_track_obj_id_get()
1511 sys_put_le48(next_track_obj_id, rp->id); in mcs_next_track_obj_id_get()
1518 static uint8_t mcs_current_track_obj_id_get(const void *cmd, uint16_t cmd_len, void *rsp, in mcs_current_track_obj_id_get()
1531 sys_put_le48(current_track_obj_id, rp->id); in mcs_current_track_obj_id_get()
1538 static uint8_t mcs_parent_group_set(const void *cmd, uint16_t cmd_len, void *rsp, in mcs_parent_group_set()
1565 static uint8_t mcs_inactive_state_set(const void *cmd, uint16_t cmd_len, void *rsp, in mcs_inactive_state_set()
1574 rp->state = media_player_state; in mcs_inactive_state_set()
1581 static void mcs_player_instance_cb(struct media_player *plr, int err) in mcs_player_instance_cb()
1588 static void mcs_command_send_cb(struct media_player *player, int err, const struct mpl_cmd *cmd) in mcs_command_send_cb()
1593 static void mcs_current_track_obj_id_cb(struct media_player *player, int err, uint64_t id) in mcs_current_track_obj_id_cb()
1600 static void mcs_next_track_obj_id_cb(struct media_player *player, int err, uint64_t id) in mcs_next_track_obj_id_cb()
1607 static void mcs_media_state_cb(struct media_player *player, int err, uint8_t state) in mcs_media_state_cb()
1614 static void mcs_current_group_id_cb(struct media_player *player, int err, uint64_t id) in mcs_current_group_id_cb()
1621 static void mcs_parent_group_id_cb(struct media_player *player, int err, uint64_t id) in mcs_parent_group_id_cb()
1628 static struct media_proxy_ctrl_cbs mcs_cbs = {
1638 static const struct btp_handler mcs_handlers[] = {