Thursday, 21 March 2019

Bluetooth A2DP

A2DP : Advanced Audio Distribution Profile.

1. application service capalities - A2DP ,
    a. Codec parameter configuration,
    b. content protection configuration
2. Transport service capabilites - AVDTP
     a. Segmentation
   

A2DP: Two roles are defined

1. Source - Device which is music source, streams music
2.  Sink - Device which receives music stream and plays the same music.

Exchange of messages between source and sink

1. Discover Stream End points - SEPs are media end points with different codec capabitilies. Single sink device can support multiple codec capabilities that are identified as SEPs
This exchange will allow application to know Sink Codec capabilities

2. Get all the capabilites

3. Configure SEP -  SRC determines the most suitable audio parameters . This exchange includes codec, content protection and transport capabilities. Exchange SEP configurations. Sink is allowed to reject configuration of source and propose its own configuration.


4. Open stream - Streaming is entered to Open state where it is ready stream music.

When music startd playing - state enters into 'STream' state.  - AVDTP channel is created to carry music packets.

4. Start stream -
     



Default codec that is supported: SBC

1. Sampling Frequency,  Channel Mode -  Byte 0
2. Block Length , Subbands , Allocation Method - Byte1
3. Minimum Bitpool Value byte 2
4. Maximum Bitpool Value byte 3


Wednesday, 20 March 2019

Bluetooth HFP

Two roles defined - Audio Gateway and HFP.

Mobile phone - Audio Gateway - Gate way for audio input/output.
HF Device - Acts as remote device for audio input/output.

1) First service level connection is established and
2) then audio connection is established for active call

Service level connection happens with exchange of AT format commands and responses between AG and HF device

AT commnds that exhanged are

AT+BRSF - Bluetooth Retrieve Supported Features.
AT+BAC - Bluetooth available codes
AT+CIND - Call indicators supported
AT+CHUP - Call hang up/Or reject incoming call by HF
AT+CMER - Event reporting activation/deactivation.
RING - Ring alert from AG -> HFdevice
ATA - Call Answer by HF
+CIEV: (call = 1) - Call answered by AG, indicate to HF
+CIEV: (callsetup = 0) Call iNterrupted/rejected in AG
AT+BCS - Codec Selection( eSCO + mSBC, or SCO_CVSD)
 +CIEV unsolicited result code with the corresponding indicator value whenever a change in service, call, or call setup status occurs.

Service Level connection is assumed successful once either of AT+CMER, OR AT+CHLD are exchanged.