SWRA772 august   2023 CC2564C

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Running the Bluetooth Code
  6. Demo Application
    1. 3.1 Device 1 (Server) Setup on the Demo Application
    2. 3.2 Device 2 (Client) Setup on the Demo Application
    3. 3.3 Initiating Connection from Device 2
    4. 3.4 Identify Supported Services
    5. 3.5 Data Transfer Between Client and Server
    6. 3.6 Multiple SPPLE Connections Guide
  7. Demonstrating SPP LE on an iOS Device with the LightBlue App
    1. 4.1 LightBlue Overview
    2. 4.2 SPP LE Service Overview
      1. 4.2.1 Characteristics
  8. LightBlue as the Client/SPPLEDemo as the Server
    1. 5.1 Connecting the Devices
    2. 5.2 Enabling Notifications
    3. 5.3 Sending Data from LightBlue/Receiving Data in SPPLEDemo
    4. 5.4 Sending Data from SPPLEDemo/Receiving Data in LightBlue
  9. LightBlue as the Server/SPPLEDemo as the Client
    1. 6.1 Connecting the Devices
    2. 6.2 Sending Data from LightBlue/Receiving Data in SPPLEDemo
    3. 6.3 Sending Data from SPPLEDemo/Receiving Data in LightBlue
  10. Application Commands
  11. General Commands
    1. 8.1 Help (DisplayHelp)
    2. 8.2 Get Local Address
    3. 8.3 Set Baud Rate
    4. 8.4 Quit
  12. BR/EDR Commands
  13. 10GAPLE Commands
    1. 10.1  Set Discoverability Mode
    2. 10.2  Set Connectability Mode
    3. 10.3  Set Pairability Mode
    4. 10.4  Change Pairing Parameters
    5. 10.5  Advertise LE
    6. 10.6  Start Scanning
    7. 10.7  Stop Scanning
    8. 10.8  Connect LE
    9. 10.9  Disconnect LE
    10. 10.10 Pair LE
    11. 10.11 LE Pass Key Response
    12. 10.12 LE Query Encryption
    13. 10.13 Set Passkey
    14. 10.14 Discover GAPS
    15. 10.15 Get Local Name
    16. 10.16 Set Local Name
    17. 10.17 Get Remote Name
    18. 10.18 LE User Confirmation Response
    19. 10.19 Enable SC Only
    20. 10.20 Regenerate P256 Local Keys
    21. 10.21 SC Generate OOB Local Params
    22. 10.22 Set Local Appearance
    23. 10.23 Get Local Appearance
  14. 11SPPLE Commands
    1. 11.1 Discover SPPLE
    2. 11.2 Register SPPLE
    3. 11.3 LE Send
    4. 11.4 Configure SPPLE
    5. 11.5 LE Read
    6. 11.6 Loopback
    7. 11.7 Display Raw Mode Data
    8. 11.8 Automatic Read Mode
  15. 12References
  16. 13Revision History

Advertise LE

Description

The AdvertiseLE command is responsible for enabling LE advertisements. This command returns zero on successful execution and a negative value on all errors.

Parameters

The only parameter necessary decides whether advertising reports are sent or are disabled. To disable, use 0 as the first parameter, to enable, use 1 instead.

Command Call Examples

  • “AdvertiseLE 1” Attempts to enable Low Energy Advertising on the local Bluetooth device.
  • “AdvertiseLE 0” Attempts to disable Low Energy Advertising on the local Bluetooth device.

Possible Return Values

  • (0) Successfully Set Pairability Mode
  • (-4) FUNCTION_ERROR
  • (-6) INVALID_PARAMETERS_ERROR
  • (-8) INVALID_STACK_ID_ERROR
  • (-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-1) BTPS_ERROR_INVALID_PARAMETER
  • (-56) BTPS_ERROR_GAP_NOT_INITIALIZED
  • (-104) BTPS_ERROR_LOCAL_CONTROLLER_DOES_NOT_SUPPORT_LE
  • (-57) BTPS_ERROR_DEVICE_HCI_ERROR

API Calls

Depending on the First Parameter Value:

  • GAP_LE_Advertising_Disable(BluetoothStackID)
  • GAP_LE_Set_Advertising_Data(BluetoothStackID, (Advertisement_Data_Buffer.AdvertisingData.Advertising_Data[0] + 1), &(Advertisement_Data_Buffer.AdvertisingData))
  • GAP_LE_Set_Scan_Response_Data(BluetoothStackID, (Advertisement_Data_Buffer.ScanResponseData.Scan_Response_Data[0] + 1), &(Advertisement_Data_Buffer.ScanResponseData))
  • GAP_LE_Advertising_Enable(BluetoothStackID, TRUE, &AdvertisingParameters, &ConnectabilityParameters, GAP_LE_Event_Callback, 0)

API Prototypes

  • int BTPSAPI GAP_LE_Advertising_Disable(unsigned int BluetoothStackID)
  • int BTPSAPI GAP_LE_Set_Advertising_Data(unsigned int BluetoothStackID, unsigned int Length, Advertising_Data_t *Advertising_Data)
  • int BTPSAPI GAP_LE_Set_Scan_Response_Data(unsigned int BluetoothStackID, unsigned int Length, Scan_Response_Data_t *Scan_Response_Data)
  • int BTPSAPI GAP_LE_Set_Advertising_Data(unsigned int BluetoothStackID, unsigned int Length, Advertising_Data_t *Advertising_Data)
  • int BTPSAPI GAP_LE_Set_Advertising_Data(unsigned int BluetoothStackID, unsigned int Length, Advertising_Data_t *Advertising_Data)

Description of API

  • The GAP_LE_Advertising_Disable function is provided to allow the local host the ability to cancel (stop) an on-going advertising procedure. This function returns zero if successful or a negative return error code if there was an error condition.
  • The GAP_LE_Set_Advertising_Data is provided to allow the local host the ability to set the advertising data that is used during the advertising procedure (started via the GAP_LE_Advertising_Enable function). This function returns zero if successful or a negative return error code if there was an error condition.
  • The GAP_LE_Set_Scan_Response_Data function is provided to allow the local host the ability to set the advertising data that is used during the advertising procedure (started via the GAP_LE_Advertising_Enable function). This function returns zero if successful or a negative return error code if there was an error condition.
  • TheGAP_LE_Set_Advertising_Data function is provided to allow the local host the ability to set the advertising data that is used during the advertising procedure (started via theGAP_LE_Advertising_Enable function). This function returns zero if successful or a negative return error code if there was an error condition.