SWRU580 April 2021 CC2564C , CC2564MODA , CC2564MODN
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.
OpenRemoteControlDescription
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.
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.
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.
ChageStreamFormatDescription
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.
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.
QuerySupportedFormatsDescription
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
QueryStreamConfigurationDescription
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.
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.
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.
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.