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

Applications Commands

RegisterLLS

Description

This function is responsible for registering a LLS 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)LLS_ERROR_INVALID_PARAMETER

(-1002)LLS_ERROR_INSUFFICIENT_RESOURCES

(-1003)LLS_ERROR_SERVICE_ALREADY_REGISTERED

API Call

LLS_Initialize_Service(BluetoothStackID, PASS_EventCallback, NULL, &PASSInstanceID)

API Prototype

int BTPSAPI LLS_Initialize_Service(unsigned int BluetoothStackID, LLS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)

Description of API

The following function is responsible for opening a LLS 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 LLS 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.


UnRegisterLLS

Description

This function is responsible for unregistering the Link Loss 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)LLS_ERROR_INVALID_PARAMETER

(-1004)LLS_ERROR_INVALID_INSTANCE_ID

API Call

LLS_Cleanup_Service(BluetoothStackID, LLSInstanceID)

API Prototype

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

Description of API

The following function is responsible for closing a previously LLS 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 LLS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.


DiscoverLLS

Description

This function is responsible for performing a LLS 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

GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdLLS)

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.


GetAlertLevel

Description

The following function is responsible for reading the Alert Level. It can be executed by a Server or as 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 Level Request sent

(-4) FUNCTION_ERROR

(-1001) LLS_ERROR_INVALID_BLUETOOTH_STACK_ID (-1004) LLS_ERROR_INVALID_INSTANCE_ID

API Call

GATT_Read_Value_Request(BluetoothStackID, ConnectionID, DeviceInfo->LLS_ClientInfo.Alert_Level, GATT_ClientEventCallback_LLS, DeviceInfo->LLS_ClientInfo.Alert_Level)

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.

Note: If successful the return value will contain the Transaction ID that can be used to cancel the request.

SetAlertLevel

Description

The following function is responsible for writing the Alert Level. It can be executed by a Server or as a Client with an open connection to a remote Server if Client write access is supported. If executed as a Client, a GATT write 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

SetAlertLevel has only one parameter which is an integer value that represents a Alert Level. This value is 0 = No Alert, 1 = Mild Alert, 2 = High Alert

Possible Return Values

(0) Ringer Setting successfully set

(-4) FUNCTION_ERROR

(-1000)LLS_ERROR_INVALID_PARAMETER

(-1001) LLS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-1004)LLS_ERROR_INVALID_INSTANCE_ID

API Call

GATT_Write_Request(BluetoothStackID, ConnectionID, DeviceInfo->LLS_ClientInfo.Alert_Level, sizeof(NonAlignedByte_t), (void *)&Data, GATT_ClientEventCallback_LLS, DeviceInfo->LLS_ClientInfo.Alert_Level)

API Prototype

int BTPSAPI GATT_Write_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, Word_t AttributeLength, void *AttributeValue, GATT_Client_Event_Callback_t ClientEventCallback, unsigned long CallbackParameter)

Description of API

The following function is provided to allow a means of performing a write request to a 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 the value of, followed by the length of the value (in bytes), followed by the the actual value data to write. 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.

Note: This function will not write an attribute value with a length greater than the current MTU - 3. To write a longer attribute value use the GATT_Prepare_Write_Request() function instead. This function may write less than the number of requested bytes. This can happen if the number of bytes to write is less than what can fit in the MTU for the specified connection. The data in the etGATT_Client_Write_Response, that is dispatched if the remote device accepts the request, indicates the number of bytes that were written to the remote device. If successful the return value will contain the Transaction ID that can be used to cancel the request.

RegisterIAS

Description

This function is responsible for registering the Immediate Alert 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)IAS_ERROR_INVALID_PARAMETER

(-1002)IAS_ERROR_INSUFFICIENT_RESOURCES

(-1003)IAS_ERROR_SERVICE_ALREADY_REGISTERED

API Call

IAS_Initialize_Service(BluetoothStackID,IAS_EventCallback,0,&IASInstanceID)

API Prototype

int BTPSAPI IAS_Initialize_Service(unsigned int BluetoothStackID, IAS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)

Description of API

The following function is responsible for opening a IAS 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 IAS 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.

Note: Only 1 IAS may be open at a time, per Bluetooth Stack ID. All Client Requests will be dispatch to the EventCallback function that is specified by the second parameter to this function.

UnRegisterIAS

Description

This function is responsible for unregistering the Immediate Alert 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)IAS_ERROR_INVALID_PARAMETER

(-1004)IAS_ERROR_INVALID_INSTANCE_ID

API Call

IAS_Cleanup_Service(BluetoothStackID, IASInstanceID)

API Prototype

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

Description of API

The following function is responsible for closing a previously IAS 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 IAS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.


DiscoverIAS

Description

This function is responsible for performing an IAS 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

GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdIAS)

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.


ConfigureAlertLevel

Description

This function is responsible for performing an IAS 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

GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdIAS)

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.


RegisterTPS

Description

This function is responsible for registering a TPS 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)TPS_ERROR_INVALID_PARAMETER

(-1002)TPS_ERROR_INSUFFICIENT_RESOURCES

(-1003)TPS_ERROR_SERVICE_ALREADY_REGISTERED

API Call

TPS_Initialize_Service(BluetoothStackID, &TPSInstanceID)

API Prototype

int BTPSAPI TPS_Initialize_Service(unsigned int BluetoothStackID, unsigned int *ServiceID)

Description of API

The following function is responsible for opening a TPS 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 TPS 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.


UnRegisterTPS

Description

This function is responsible for unregistering a TPS 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)LLS_ERROR_INVALID_PARAMETER

(-1004)LLS_ERROR_INVALID_INSTANCE_ID

API Call

TPS_Cleanup_Service(BluetoothStackID, TPSInstanceID)

API Prototype

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

Description of API

The following function is responsible for closing a previously TPS 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 TPS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.


DiscoverTPS

Description

This function is responsible for performing a TPS 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

GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdTPS)

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.


SetTxPowerLevel

Description

The following function is responsible for writing the Tx Power Level. It can be executed only by a Server. This function will return zero on successful execution and a negative value on errors.

Parameters

SetAlertLevel has only one parameter which is an integer value that represents a Tx Power Level.

Possible Return Values

(0) Ringer Setting successfully set

(-4) FUNCTION_ERROR

(-1000)TPS_ERROR_INVALID_PARAMETER

(-1001) TPS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-1004)TPS_ERROR_INVALID_INSTANCE_ID

API Call

TPS_Set_Tx_Power_Level(BluetoothStackID, TPSInstanceID, (SByte_t)TempParam->Params[0].intParam)

API Prototype

int BTPSAPI TPS_Set_Tx_Power_Level(unsigned int BluetoothStackID, unsigned int InstanceID, SByte_t Tx_Power_Level)

Description of API

The following function is responsible for setting the Tx Power Level on the specified TPS 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 TPS_Initialize_Server(). The final parameter is the Tx Power Level to set for the specified TPS Instance. This function returns a zero if successful or a negative return error code if an error occurs.


GetTxPowerLevel

Description

The following command is responsible for reading the Tx Power Level. It can be executed by a Server or as 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 Level Request sent

(-4) FUNCTION_ERROR

(-1001) LLS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-1004) LLS_ERROR_INVALID_INSTANCE_ID

API Call

GATT_Read_Value_Request(BluetoothStackID, ConnectionID, DeviceInfo->LLS_ClientInfo.Alert_Level, GATT_ClientEventCallback_LLS, DeviceInfo->LLS_ClientInfo.Alert_Level)

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.

Note: If successful the return value will contain the Transaction ID that can be used to cancel the request.