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

RegisterPASS

Description

This function is responsible for registering a PASP Service. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0) Successfully registered PASP Service

(-4) FUNCTION_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1002)PASS_ERROR_INSUFFICIENT_RESOURCES

(-1003)PASS_ERROR_SERVICE_ALREADY_REGISTERED

API Call

PASS_Initialize_Service(BluetoothStackID, PASS_EventCallback, NULL, &PASSInstanceID)

API Prototype

int BTPSAPI PASS_Initialize_Service(unsigned int BluetoothStackID, PASS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)

Description of API

The following function is responsible for opening a PASS Server. The first parameter is the Bluetooth Stack ID on which to open the Server. The second parameter is the Callback function to call when an event occurs on this Server Port. The third parameter is a user-defined callback parameter that will be passed to the callback function with each event. The final parameter is a pointer to store the GATT Service ID of the registered PASS service. This can be used to include the service registered by this call. This function returns the positive, non-zero, Instance ID or a negative error code.


UnRegisterPASS

Description

This function is responsible for unregistering a PASP Service. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0) Successfully unregistered PASP Service

(-4) FUNCTION_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1004)PASS_ERROR_INVALID_INSTANCE_ID

API Call

PASS_Cleanup_Service(BluetoothStackID, PASSInstanceID)

API Prototype

int BTPSAPI PASS_Cleanup_Service(unsigned int BluetoothStackID, unsigned int InstanceID)

Description of API

The following function is responsible for closing a previously PASS Server. The first parameter is the Bluetooth Stack ID on which to close the Server. The second parameter is the InstanceID that was returned from a successful call to PASS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.


DiscoverPASS

Description

This function is responsible for performing a PASP Service Discovery Operation. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0) GDIS_Service_Discovery_Start success

(-4) Function_Error

(-1000)GDIS_ERROR_INVALID_PARAMETER

(-1001)GDIS_ERROR_NOT_INITIALIZED

(-1002)GDIS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-1003)GDIS_ERROR_INSUFFICIENT_RESOURCES

(-1009)GDIS_ERROR_SERVICE_DISCOVERY_OUTSTANDING

API Call

GDIS_Service_Discovery_Start(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GDIS_Event_Callback, sdPASS)

API Prototype

int BTPSAPI GDIS_Service_Discovery_Start(unsigned int BluetoothStackID, unsigned int ConnectionID, unsigned int NumberOfUUID, GATT_UUID_t *UUIDList, GDIS_Event_Callback_t ServiceDiscoveryCallback, unsigned long ServiceDiscoveryCallbackParameter)

Description of API

The following function is used to initiate the Service Discovery process or queue additional requests. The function takes as its first parameter the BluetoothStackID that is associated with the Bluetooth Device. The second parameter is the connection ID of the remote device that is to be searched. The third and fourth parameters specify an optional list of UUIDs to search for. The final two parameters define the Callback function and parameter to use when the service discovery is complete. The function returns zero on success and a negative return value if there was an error.


ConfigureRemotePASS

Description

This function is responsible for configure a PASP Service on a remote device. This function will return zero on successful execution and a negative value on errors.

Parameters

The ConfigureRemotePASS command requires 2 parameters. The first parameter is Alert Status Notify (0 = disable, 1 = enable) and the second parameter is Ringer Setting Notify (0 = disable, 1 = enable).

Command Call Examples

ConfigureRemotePASS 1 1(both Alert Status Notify and Ringer Setting Notify enabled).

ConfigureRemotePASS 0 0(both Alert Status Notify and Ringer Setting Notify disabled).

ConfigureRemotePASS 0 1(Alert Status Notify disabled and Ringer Setting Notify enabled).

ConfigureRemotePASS 1 0 (Alert Status Notify enabled and Ringer Setting Notify disabled).

Possible Return Values

(0) CCCD Configuration Success

(-1)BTPS_ERROR_INVALID_PARAMETER

(-4) Function_Error

API Call

EnableDisableNotificationsIndications(DeviceInfo->ClientInfo.Alert_Status_Client_Configuration, (TempParam->Params[0].intParam ? GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_NOTIFY_ENABLE : 0), GATT_ClientEventCallback_PASP)

API Prototype

int EnableDisableNotificationsIndications(Word_t ClientConfigurationHandle, Word_t ClientConfigurationValue, GATT_Client_Event_Callback_t ClientEventCallback)

Description of API

The following function function is used to enable/disable notifications on a specified handle. This function returns the positive non-zero Transaction ID of the Write Request or a negative error code.


NotifyAlertStatus

Description

This function is responsible for performing an Alert Status notification to a connected remote device. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0)Alert Status Notification success

(-4) FUNCTION_ERROR

(-8) INVALID_STACK_ID_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1004)PASS_ERROR_INVALID_INSTANCE_ID

(-1006)PASS_ERROR_UNKNOWN_ERROR

API Call

PASS_Send_Notification(BluetoothStackID, PASSInstanceID, ConnectionID, rrAlertStatus)

API Prototype

int BTPSAPI PASS_Send_Notification(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, PASS_Characteristic_Type_t CharacteristicType)

Description of API

The following function is responsible for sending a notification of a specified characteristic to a specified remote device. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to PASS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. The final parameter specifies the characteristic to notify. This function returns a zero if successful or a negative return error code if an error occurs.


NotifyRingerSetting

Description

This function is responsible for performing an Ringer Setting notification to a connected remote device. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0) Ringer Setting Notification success

(-4) FUNCTION_ERROR

(-8) INVALID_STACK_ID_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1004)PASS_ERROR_INVALID_INSTANCE_ID

API Call

PASS_Send_Notification(BluetoothStackID, PASSInstanceID, ConnectionID, rrRingerSetting)

API Prototype

int BTPSAPI PASS_Send_Notification(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, PASS_Characteristic_Type_t CharacteristicType)

Description of API

The following function is responsible for sending a notification of a specified characteristic to a specified remote device. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to PASS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. The final parameter specifies the characteristic to notify. This function returns a zero if successful or a negative return error code if an error occurs.

GetAlertStatus

Description

This function is responsible for reading the Alert Status. It can be executed by a Server or a Client with an open connection to a remote Server. If executed as a Client, a GATT read request will be generated, and the results will be returned as a response in the GATT Client event callback. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0) Get Alert Status Request sent

(-4) FUNCTION_ERROR

API Call

GATT_Read_Value_Request(BluetoothStackID, ConnectionID, DeviceInfo->ClientInfo.Alert_Status, GATT_ClientEventCallback_PASP, DeviceInfo->ClientInfo.Alert_Status)

API Prototype

int BTPSAPI GATT_Read_Value_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, GATT_Client_Event_Callback_t ClientEventCallback, unsigned long CallbackParameter)

Description of API

The following function is provided to allow a means of performing a read request on a remote device for a specific attribute value. The first parameter is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the attribute handle to read the value from. The final two parameters specify the GATT Client event callback function and callback parameter (respectively) that will be called when a response is received from the remote device. This function will return the positive, non-zero, Transaction ID of the request or a negative error code.


SetAlertStatus

Description

This function is responsible for writing the Alert Status. It can be executed only by a Server. This function will return zero on successful execution and a negative value on errors.

Parameters

Three parameters are required for this function. The first one is Ringer (0 = inactive, 1 = active). The second one is Vibrate (0 = inactive, 1 = active) and the third one is Display (0 = inactive, 1 = active)

Command Call Examples

SetAlertStatus 1 1 1 (Sets Ringer, Vibrate and Display to Active)

SetAlertStatus 0 1 1 (Sets Ringer to Inactive, Vibrate and Display to Active)

SetAlertStatus 1 1 0 (Sets Ringer, Vibrate to Active and Display to Inactive)

Possible Return Values

(0) Alert Status successfully set

(-4) FUNCTION_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1004)PASS_ERROR_INVALID_INSTANCE_ID

API Call

PASS_Set_Alert_Status(BluetoothStackID, PASSInstanceID, AlertStatus)

API Prototype

int BTPSAPI PASS_Set_Alert_Status(unsigned int BluetoothStackID, unsigned int InstanceID, PASS_Alert_Status_t AlertStatus)

Description of API

The following function is responsible for setting the Alert Status characteristic on the specified PASS instance. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to PASS_Initialize_Server(). The final parameter is the Alert Status to set as the current Alert Status for the specified PASS Instance. This function returns a zero if successful or a negative return error code if an error occurs.

GetRingerSetting

Description

This function is responsible for reading the Ringer Setting. It can be executed by a Server or a Client with an open connection to a remote Server. If executed as a Client, a GATT read request will be generated, and the results will be returned as a response in the GATT Client event callback. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0) Ringer Setting

(-4) FUNCTION_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1004)PASS_ERROR_INVALID_INSTANCE_ID

API CallPASS_Query_Ringer_Setting(BluetoothStackID, PASSInstanceID, &RingerSetting)

API Prototype

int BTPSAPI PASS_Query_Ringer_Setting(unsigned int BluetoothStackID, unsigned int InstanceID, PASS_Ringer_Setting_t *RingerSetting)

Description of API

The following function is responsible for querying the current Ringer Setting characteristic value on the specified PASS instance. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to PASS_Initialize_Server(). The final parameter is a pointer to store the current Ringer Setting for the specified PASS Instance. This function returns a zero if successful or a negative return error code if an error occurs.


SetRingerSetting

Description

This function is responsible for writing the Ringer Setting. It can be executed only by a Server. This function will return zero on successful execution and a negative value on errors.

Parameters

SetRingerSetting has only one parameter which is an integer value that represents a Ringer Setting. This value is 0 = silent, 1 = normal.

Possible Return Values

(0) Ringer Setting successfully set

(-4) FUNCTION_ERROR

(-1000)PASS_ERROR_INVALID_PARAMETER

(-1004)PASS_ERROR_INVALID_INSTANCE_ID

API Call

PASS_Set_Ringer_Setting(BluetoothStackID, PASSInstanceID, RingerSetting)

API Prototype

int BTPSAPI PASS_Set_Ringer_Setting(unsigned int BluetoothStackID, unsigned int InstanceID, PASS_Ringer_Setting_t RingerSetting)

Description of API

The following function is responsible for setting the Ringer Setting characteristic on the specified PASS instance. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to PASS_Initialize_Server(). The final parameter is the Ringer Setting to set as the current Ringer Setting for the specified PASS Instance. This function returns a zero if successful or a negative return error code if an error occurs.


SetSilentMode

Description

This function is responsible for writing the Set Silent Mode command to a remote Server Control Point. It can be executed only by a Client. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0)Set Silent Mode command request sent

(-4) FUNCTION_ERROR

API Call

GATT_Write_Without_Response_Request(BluetoothStackID, ConnectionID, DeviceInfo->ClientInfo.Ringer_Control_Point, PASS_RINGER_CONTROL_POINT_VALUE_LENGTH, ((void *)CommandBuffer)

API Prototype

int BTPSAPI GATT_Write_Without_Response_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, Word_t AttributeLength, void *AttributeValue)

Description of API

The following function is provided to allow a means of performing a write without response request to remote device for a specified attribute. The first parameter to this function is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the handle of the attribute to write, followed by the length of the value data to write (in bytes), followed by the actual value to write. This function will return the number of bytes written on success or a negative error code.


CancelSilentMode

Description

This function is responsible for writing the Cancel Silent Mode command to a remote Server Control Point. It can be executed only by a Client. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0)Cancel Silent Mode command request sent

(-4) FUNCTION_ERROR

API Call

GATT_Write_Without_Response_Request(BluetoothStackID, ConnectionID, DeviceInfo->ClientInfo.Ringer_Control_Point, PASS_RINGER_CONTROL_POINT_VALUE_LENGTH, ((void *)CommandBuffer)

API Prototype

int BTPSAPI GATT_Write_Without_Response_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, Word_t AttributeLength, void *AttributeValue)

Description of API

The following function is provided to allow a means of performing a write without response request to remote device for a specified attribute. The first parameter to this function is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the handle of the attribute to write, followed by the length of the value data to write (in bytes), followed by the actual value to write. This function will return the number of bytes written on success or a negative error code.


MuteOnce

Description

This function is responsible for writing the Mute Once command to a remote Server Control Point. It can be executed only by a Client. This function will return zero on successful execution and a negative value on errors.

Parameters

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

Possible Return Values

(0)Mute Once command request sent

(-4) FUNCTION_ERROR

API Call

GATT_Write_Without_Response_Request(BluetoothStackID, ConnectionID, DeviceInfo->ClientInfo.Ringer_Control_Point, PASS_RINGER_CONTROL_POINT_VALUE_LENGTH, ((void *)CommandBuffer)))

API Prototype

int BTPSAPI GATT_Write_Without_Response_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, Word_t AttributeLength, void *AttributeValue)

Description of API

The following function is provided to allow a means of performing a write without response request to remote device for a specified attribute. The first parameter to this function is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the handle of the attribute to write, followed by the length of the value data to write (in bytes), followed by the actual value to write. This function will return the number of bytes written on success or a negative error code.