Lines Matching refs:broadcaster
66 struct btp_bap_broadcast_remote_source *broadcaster = &remote_broadcast_sources[i]; in remote_broadcaster_alloc() local
68 if (broadcaster->broadcast_id == BT_BAP_INVALID_BROADCAST_ID) { in remote_broadcaster_alloc()
69 return broadcaster; in remote_broadcaster_alloc()
80 struct btp_bap_broadcast_remote_source *broadcaster = &remote_broadcast_sources[i]; in remote_broadcaster_find() local
82 if (broadcaster->broadcast_id == broadcast_id && in remote_broadcaster_find()
83 bt_addr_le_cmp(addr, &broadcaster->address) == 0) { in remote_broadcaster_find()
84 return broadcaster; in remote_broadcaster_find()
95 struct btp_bap_broadcast_remote_source *broadcaster = &remote_broadcast_sources[i]; in remote_broadcaster_find_by_sink() local
97 if (broadcaster->sink == sink) { in remote_broadcaster_find_by_sink()
98 return broadcaster; in remote_broadcaster_find_by_sink()
119 struct btp_bap_broadcast_remote_source *broadcaster; in stream_started() local
134 broadcaster = &remote_broadcast_sources[b_stream->source_id]; in stream_started()
136 btp_send_bis_syced_ev(&broadcaster->address, broadcaster->broadcast_id, b_stream->bis_id); in stream_started()
184 struct btp_bap_broadcast_remote_source *broadcaster; in stream_recv() local
196 broadcaster = &remote_broadcast_sources[b_stream->source_id]; in stream_recv()
197 send_bis_stream_received_ev(&broadcaster->address, in stream_recv()
198 broadcaster->broadcast_id, b_stream->bis_id, in stream_recv()
228 static void remote_broadcaster_free(struct btp_bap_broadcast_remote_source *broadcaster) in remote_broadcaster_free() argument
230 (void)memset(broadcaster, 0, sizeof(*broadcaster)); in remote_broadcaster_free()
232 broadcaster->broadcast_id = BT_BAP_INVALID_BROADCAST_ID; in remote_broadcaster_free()
234 for (size_t i = 0U; i < ARRAY_SIZE(broadcaster->sink_streams); i++) { in remote_broadcaster_free()
235 broadcaster->sink_streams[i] = stream_broadcast_to_bap(&broadcaster->streams[i]); in remote_broadcaster_free()
236 broadcaster->sink_streams[i]->ops = &stream_ops; in remote_broadcaster_free()
638 struct btp_bap_broadcast_remote_source *broadcaster; member
650 struct btp_bap_broadcast_remote_source *broadcaster = parse_data->broadcaster; in base_subgroup_bis_cb() local
654 if (parse_data->stream_cnt < ARRAY_SIZE(broadcaster->streams)) { in base_subgroup_bis_cb()
656 &broadcaster->streams[parse_data->stream_cnt++]; in base_subgroup_bis_cb()
662 btp_send_bis_found_ev(&broadcaster->address, broadcaster->broadcast_id, parse_data->pd, in base_subgroup_bis_cb()
691 struct btp_bap_broadcast_remote_source *broadcaster; in base_recv_cb() local
697 broadcaster = remote_broadcaster_find_by_sink(sink); in base_recv_cb()
698 if (broadcaster == NULL) { in base_recv_cb()
713 parse_data.broadcaster = broadcaster; in base_recv_cb()
722 broadcaster->bis_index_bitfield = parse_data.bis_bitfield & bis_index_mask; in base_recv_cb()
723 LOG_DBG("bis_index_bitfield 0x%08x", broadcaster->bis_index_bitfield); in base_recv_cb()
730 struct btp_bap_broadcast_remote_source *broadcaster = remote_broadcaster_find_by_sink(sink); in syncable_cb() local
732 if (broadcaster == NULL) { in syncable_cb()
739 broadcaster->requested_bis_sync); in syncable_cb()
746 if (!broadcaster->assistant_request || !broadcaster->requested_bis_sync) { in syncable_cb()
751 index_bitfield = broadcaster->bis_index_bitfield & broadcaster->requested_bis_sync; in syncable_cb()
752 err = bt_bap_broadcast_sink_sync(broadcaster->sink, index_bitfield, in syncable_cb()
753 broadcaster->sink_streams, in syncable_cb()
754 broadcaster->sink_broadcast_code); in syncable_cb()
759 broadcaster->assistant_request = false; in syncable_cb()
915 struct btp_bap_broadcast_remote_source *broadcaster; in pa_sync_req_cb() local
919 broadcaster = remote_broadcaster_find(&recv_state->addr, recv_state->broadcast_id); in pa_sync_req_cb()
920 if (broadcaster == NULL) { in pa_sync_req_cb()
925 broadcaster = remote_broadcaster_alloc(); in pa_sync_req_cb()
926 if (broadcaster == NULL) { in pa_sync_req_cb()
931 broadcaster->broadcast_id = recv_state->broadcast_id; in pa_sync_req_cb()
932 bt_addr_le_copy(&broadcaster->address, &recv_state->addr); in pa_sync_req_cb()
935 broadcaster->sink_recv_state = recv_state; in pa_sync_req_cb()
946 struct btp_bap_broadcast_remote_source *broadcaster; in pa_sync_term_req_cb() local
950 broadcaster = remote_broadcaster_find(&recv_state->addr, recv_state->broadcast_id); in pa_sync_term_req_cb()
951 if (broadcaster == NULL) { in pa_sync_term_req_cb()
957 broadcaster->sink_recv_state = recv_state; in pa_sync_term_req_cb()
970 struct btp_bap_broadcast_remote_source *broadcaster; in broadcast_code_cb() local
974 broadcaster = remote_broadcaster_find(&recv_state->addr, recv_state->broadcast_id); in broadcast_code_cb()
975 if (broadcaster == NULL) { in broadcast_code_cb()
981 broadcaster->sink_recv_state = recv_state; in broadcast_code_cb()
982 (void)memcpy(broadcaster->sink_broadcast_code, broadcast_code, BT_ISO_BROADCAST_CODE_SIZE); in broadcast_code_cb()
984 if (!broadcaster->requested_bis_sync) { in broadcast_code_cb()
988 index_bitfield = broadcaster->bis_index_bitfield & broadcaster->requested_bis_sync; in broadcast_code_cb()
989 err = bt_bap_broadcast_sink_sync(broadcaster->sink, index_bitfield, in broadcast_code_cb()
990 broadcaster->sink_streams, in broadcast_code_cb()
991 broadcaster->sink_broadcast_code); in broadcast_code_cb()
1001 struct btp_bap_broadcast_remote_source *broadcaster; in bis_sync_req_cb() local
1006 broadcaster = remote_broadcaster_find(&recv_state->addr, recv_state->broadcast_id); in bis_sync_req_cb()
1007 if (broadcaster == NULL) { in bis_sync_req_cb()
1013 broadcaster->requested_bis_sync = bis_sync_req[0]; in bis_sync_req_cb()
1014 broadcaster->assistant_request = true; in bis_sync_req_cb()
1016 for (int i = 0; i < ARRAY_SIZE(broadcaster->streams); i++) { in bis_sync_req_cb()
1017 if (broadcaster->streams[i].bis_synced) { in bis_sync_req_cb()
1035 err = bt_bap_broadcast_sink_stop(broadcaster->sink); in bis_sync_req_cb()
1141 struct btp_bap_broadcast_remote_source *broadcaster; in btp_bap_broadcast_sink_sync() local
1148 broadcaster = remote_broadcaster_find(&cp->address, broadcast_id); in btp_bap_broadcast_sink_sync()
1149 if (broadcaster == NULL) { in btp_bap_broadcast_sink_sync()
1150 broadcaster = remote_broadcaster_alloc(); in btp_bap_broadcast_sink_sync()
1151 if (broadcaster == NULL) { in btp_bap_broadcast_sink_sync()
1156 broadcaster->broadcast_id = broadcast_id; in btp_bap_broadcast_sink_sync()
1157 bt_addr_le_copy(&broadcaster->address, &cp->address); in btp_bap_broadcast_sink_sync()
1160 broadcast_source_to_sync = broadcaster; in btp_bap_broadcast_sink_sync()
1205 struct btp_bap_broadcast_remote_source *broadcaster; in btp_bap_broadcast_sink_stop() local
1211 broadcaster = remote_broadcaster_find(&cp->address, broadcast_id); in btp_bap_broadcast_sink_stop()
1212 if (broadcaster == NULL) { in btp_bap_broadcast_sink_stop()
1218 broadcaster->requested_bis_sync = 0; in btp_bap_broadcast_sink_stop()
1220 err = bt_bap_broadcast_sink_stop(broadcaster->sink); in btp_bap_broadcast_sink_stop()
1241 struct btp_bap_broadcast_remote_source *broadcaster; in btp_bap_broadcast_sink_bis_sync() local
1246 broadcaster = remote_broadcaster_find(&cp->address, sys_get_le24(cp->broadcast_id)); in btp_bap_broadcast_sink_bis_sync()
1247 if (broadcaster == NULL) { in btp_bap_broadcast_sink_bis_sync()
1253 broadcaster->requested_bis_sync = sys_le32_to_cpu(cp->requested_bis_sync); in btp_bap_broadcast_sink_bis_sync()
1255 err = bt_bap_broadcast_sink_sync(broadcaster->sink, broadcaster->requested_bis_sync, in btp_bap_broadcast_sink_bis_sync()
1256 broadcaster->sink_streams, in btp_bap_broadcast_sink_bis_sync()
1257 broadcaster->sink_broadcast_code); in btp_bap_broadcast_sink_bis_sync()
1260 broadcaster->requested_bis_sync, err); in btp_bap_broadcast_sink_bis_sync()