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

RegisterHRS

Description

the RegisterHRS command is responsible for registering a HRP Service. This function will return zero on successful execution and a negative value on all errors.

Parameters

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

Possible Return Values

(0) Successfully registered an HRP service

(-4) FUNCTION_ERROR

(-1000) HRS_ERROR_INVALID_PARAMETER

(-1002) HRS_ERROR_INSUFFICIENT_RESOURCES

(-1003) HRS_ERROR_SERVICE_ALREADY_REGISTERED

API Call

HRS_Initialize_Service(BluetoothStackID, HRS_HEART_RATE_CONTROL_POINT_RESET_ENERGY_EXPENDED_SUPPORTED, HRS_EventCallback, NULL, &HRSInstanceID);

API Prototype

int BTPSAPI HRS_Initialize_Service(unsigned int BluetoothStackID, unsigned long Supported_Commands, HRS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)

Description of API

This function is responsible for opening a HRS Server. The first parameter is the Bluetooth Stack ID on which to open the Server. The second parameter is the mask of supported Heart Rate Control point commands. The third parameter is the Callback function to call when an event occurs on this Server Port. The fourth 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 HRS 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. Only 1 HRS Server may be open at a time, per Bluetooth Stack ID. The Supported_Commands parameter must be made up of bit masks of the form: HRS_HEART_RATE_CONTROL_POINT_XXX_SUPPORTED All Client Requests will be dispatch to the EventCallback function that is specified by the second parameter to this function.


UnRegisterHRS

Description

The UnRegisterHRS command is responsible for unregistering a HRP Service. This command will return zero on successful execution and a negative value on all errors.

Parameters

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

Possible Return Values

(0) Successfully closed the HRS Server

(-4) FUNCTION_ERROR (HRP Service not registered)

(-1000) HRS_ERROR_INVALID_PARAMETER

(-1004) HRS_ERROR_INVALID_INSTANCE_ID

API Call

HRS_Cleanup_Service(BluetoothStackID, HRSInstanceID);

API Prototype

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

Description of API

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


DiscoverHRS

Description

The DiscoverHRS command is responsible for performing a HRP Service Discovery Operation. This command will return a zero on successful execution and a negative value on all errors.

Parameters

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

Possible Return Values

(0) Service Discovery Start success

(-4) Function_Error

API Call

GDIS_Service_Discovery_Start(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GDIS_Event_Callback, sdHRS);

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 GDIS_Service_Discover_Start is in an application module called GDIS that is provided to allow an easy way to perform GATT service discovery. This module can and should be modified for the customers use. This function is called to start a service discovery operation by the GDIS module.


ConfigureRemoteHRS

Description

The ConfigureRemoteHRS command is responsible for configuring a HRP Service on a remote device. This command will return zero on successful execution and a negative value on all errors.

Parameters

The ConfigureRemoteHRS requires only one parameter, Heart Rate Notify. 0 disables Heart Rate Notify and 1 enables Heart Rate Notify

Command Call Examples

ConfigureRemoteHRS 1 configures the service with Heart Rate Notify enabled.

ConfigureRemoteHRS 0 configures the service with Heart Rate Notify disabled.

Possible Return Values

(0) Successfully configured HRS on the remote device

(-4) FUNCTION_ERROR


NotifyHeartRate

Description

The NotifyHeartRate command is responsible for performing a Heart Rate Measurement notification to a connected remote device. This command will return zero on successful execution and a negative value on all errors.

Parameters

the NotifyHeartRate command requires 5 parameters. The first parameter is the BPM (beats per minute). The second is the Heart Rate format, 0 = Byte, 1 = Word. The third is the Sensor Contact Status, 0 = Not Supported, 1 = Supported/Not Detected, 2 = Supported/Detected. The fourth is Energy Expended, 0 = Don't Send, 1 = Send. The fifth and last is the number of RR Intervals, 0 = None, X = Number of Intervals.

Command Call Examples

NotifyHeartRate 80 1 2 1 0

Possible Return Values

(0) Successfully sent the Heart Rate Measurement

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-1000) HRS_ERROR_INVALID_PARAMETER

(-1002) HRS_ERROR_INSUFFICIENT_RESOURCES

(-1004) HRS_ERROR_INVALID_INSTANCE_ID

API Call

HRS_Notify_Heart_Rate_Measurement(BluetoothStackID, HRSInstanceID, ConnectionID, HeartRatePtr)

API Prototype

Int BTPSAPI HRS_Notify_Heart_Rate_Measurement(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, HRS_Heart_Rate_Measurement_Data_t *Heart_Rate_Measurement)

Description of API

This function is responsible for sending a Heart Rate Measurement 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 HRS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. The final parameter is the Heart Rate Measurement data to notify. This function will return zero if the notification was sent successfully or a negative return error code if there was an error condition.


GetBodySensorLocation

Description

The GetBodySensorLocation command is responsible for reading the Body Sensor Location characteristic. It can be executed by a Server or a Client with an open connection to a remote Server. This command will return zero on successful execution and a negative value on all errors.

Parameters

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

Possible Return Values

(0) Successfully Set Body Sensor Location

(-4) FUNCTION_ERROR

(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE

(-1000) HRS_ERROR_INVALID_PARAMETER

(-1004) HRS_ERROR_INVALID_INSTANCE_ID

API Call

HRS_Query_Body_Sensor_Location(BluetoothStackID, HRSInstanceID, &location)

API Prototype

int BTPSAPI HRS_Query_Body_Sensor_Location(unsigned int BluetoothStackID, unsigned int InstanceID, Byte_t *Body_Sensor_Location)

Description of API

This function is responsible for querying the current location of the body sensor for the specified HRS 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 HRS_Initialize_Server(). The final parameter is a pointer to return the current Body Sensor Location for the specified HRS instance. This function will return zero if the body sensor location was successfully set or a negative return error code if there was an error condition.


SetBodySensorLocation

Description

The SetBodySensorlocation command is responsible for writing the Body Sensor Location characteristic. It can be executed only by a Server. This command will return zero on successful execution and a negative value on all errors.

Parameters

The SetBodySensorLocation command requires one parameter which is the Location of the Heart Rate sensor. This parameter should be an integer between 1 and 6 with each number corresponding to a different location.

0 – Other, 1 – Chest, 2 – Wrist, 3 – Finger, 4 – Hand, 5 - Ear Lobe, 6 – Foot.

Command Call Examples

"SetBodySensorLocation 3" sets the sensor location to Finger.

"SetBodySensorLocation 5" sets the sensor location to Ear lobe.

Possible Return Values

(0) Successfully Set Body Sensor Location

(-4) FUNCTION_ERROR

(-103 ) BTPS_ERROR_FEATURE_NOT_AVAILABLE

(-1000) HRS_ERROR_INVALID_PARAMETER

(-1004) HRS_ERROR_INVALID_INSTANCE_ID

API Call

HRS_Set_Body_Sensor_Location(BluetoothStackID, HRSInstanceID, (Byte_t)TempParam->Params[0].intParam

API Prototype

Int BTPSAPI HRS_Set_Body_Sensor_Location(unsigned int BluetoothStackID, unsigned int InstanceID, Byte_t Body_Sensor_Location)

Description of API

This function is responsible for setting the location of the body sensor for the specified HRS instance. The Body_Sensor_Location parameter should be an enumerated value of the form HRS_BODY_SENSOR_LOCATION_XXX. This function will return zero if the body sensor location was successfully set or a negative return error code if there was an error condition.


ResetEnergyExpended

Description

The ResetEnergyExpended command is responsible for writing the Reset Energy Expended command to a remote Server Control Point. It can be executed only by a Client. This command will return a zero on successful execution and a negative value on all errors.

Parameters

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

Possible Return Values

(0) successfully reset energy expended (-1000) HRS_ERROR_INVALID_PARAMETER

API Call

HRS_Format_Heart_Rate_Control_Command(ccResetEnergyExpended, HRS_HEART_RATE_CONTROL_POINT_VALUE_LENGTH, CommandBuffer)

API Prototype

int BTPSAPI HRS_Format_Heart_Rate_Control_Command(HRS_Heart_Rate_Control_Command_t Command, unsigned int BufferLength, Byte_t *Buffer)

Description of API

The Format_Heart_Rate_Control_Command function is responsible for formatting a Heart Rate Control Command into a user specified buffer. The first parameter is the command to format. The final two parameters contain the length of the buffer, and the buffer, to format the command into. This function returns a zero if successful or a negative return error code if an error occurs. The BufferLength and Buffer parameter must point to a buffer of at least HRS_HEART_RATE_CONTROL_POINT_VALUE_LENGTH in size. HRS_Heart_Rate_Control_Command_t is a ccResetEnergyExpended command which is placed in the buffer.