Microchip® Advanced Software Framework

a2dp_sink.h File Reference
#include <stdint.h>

Functions

void a2dp_sink_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 Sink service record. More...
 
uint8_t a2dp_sink_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, uint8_t *out_local_seid)
 Create a stream endpoint of type SINK, and register media codec by specifying its capabilities and the default configuration. More...
 
void a2dp_sink_disconnect (uint16_t a2dp_cid)
 Release stream and disconnect from remote. More...
 
uint8_t a2dp_sink_establish_stream (bd_addr_t remote, uint8_t local_seid, uint16_t *out_a2dp_cid)
 Establish stream. More...
 
void a2dp_sink_init (void)
 Initialize up A2DP Sink device. More...
 
void a2dp_sink_register_media_handler (void(*callback)(uint8_t local_seid, uint8_t *packet, uint16_t size))
 Register media handler for the A2DP Sink client. More...
 
void a2dp_sink_register_packet_handler (btstack_packet_handler_t callback)
 Register callback for the A2DP Sink client. More...
 

void a2dp_sink_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 Sink service record.

Parameters
service
service_record_handle
supported_features16-bit bitmap, see AVDTP_SINK_SF_* values in avdtp.h
service_name
service_provider_name
uint8_t a2dp_sink_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,
uint8_t *  out_local_seid 
)

Create a stream endpoint of type SINK, and register media codec by specifying its capabilities and the default configuration.

Parameters
media_typesee avdtp_media_type_t values in avdtp.h (audio, video or multimedia)
media_codec_typesee avdtp_media_codec_type_t values in avdtp.h
codec_capabilitiesmedia codec capabilities as defined in A2DP spec, section 4 - Audio Codec Interoperability Requirements.
codec_capabilities_lenmedia codec capabilities length
codec_configurationdefault media codec configuration
codec_configuration_lenmedia codec configuration length
out_local_seidAssigned stream endpoint ID used in further A2DP commands.
Returns
status ERROR_CODE_SUCCESS if sucessful
void a2dp_sink_disconnect ( uint16_t  a2dp_cid)

Release stream and disconnect from remote.

Parameters
a2dp_cidA2DP channel identifyer.
uint8_t a2dp_sink_establish_stream ( bd_addr_t  remote,
uint8_t  local_seid,
uint16_t *  out_a2dp_cid 
)

Establish stream.

Parameters
remote
local_seidID of a local stream endpoint.
out_a2dp_cidAssigned A2DP channel identifyer used for furhter A2DP commands.
void a2dp_sink_init ( void  )

Initialize up A2DP Sink device.

void a2dp_sink_register_media_handler ( void(*)(uint8_t local_seid, uint8_t *packet, uint16_t size)  callback)

Register media handler for the A2DP Sink client.

Parameters
callback
packet
size
void a2dp_sink_register_packet_handler ( btstack_packet_handler_t  callback)

Register callback for the A2DP Sink client.

It will receive following subevents of HCI_EVENT_A2DP_META HCI event type:

  • A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION: indicates from remote chosen SBC media codec configuration
  • A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION: indicates from remote chosen other then SBC media codec configuration
  • A2DP_SUBEVENT_STREAM_ESTABLISHED: received when stream to a remote device is established
  • A2DP_SUBEVENT_STREAM_STARTED: received when stream is started
  • A2DP_SUBEVENT_STREAM_SUSPENDED: received when stream is paused
  • A2DP_SUBEVENT_STREAM_STOPED: received when stream is aborted or stopped
  • A2DP_SUBEVENT_STREAM_RELEASED: received when stream is released
  • A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED: received when signaling channel is disconnected
Parameters
callback