#include <stdint.h>
Functions | |
int | a2dp_max_media_payload_size (uint16_t a2dp_cid, uint8_t local_seid) |
Return maximal media payload size, does not include media header. More... | |
void | a2dp_source_create_sdp_record (uint8_t *service, uint32_t service_record_handle, uint16_t supported_features, const char *service_name, const char *service_provider_name) |
Create A2DP Source service record. More... | |
avdtp_stream_endpoint_t * | a2dp_source_create_stream_endpoint (avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t *codec_capabilities, uint16_t codec_capabilities_len, uint8_t *codec_configuration, uint16_t codec_configuration_len) |
Create a stream endpoint of type SOURCE, and register media codec by specifying its capabilities and the default configuration. More... | |
uint8_t | a2dp_source_disconnect (uint16_t a2dp_cid) |
Release stream and disconnect from remote. More... | |
uint8_t | a2dp_source_establish_stream (bd_addr_t remote, uint8_t local_seid, uint16_t *out_a2dp_cid) |
Open stream. More... | |
void | a2dp_source_init (void) |
Initialize up A2DP Source device. More... | |
uint8_t | a2dp_source_pause_stream (uint16_t a2dp_cid, uint8_t local_seid) |
Pause stream. More... | |
void | a2dp_source_register_packet_handler (btstack_packet_handler_t callback) |
Register callback for the A2DP Source client. More... | |
uint8_t | a2dp_source_start_stream (uint16_t a2dp_cid, uint8_t local_seid) |
Start stream. More... | |
void | a2dp_source_stream_endpoint_request_can_send_now (uint16_t a2dp_cid, uint8_t local_seid) |
Request to send a media packet. More... | |
int | a2dp_source_stream_send_media_payload (uint16_t a2dp_cid, uint8_t local_seid, uint8_t *storage, int num_bytes_to_copy, uint8_t num_frames, uint8_t marker) |
Send media payload. More... | |
int a2dp_max_media_payload_size | ( | uint16_t | a2dp_cid, |
uint8_t | local_seid | ||
) |
Return maximal media payload size, does not include media header.
a2dp_cid | A2DP channel identifyer. |
local_seid | ID of a local stream endpoint. |
void a2dp_source_create_sdp_record | ( | uint8_t * | service, |
uint32_t | service_record_handle, | ||
uint16_t | supported_features, | ||
const char * | service_name, | ||
const char * | service_provider_name | ||
) |
Create A2DP Source service record.
service | |
service_record_handle | |
supported_features | 16-bit bitmap, see AVDTP_SOURCE_SF_* values in avdtp.h |
service_name | |
service_provider_name |
avdtp_stream_endpoint_t* a2dp_source_create_stream_endpoint | ( | avdtp_media_type_t | media_type, |
avdtp_media_codec_type_t | media_codec_type, | ||
uint8_t * | codec_capabilities, | ||
uint16_t | codec_capabilities_len, | ||
uint8_t * | codec_configuration, | ||
uint16_t | codec_configuration_len | ||
) |
Create a stream endpoint of type SOURCE, and register media codec by specifying its capabilities and the default configuration.
media_type | See avdtp_media_type_t values in avdtp.h (audio, video or multimedia). |
media_codec_type | See avdtp_media_codec_type_t values in avdtp.h |
codec_capabilities | Media codec capabilities as defined in A2DP spec, section 4 - Audio Codec Interoperability Requirements. |
codec_capabilities_len | Media codec capabilities length. |
codec_configuration | Default media codec configuration. |
codec_configuration_len | Media codec configuration length. |
out_local_seid | Assigned stream endpoint ID used in further A2DP commands. |
uint8_t a2dp_source_disconnect | ( | uint16_t | a2dp_cid | ) |
Release stream and disconnect from remote.
a2dp_cid | A2DP channel identifyer. |
uint8_t a2dp_source_establish_stream | ( | bd_addr_t | remote, |
uint8_t | local_seid, | ||
uint16_t * | out_a2dp_cid | ||
) |
Open stream.
remote | |
local_seid | ID assigned to a local stream endpoint |
out_a2dp_cid | Assigned A2DP channel identifyer used for furhter A2DP commands. |
void a2dp_source_init | ( | void | ) |
Initialize up A2DP Source device.
uint8_t a2dp_source_pause_stream | ( | uint16_t | a2dp_cid, |
uint8_t | local_seid | ||
) |
Pause stream.
a2dp_cid | A2DP channel identifyer. |
local_seid | ID of a local stream endpoint. |
void a2dp_source_register_packet_handler | ( | btstack_packet_handler_t | callback | ) |
Register callback for the A2DP Source client.
It will receive following subevents of HCI_EVENT_A2DP_META HCI event type:
callback |
uint8_t a2dp_source_start_stream | ( | uint16_t | a2dp_cid, |
uint8_t | local_seid | ||
) |
Start stream.
a2dp_cid | A2DP channel identifyer. |
local_seid | ID of a local stream endpoint. |
void a2dp_source_stream_endpoint_request_can_send_now | ( | uint16_t | a2dp_cid, |
uint8_t | local_seid | ||
) |
Request to send a media packet.
Packet can be then sent on reception of A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW event.
a2dp_cid | A2DP channel identifyer. |
local_seid | ID of a local stream endpoint. |
int a2dp_source_stream_send_media_payload | ( | uint16_t | a2dp_cid, |
uint8_t | local_seid, | ||
uint8_t * | storage, | ||
int | num_bytes_to_copy, | ||
uint8_t | num_frames, | ||
uint8_t | marker | ||
) |
Send media payload.
a2dp_cid | A2DP channel identifyer. |
local_seid | ID of a local stream endpoint. |
storage | |
num_bytes_to_copy | |
num_frames | |
marker |