cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a specific channel for advertising?

kukushonok
Associate II
Posted on March 27, 2015 at 12:23

Hello,

Please, help me to clarify the following question:

Can I set one specific channel for advertising (37 channel for example)?

I have tried to use

hci_le_set_advertising_parameters

function, but to no avail!

Regards,

Andrei Kukenov

7 REPLIES 7
Scott Löhr
Senior II
Posted on March 28, 2015 at 01:26

Are you sure that your call returns success? So something like this:

  assert(BLE_STATUS_SUCCESS == hci_le_set_advertising_parameters(

           ADV_INTERVAL_LOWEST_CONN, ADV_INTERVAL_LOWEST_CONN, ADV_IND, PUBLIC_ADDR, PUBLIC_ADDR,

           advData.brdAddr, ADV_CH_37, NO_WHITE_LIST_USE));

AND, that subsequently you only use hci to update advertising data and turn advertising on and off? I think that the higher level ACI start advertising call blows away anything you've setup with hci calls.

kukushonok
Associate II
Posted on March 30, 2015 at 09:09

Hi, Code Smith

The function hci_le_set_advertising_parameters returns fail

and

I do not have

any

idea

why

,

possibly

incorrect

sequence

.

And, yes, I think just use hci to update advertising.

Regards,

Andrei Kukenov

Posted on April 02, 2015 at 11:07

Hi,

The the stack firmware version 6.4 contains only a subset of HCI commands,

in particular the command HCI_LE_SET_ADVERTISING_PARAMETERS has been replaced by ACI_GAP_SET_DISCOVERABLE paramaeters.

for futher details, please see the ''BlueNRG, BlueNRG-MS Bluetooth LE Stacks Release Notes''.

Regards,

Graziella

Posted on April 02, 2015 at 11:16

Hi,

If you want only the HCI command, you can load the fw images:

 - bluenrg_6_4_Mode_2-16MHz-XO32K_HCI.img,

 

-  bluenrg_6_4_Mode_2-32MHz-XO32K_HCI.img''

These BlueNRG stack v6.4 binary images supporting only the HCI APIs (no GAP APIs) are provided.

Regards,

Graziella

Hi,

The the stack firmware version 6.4 contains only a subset of HCI commands,

in particular the command HCI_LE_SET_ADVERTISING_PARAMETERS has been replaced by ACI_GAP_SET_DISCOVERABLE paramaeters.

for futher details, please see the ''BlueNRG, BlueNRG-MS Bluetooth LE Stacks Release Notes''.

Regards,

Graziella

kukushonok
Associate II
Posted on April 02, 2015 at 14:16

Hello,

Thank you very much for your reply.

Regards,

Andrei Kukenov

Scott Löhr
Senior II
Posted on April 03, 2015 at 01:33

Dear Graziella / ST:

What if an application is depending on BOTH using ACI commands and some HCI commands?! Why did ST remove such a valuable command as hci_le_set_advertising_parameters()? The reason that command is so valuable is that you surely know that when using the ACI_GAP_SET_DISCOVERABLE command, the BlueNRG firmware just automatically adds onto the advertising data 2 additional items that are never explicitly asked for from the App driving the BlueNRG. Do you know of a work-around for this (i.e. how to prevent the BlueNRG from automatically adding those 2 extra items to the advertising data)?

Thanks for any hints.

Posted on April 03, 2015 at 09:36

Hi,

instead to use the command hci_le_set_advertising_parameters(), as you said, you can use the command ACI_GAP_SET_DISCOVERABLE  and the command ACI_GAP_UPDATE_ADV_DATA to update the Advertising Data.

For futher details, you can see the example of Beacon application (Fw code  under forlder ..\Projects\Project\BLE_Beacon or script under folder ..Application\scripts\BLE_Beacon).

Regards,

Graziella Marchese

Dear Graziella / ST:

What if an application is depending on BOTH using ACI commands and some HCI commands?! Why did ST remove such a valuable command as hci_le_set_advertising_parameters()? The reason that command is so valuable is that you surely know that when using the ACI_GAP_SET_DISCOVERABLE command, the BlueNRG firmware just automatically adds onto the advertising data 2 additional items that are never explicitly asked for from the App driving the BlueNRG. Do you know of a work-around for this (i.e. how to prevent the BlueNRG from automatically adding those 2 extra items to the advertising data)?

Thanks for any hints.