cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize the advertising packet?

dimitar
Associate II
Posted on January 09, 2015 at 18:46

Hi,

I'm trying to customize the advertising packet, but it's unsuccessful so far.

I use STEVAL-IDB002V1

BlueNRG HW v3.0

BlueNRG FW v6.4

Motherboard FW v1.4

Since the command ACI_GAP_SET_DISCOVARABLE doesn't give much options I've tried to use  HCI_LE_SET_ADVERTISING_PARAMETERS , HCI_LE_Set_Advertizing_Data, HCI_LE_SET_ADVERTISE_ENABLE.

The response to  HCI_LE_SET_ADVERTISING_PARAMETERS and HCI_LE_SET_ADVERTISE_ENABLE is Unknown HCI Command.

Are these supported commands?

Is there any other way to customize the advertising and scan packet?

Thanks

11 REPLIES 11
Scott Löhr
Senior II
Posted on January 09, 2015 at 18:56

Using the BlueNRG X-NUCLEO-IDB04A1 running FW 6.3, I have been able to successfully control the advertising data to whatever I want with this:

  uint8_t advData[31] = {  the specific bytes I want, using the advertising data format of  

    ''LENGTH-TYPE-DATA'', so e.g. 0x06, 0xFF, 'H', 'e', 'l', 'l', 'o'

    };

  rtrnVal = hci_le_set_advertising_data(sizeof(advData), (uint8_t const*)&advData);

Note that I also use this to start advertising:

  rtrnVal = hci_le_set_advertise_enable(true);

dimitar
Associate II
Posted on January 09, 2015 at 22:08

I programmed the bluenrg_6_4_Mode_2-16MHz-XO32K_HCI.img and now the HCI_LE_SET_ADVERTISING_PARAMETERS and HCI_LE_SET_ADVERTISE_ENABLE complete successfully, but during scanning the software doesn't show any data. It shows only the BLE address.

First I run the Initialization script to start the GAT and GAPP and then

send HCI_LE_SET_ADVERTISING_PARAMETERS (ADV_IND, advertise on all channels..)

send HCI_LE_SET_ADVERTISING_DATA

Parameter Total Length 0x20

Advertising_Data_Length 0x0F

Advertising_Data 0x0201060808426C75654D4641020AFE00000000000000000000000000000000

send HCI_LE_SET_ADVERTISE_ENABLE

For scanning I use nRF Master Control on my tablet and it shows only the bluetooth address.

Do I need to setup something else?

Posted on January 21, 2015 at 13:09

Hi Dimitar,

To customize the Advertising packet, you should use the command ACI_GAP_UPDATE_ADV_DATA where the advData has to be formatted as specified in Bluetooth specification (volume 3, Part C, 11).

Instead, If you use the HCI command, you don't send the commands GATT_init and GAP_init.

Regards,

Graziella

Hi,

I'm trying to customize the advertising packet, but it's unsuccessful so far.

I use STEVAL-IDB002V1

BlueNRG HW v3.0

BlueNRG FW v6.4

Motherboard FW v1.4

Since the command ACI_GAP_SET_DISCOVARABLE doesn't give much options I've tried to use  HCI_LE_SET_ADVERTISING_PARAMETERS , HCI_LE_Set_Advertizing_Data, HCI_LE_SET_ADVERTISE_ENABLE.

The response to  HCI_LE_SET_ADVERTISING_PARAMETERS and HCI_LE_SET_ADVERTISE_ENABLE is Unknown HCI Command.

Are these supported commands?

Is there any other way to customize the advertising and scan packet?

Thanks

kukushonok
Associate II
Posted on March 24, 2015 at 10:12

Hello, Guys

Dimitar, you can use the following sample http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00099259.pdf page 50

This example work fine on my board (fw 6.4)

If you need additional information, please, feel free to ack me.

Regards,

Andrei Kukenov

lucaleonardi.919
Associate II
Posted on September 15, 2015 at 11:36

Hi,

I'm trying to customize the advertising packet, but it's unsuccessful so far.

I use STEVAL-IDB002V1

I followed the following information of BlueNRG Beacon demonstration application:

<<

The BLE Beacon device uses the GAP ACI command to enter non-connectable mode as

follows:

aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR,

NO_WHITE_LIST_USE,0, NULL, 0, NULL, 0, 0);

In order to advertise the specific selected manufacturer data, the BLE Beacon application

uses the following GAP ACIs:

/* Remove TX power level field from the advertising data: it is necessary to have enough

space for the beacon manufacturing data */

ret = aci_gap_delete_ad_type(AD_TYPE_TX_POWER_LEVEL);

/* Define the beacon manufacturing payload */

const uint8_t manuf_data[] = {26, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,

0x30, 0x00, //Company identifier code (Default is 0x0030 - STMicroelectronics)

0x02, // ID

0x15, //Length of the remaining payload

0xE2, 0x0A, 0x39, 0xF4, 0x73, 0xF5, 0x4B, 0xC4, //Location UUID

0xA1, 0x2F, 0x17, 0xD1, 0xAD, 0x07, 0xA9, 0x61,

0x00, 0x00, // Major number

0x00, 0x00, // Minor number

0xC8 //2's complement of the Tx power (-56dB)};

};

/* Set the beacon manufacturing data on the advertising packet */

ret = aci_gap_update_adv_data(27, manuf_data);

>>

Unfortunately, the receiver does not detect event so I don't know if the advertisement is received.

What's the matter?

Is there any other way to send the advertising and detect advertisement packet on the receiver?

Thanks

Posted on September 17, 2015 at 16:25

Hi Luca,

Which stack fw version are you using?

Are you yuo download the latest version of GUI DK from

http://www.st.com

?

Could you give us major information? for example who is the receiver and how is it configured?

Regards,

Graziella Marchese

Hi,

I'm trying to customize the advertising packet, but it's unsuccessful so far.

I use STEVAL-IDB002V1

I followed the following information of BlueNRG Beacon demonstration application:

<<

The BLE Beacon device uses the GAP ACI command to enter non-connectable mode as

follows:

aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR,

NO_WHITE_LIST_USE,0, NULL, 0, NULL, 0, 0);

In order to advertise the specific selected manufacturer data, the BLE Beacon application

uses the following GAP ACIs:

/* Remove TX power level field from the advertising data: it is necessary to have enough

space for the beacon manufacturing data */

ret = aci_gap_delete_ad_type(AD_TYPE_TX_POWER_LEVEL);

/* Define the beacon manufacturing payload */

const uint8_t manuf_data[] = {26, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,

0x30, 0x00, //Company identifier code (Default is 0x0030 - STMicroelectronics)

0x02, // ID

0x15, //Length of the remaining payload

0xE2, 0x0A, 0x39, 0xF4, 0x73, 0xF5, 0x4B, 0xC4, //Location UUID

0xA1, 0x2F, 0x17, 0xD1, 0xAD, 0x07, 0xA9, 0x61,

0x00, 0x00, // Major number

0x00, 0x00, // Minor number

0xC8 //2's complement of the Tx power (-56dB)};

};

/* Set the beacon manufacturing data on the advertising packet */

ret = aci_gap_update_adv_data(27, manuf_data);

>>

Unfortunately, the receiver does not detect event so I don't know if the advertisement is received.

What's the matter?

Is there any other way to send the advertising and detect advertisement packet on the receiver?

Thanks

lucaleonardi.919
Associate II
Posted on November 06, 2015 at 18:06

Hi, I use FW v7.1 and I have downloaded BLUENRG GUI v1.8.0.

My server does this operation:

const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G','_','C','h','a','t'};

    

    /* disable scan response */

    hci_le_set_scan_resp_data(0,NULL);

    

    PRINTF(''General Discoverable Mode '');

    ret = aci_gap_set_discoverable(ADV_IND, 0, 0, PUBLIC_ADDR, NO_WHITE_LIST_USE,

                                 13, local_name, 0, NULL, 0, 0);

And my client does this operation:

ret = aci_gap_start_general_discovery_proc(0x4000, 0x4000,PUBLIC_ADDR,0x00);

The problem is that my client don't receive any EVT_BLUE_GAP_DEVICE_FOUND but goes directly in EVT_BLUE_GAP_PROCEDURE_COMPLETE so I don't see any device.

In this case I don't customize advertisment but I need to identify the device in my area.

What can I do?

Thanks

lucaleonardi.919
Associate II
Posted on November 09, 2015 at 09:18

Dear Customer,

 Evt_Blue_Gap_Device_Found event is not anymore returned from BlueNRG-MS stack v7.1 when a device is found during a discovery procedure, the LE_Advertising_Report event is returned from BlueNRG-MS stack v7.1 when a device is found durign a device discovery procedure.

(Please see the release Note for futher information).

Regards,

GM