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.