SWRU580 April   2021 CC2564C , CC2564MODA , CC2564MODN

 

  1.   Trademarks
  2. Introduction
  3. A2DP (AUD) Demo Guide
    1. 2.1 Demo Overview
    2. 2.2 Demo Application
    3. 2.3 Application Commands
  4. A3DP Sink Demo Guide
    1. 3.1 Demo Overview
    2. 3.2 Demo Application
    3. 3.3 Sink Reference Board Demo Application
    4. 3.4 Multiple Source Demo
    5. 3.5 Application Commands
  5. A3DP Source Demo Guide
    1. 4.1 Demo Overview
    2. 4.2 Demo Application
    3. 4.3 Application Commands
  6. HFP Demo Guide
    1. 5.1 Demo Overview
    2. 5.2 Demo Application
    3. 5.3 Application Commands
  7. HFP Audio Gateway Demo Guide
    1. 6.1 Demo Overview
    2. 6.2 Demo Application
    3. 6.3 Application Commands
  8. HID Demo Guide
    1. 7.1 Demo Overview
    2. 7.2 Demo Application
    3. 7.3 Application Commands
  9. HSP Demo Guide
    1. 8.1 Demo Overview
    2. 8.2 Demo Application
    3. 8.3 Application Command
  10. Map Demo Guide
    1. 9.1 Demo Overview
    2. 9.2 Demo Application
    3. 9.3 Application Command
  11. 10PBAP Demo Guide
    1. 10.1 Demo Overview
    2. 10.2 Demo Application
    3. 10.3 Application Commands
  12. 11SPP Demo Guide
    1. 11.1 Demo Overview
    2. 11.2 Demo Application
    3. 11.3 Application Commands
  13. 12SPPLE Demo Guide
    1. 12.1 Demo Overview
    2. 12.2 Demo Application
    3. 12.3 Demonstrating SPP LE on an iOS Device with the LightBlue App
    4. 12.4 Demonstrating SPP LE on an iOS Device with the SPPLE Transfer App - LEGACY
    5. 12.5 SPP Demo
    6. 12.6 Application Commands
  14. 13SPPDMMulti Demo Guide
    1. 13.1 Demo Overview
    2. 13.2 Demo Application
    3. 13.3 Application Commands
  15. 14ANP Demo Guide
    1. 14.1 Demo Overview
    2. 14.2 Demo Application
    3. 14.3 Application Commands
  16. 15HFP Demo Guide
    1. 15.1 Demo Overview
    2. 15.2 Demo Application
    3. 15.3 Application Commands
  17. 16HTP Demo Guide
    1. 16.1 Demo Overview
    2. 16.2 Demo Application
    3. 16.3 Application Commands
  18. 17PASP Demo Guide
    1. 17.1 Demo Overview
    2. 17.2 Demo Application
    3. 17.3 Application Commands
  19. 18HOGP Demo Guide
    1. 18.1 Demo Overview
    2. 18.2 Demo Application
    3. 18.3 Application Commands
  20. 19PXP Demo Guide
    1. 19.1 Demo Overview
    2. 19.2 Demo Application
    3. 19.3 Applications Commands
  21. 20FMP Demo Guide
    1. 20.1 Demo Overview
    2. 20.2 Demo Application
    3. 20.3 Application Commands
  22. 21CSCP Demo Guide
    1. 21.1 Demo Overview
    2. 21.2 Demo Application
    3. 21.3 Application Commands
  23. 22Revision History

Application Commands

Generic Access Profile Commands
Note: Reference the appendix for all Generic Access Profile Commands
A2DP Profile Comands
OpenRemoteSystem

Description

The following function is responsible for initializing AUD if necessary, and initializing the A2DP and AVRCP subsystems.

Parameters

This command takes Inquiry Index number to work which can be found using the DisplayInquiryList command after an Inquiry has been completed

Possible Return Values

(0) AUD Sink opened successfully

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2009) BTAUD_ERROR_STREAM_NOT_INITIALIZED

(-2010) BTAUD_ERROR_UNABLE_TO_CONNECT_REMOTE_STREAM

(-2011) BTAUD_ERROR_STREAM_ALREADY_CONNECTED

(-2013) BTAUD_ERROR_STREAM_CONNECTION_IN_PROGRESS

API Call

AUD_Open_Remote_Stream(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam - 1)], astSNK)

API Prototype

int BTPSAPI AUD_Open_Remote_Stream(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, AUD_Stream_Type_t StreamType)

Description of API

The following function is responsible for opening a remote streaming endpoint on the specified remote device.This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the remote Bluetooth device AND the local Stream type.

This function returns zero if successful or a negative return error code if there was an error.

OpenRemoteControl

Description

The following function is responsible for opening a remote control connection to a remote Bluetooth Device, AVRCP subsystem.

Parameters

This command takes Inquiry Index number to work which can be found using the DisplayInquiryList command after an Inquiry has been completed

Possible Return Values

(0) AVRCP opened successfully

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2026) BTAUD_ERROR_REMOTE_CONTROL_NOT_CONNECTED

(-2028) BTAUD_ERROR_REMOTE_CONTROL_ALREADY_CONNECTED

(-2029) BTAUD_ERROR_REMOTE_CONTROL_CONNECTION_IN_PROGRESS

(-2030) BTAUD_ERROR_REMOTE_CONTROL_NOT_INITIALIZED

API Call

AUD_Open_Remote_Control(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam - 1)])

API Prototype

int BTPSAPI AUD_Open_Remote_Control(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR)

Description of API

The following function is responsible for opening a remote control connection to the specified remote device. This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the remote Bluetooth device address of the device to connect with. This function returns zero if successful or a negative return error code if there was an error.

Note: If this function is called to establish a remote control connection (and the connection is successful), the caller MUST call the AUD_Close_Remote_Control() function to disconnect the remote control connection
CloseRemoteControl

Description

The following function is responsible for closing an opened remote control.

Parameters

This command takes Inquiry Index number to work which can be found using the DisplayInquiryList command after an Inquiry has been completed.

Possible Return Values

(0) AVRCP closed successfully

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2005) BTAUD_ERROR_INVALID_OPERATION

(-2026) BTAUD_ERROR_REMOTE_CONTROL_NOT_CONNECTED

(-2030) BTAUD_ERROR_REMOTE_CONTROL_NOT_INITIALIZED

API Call

AUD_Close_Remote_Control(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam - 1)])

API Prototype

int BTPSAPI AUD_Close_Remote_Control(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR)

Description of API

The following function is responsible for closing a currently open remote control connection on the local device.This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the device address of the remote control connection close.This function returns zero if successful or a negative return error code if there was an error.

Note: This function should only be called if the local device previously issued a call to the AUD_Open_Remote_Control() function and a remote control connection was successfully established.
ChangeStreamState

Description

The following function is responsible for changing the state of an open stream.

Parameters

This function required one parameter, stream state (0 = Stopped, 1 = Started).

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2012) BTAUD_ERROR_STREAM_NOT_CONNECTED

(-2016) BTAUD_ERROR_STREAM_STATE_ALREADY_CURRENT

(-2017) BTAUD_ERROR_UNABLE_TO_CHANGE_STREAM_STATE

(-2018) BTAUD_ERROR_STREAM_STATE_CHANGE_IN_PROGRESS

(-2019) BTAUD_ERROR_STREAM_FORMAT_CHANGE_IN_PROGRESS

API Call

AUD_Change_Stream_State(BluetoothStackID, ConnectedBD_ADDR, astSNK, (TempParam->Params[0].intParam)?astStreamStarted:astStreamStopped)

API Prototype

int BTPSAPI AUD_Change_Stream_State(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, AUD_Stream_Type_t StreamType, AUD_Stream_State_t StreamState)

Description of API

The following function is responsible for Changing the Stream State of a currently opened stream endpoint on the local device. This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the remote device address of the connected stream, followed by the stream endpoint type to change the state of (local Stream Endpoint), followed by the new Stream Endpoint state.

This function returns zero if successful or a negative return error code if there was an error.

ChageStreamFormat

Description

The following function is responsible for changing the format of a currently open stream. The Supported Formats Index should be determined by the displayed list from a call to QuerySupportedFormats.

Parameters

This function required one parameter, Supported Formats Index (fron the list in QuerySupportedFormats).

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2012) BTAUD_ERROR_STREAM_NOT_CONNECTED

(-2014) BTAUD_ERROR_STREAM_IS_ACTIVE

(-2018) BTAUD_ERROR_STREAM_STATE_CHANGE_IN_PROGRESS

(-2019) BTAUD_ERROR_STREAM_FORMAT_CHANGE_IN_PROGRESS

(-2020) BTAUD_ERROR_UNSUPPORTED_FORMAT

(-2021) BTAUD_ERROR_UNABLE_TO_CHANGE_STREAM_FORMAT

(-2032) BTAUD_ERROR_SAME_FORMAT

API Call

AUD_Change_Stream_Format(BluetoothStackID, ConnectedBD_ADDR, astSNK, &AudioSNKSupportedFormats[(TempParam->Params[0].intParam - 1)])

API Prototype

int BTPSAPI AUD_Change_Stream_Format(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, AUD_Stream_Type_t StreamType, AUD_Stream_Format_t *StreamFormat)

Description of API

The following function is responsible for Changing the Stream Format of a currently opened stream endpoint on the local device. This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the remote device address of the connected stream, followed by the stream endpoint type to change the format of (local Stream Endpoint), followed by the new Stream Endpoint format.

This function returns zero if successful or a negative return error code if there was an error.

Note: The Stream Format can ONLY be changed when the stream state is stopped.The stream codec type cannot be changed. If a stream has been configured for a specific codec type, this function cannot be used to change the codec type.The stream must be disconnected and reconnected and the alternate codec type must be selected.In fact, the codec type bit mask value is ignored by this function.
QueryStreamFormat

Description

The following function is responsible for determining and displaying the format of a currently opened stream.

Parameters

This function required one parameter, Local Stream Type (0 = SNK, 1 = SRC).

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2012) BTAUD_ERROR_STREAM_NOT_CONNECTED

API Call

AUD_Query_Stream_Format(BluetoothStackID, ConnectedBD_ADDR, astSNK, &StreamFormat)

API Prototype

int BTPSAPI AUD_Query_Stream_Format(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, AUD_Stream_Type_t StreamType, AUD_Stream_Format_t *StreamFormat)

Description of API

The following function is responsible for querying the current Stream Format of a currently opened stream endpoint on the local device.This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the remote device address of the connected stream, followed by the stream endpoint type to query the format of (local Stream Endpoint), followed by a pointer to a buffer that is receive the current Stream Endpoint format.

This function returns zero if successful or a negative return error code if there was an error.

QuerySupportedFormats

Description

The following function is responsible for displaying the local supported formats to the user. The indices displayed should be used with the ChangeStreamFormat function.

Parameters

It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the query.

Possible Return Values

(0) Successful

(-8) INVALID_STACK_ID_ERROR

QueryStreamConfiguration

Description

The following function is responsible for determining and displaying the configuration of a currently opened stream.

Parameters

This function required one parameter, Local Stream Type (0 = SNK, 1 = SRC).

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2012) BTAUD_ERROR_STREAM_NOT_CONNECTED

API Call

AUD_Query_Stream_Configuration(BluetoothStackID, ConnectedBD_ADDR, astSNK, &StreamConfiguration)

API Prototype

int BTPSAPI AUD_Query_Stream_Configuration(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, AUD_Stream_Type_t StreamType, AUD_Stream_Configuration_t *StreamConfiguration)

Description of API

The following function is responsible for querying the current Stream Configuration of a currently opened stream endpoint on the local device.This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the remote device address of the connected stream, followed by the stream endpoint type to query the configuration of (local Stream Endpoint), followed by a pointer to a buffer that is receive the current Stream Endpoint configuration.

This function returns zero if successful or a negative return error code if there was an error.

Note: This function is used to query the low level A2DP configuration that is currently active for the specified stream.
ChangeConnectionMode

Description

The following function is responsible for changing how incoming connections are handled.

Parameters

This function required one parameter, Connection Mode (0 = Automatic Accept, 1 = Automatic Reject, 2 = Manual Accept).

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

API Call

AUD_Set_Server_Connection_Mode(BluetoothStackID, (!(TempParam->Params[0].intParam))?ausAutomaticAccept:(TempParam->Params[0].intParam == 1)?ausAutomaticReject:ausManualAccept)

API Prototype

int BTPSAPI AUD_Set_Server_Connection_Mode(unsigned int BluetoothStackID, AUD_Server_Connection_Mode_t ServerConnectionMode)

Description of API

The following function is responsible for setting the Audio Manager Server Connection Mode.This function accepts as its first parameter the Bluetooth stack ID of the Bluetooth stack in which the server exists.The second parameter to this function is the new Server Connection Mode to set the Server to use. Connection requests will not be dispatched unless the Server Mode (second parameter) is set to ausManualAccept. In this case the Callback that was registered with the server will be invoked whenever a Remote Bluetooth device attempts to connect to the local device.If the Server Mode (second parameter) is set to anything other than ausManualAccept then no open request indication events will be dispatched.

This function returns zero if successful, or a negative return error code if an error occurred.

Note: The Default Server Connection Mode is AutomaticAccept. This function is used for Bluetooth devices operating in Bluetooth Security Mode 2.
QueryConnectionMode

Description

The following function is responsible for determining and displaying how incoming connections are handled.

Parameters

It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the query.

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-8) INVALID_STACK_ID_ERROR

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

API Call

AUD_Get_Server_Connection_Mode(BluetoothStackID, &ServerConnectionMode)

API Prototype

int BTPSAPI AUD_Get_Server_Connection_Mode(unsigned int BluetoothStackID, AUD_Server_Connection_Mode_t *ServerConnectionMode)

Description of API

The following function is responsible for retrieving the current Audio Manager Connection Mode.This function accepts as its first parameter the Bluetooth stack ID of the Bluetooth stack on which the server exists.The final parameter to this function is a pointer to a Server Connection Mode variable which will receive the current Server Connection Mode.

This function returns zero if successful, or a negative return error code if an error occurred.

Note: The Default Server Connection Mode is ausAutomaticAccept. This function is used for Bluetooth devices operating in Bluetooth Security Mode 2.
SendPassThroughCommand

Description

The following function is responsible for sending Remote Control Pass Through Commands.

Parameters

This function required one or two parameters, Commands (0 = Pause, 1 = Play, 2 = Stop, 3 = Vol. Up, 4 = Vol. Down, 5 = Specify Command with value parameter (the second parameter)).

Possible Return Values

(0) Successful

(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE

(-2000) BTAUD_ERROR_INVALID_PARAMETER

(-2001) BTAUD_ERROR_NOT_INITIALIZED

(-2002) BTAUD_ERROR_INVALID_BLUETOOTH_STACK_ID

(-2004) BTAUD_ERROR_INSUFFICIENT_RESOURCES

(-2023) BTAUD_ERROR_UNABLE_TO_SEND_REMOTE_CONTROL_COMMAND

(-2025) BTAUD_ERROR_REMOTE_DEVICE_NOT_CONNECTED

(-2026) BTAUD_ERROR_REMOTE_CONTROL_NOT_CONNECTED

(-2033) BTAUD_ERROR_REMOTE_CONTROL_ROLE_NOT_INITIALIZED

API Call

AUD_Send_Remote_Control_Command(BluetoothStackID, ConnectedBD_ADDR, &RemoteControlCommandData, 0)

AUD_Send_Remote_Control_Command(BluetoothStackID, ConnectedBD_ADDR, &RemoteControlCommandData, DEFAULT_PASS_THROUGH_COMMAND_TIMEOUT)

API Prototype

int BTPSAPI AUD_Send_Remote_Control_Command(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, AUD_Remote_Control_Command_Data_t *RemoteControlCommandData, unsigned long ResponseTimeout)

Description of API

The following function is responsible for sending the specified Remote Control Command to the remote device.This function accepts as input the Bluetooth stack ID of the Bluetooth protocol stack that the requested Audio Manager is present, followed by the Bluetooth device address of the device that is to receive the command, followed by the Remote Control information itself. The final parameter represents the Timeout value (in milliseconds) to wait for a response (confirmation) from the remote device.

This function returns a positive (non-zero) return value if successful which represents the internal Transaction ID of the Remote Control Command. This ID can be used to match responses (confirmations) with outgoing commands.This function returns a negative return error code if there was an error.

Note: Currently this function is ONLY applicable for local SNK devices (i.e. if there is a SRC connected and no SNK connected then this call will fail). Specifying a Timeout of zero will cause the Audio Manager to not track the command (and thus, not dispatch a response/confirmation event).