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

SetBatteryLevel

Description

The following function is responsible for setting the Battery Level of the LE device. This function takes an unsigned integer as a parameter for the desired battery level and returns zero for success or a negative number indicating an error.

Parameters

The only parameter required is battery level.

Command Call Examples

SetBatteryLevel 100 attempts to set the battery level to 100.

Possible Return Values

(0) MAP_Close_Server() Success

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR


NotifyBatteryLevel

Description

The following function is responsible for notifying the battery level to the connected host device (if the device has registered for notifications). This function takes no parameters and returns zero on success or a negative number indicating an error.

Parameters

The only parameter required is battery level.

Command Call Examples

NotifyBatteryLevel 100 attempts to notify the battery level to 100.

Possible Return Values

(0) MAP_Close_Server() Success

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-1000) BAS_ERROR_INVALID_PARAMETER

(-1001) BAS_ERROR_INVALID_BLUETOOTH_STACK_ID

(-1002) BAS_ERROR_INSUFFICIENT_RESOURCES

(-1003) BAS_ERROR_SERVICE_ALREADY_REGISTERED

(-1004) BAS_ERROR_INVALID_INSTANCE_ID

(-1005) BAS_ERROR_MALFORMATTED_DATA

(-1006) BAS_ERROR_MAXIMUM_NUMBER_OF_INSTANCES_REACHED

(-1007) BAS_ERROR_UNKNOWN_ERROR

API Call

BAS_Notify_Battery_Level(ApplicationStateInfo.BluetoothStackID, ApplicationStateInfo.BASInstanceID, ApplicationStateInfo.LEConnectionInfo.ConnectionID, (Byte_t)ApplicationStateInfo.BatteryLevel);

API Prototype

int BTPSAPI BAS_Notify_Battery_Level(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, Byte_t BatteryLevel);

Description of API

The following function is responsible for sending a Battery Level Status notification 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 BAS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. The final parameter contains the Battery Level to send to the remote device. This function returns a zero if successful or a negative return error code if an error occurs.


NotifyKeyboardReport

Description

The following function is responsible for notifying a report to the connected host device (if the device has registered for notifications). The function takes a string parameter that contains an alpha-numeric character that should be included in the report to be notified. This function returns zero on success or a negative number indicating an error.

Parameters

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

Possible Return Values

(0) MAP_Close_Server() Success

(-4) FUNCTION_ERROR

(-6) INVALID_PARAMETERS_ERROR

(-8) INVALID_STACK_ID_ERROR

(-1000)HIDS_ERROR_INVALID_PARAMETER (-1001)HIDS_ERROR_INVALID_BLUETOOTH_STACK_ID (-1002)HIDS_ERROR_INSUFFICIENT_RESOURCES (-1003)HIDS_ERROR_SERVICE_ALREADY_REGISTERED (-1004)HIDS_ERROR_INVALID_INSTANCE_ID (-1005)HIDS_ERROR_MALFORMATTED_DATA (-1006)HIDS_ERROR_INDICATION_OUTSTANDING (-1007)HIDS_ERROR_UNKNOWN_ERROR

API Call

HIDS_Notify_Input_Report(ApplicationStateInfo.BluetoothStackID, ApplicationStateInfo.HIDSInstanceID, ApplicationStateInfo.LEConnectionInfo.ConnectionID, rtBootKeyboardInputReport, NULL, HID_KEYBOARD_INPUT_REPORT_SIZE, ApplicationStateInfo.CurrentInputReport);

API Prototype

int BTPSAPI HIDS_Notify_Input_Report(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, HIDS_Report_Type_t ReportType, HIDS_Report_Reference_Data_t *ReportReferenceData, Word_t InputReportLength, Byte_t *InputReportData)

Description of API

The following function is responsible for sending an Input Report notification 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 HIDS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. The fourth parameter specifies the ReportType of the report that is to be notified. The fifth parameter is a pointer to a Report Reference structure that is only used (and must be specified only if) the ReportType is rtInputReport. The final parameters contain the length of the Input Report and a pointer to the Input Report that is to be notified. This function returns the number of bytes that were successfully notified on success or a negative return error code if an error occurs.

Note: The only valid values that ReportType may be set to are as follows:
rtReport (Input Report Only) rtBootKeyboardInputReport rtBootMouseInputReport
Note: If the ReportType is rtReport, then the ReportReferenceData must be valid and point to a Report Reference structure of the Input Report to be notified. Otherwise the ReportReferenceData parameter can be NULL.