Advertising with scan response data

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
moguilevski
Offline
Last seen: 3 weeks 3 days ago
Joined: 2019-04-30 12:25
Advertising with scan response data

Dear Dialog team,

 

I'm to use ADV_SCAN_IND packet for advertising using barebone example. However, when I fill the USER_ADVERTISE_SCAN_RESPONSE_DATA with data (< 31 bytes), like it is shown in the cutout

/// Scan response data
#define USER_ADVERTISE_SCAN_RESPONSE_DATA "\x64\x75\x6D\x6D\x79\x20\x64\x61\x74\x61"

the code execution breaks at advertising start. Are there any other rules for the payload to be taken into account, except of the size limitation? What other steps are needed to use this advertisment type properly? Are the connections allowed in this case?

Device: 
PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi moguilevski,

Hi moguilevski,

The advertising string and the scan response data should follow a specific format. The manufacturer specific data is a flag that developer could include his own data and populate them while the device is advertising. In order to add custom data into the advertising string, the format should be like <length><tag><data>.

Below is an example :

#define MAN_DATA "\x64\x75\x6D\x6D\x79\x20\x64\x61\x74\x61"

#define MAN_DATA_LEN "\x0B"

#define USER_ADVERTISE_SCAN_RESPONSE_DATA 	MAN_DATA_LEN\
								ADV_TYPE_MANUFACTURER_SPECIFIC_DATA\
								MAN_DATA

Please more details on BLE Advertising Tutorial (HTML) .

Thanks, PM_Dialog

moguilevski
Offline
Last seen: 3 weeks 3 days ago
Joined: 2019-04-30 12:25
Hello PM_Dialog,

Hello PM_Dialog,

thank you very much for the answer. Futhermore, I would like to ask you another related question:

is there any possibility to put a custom data field into the advertisment or the scan pesponse payload, which is not included in the general bluetooth specifications (AD type list: 0x01 - 0x2D, 0x3D, 0xFF)?

PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi moguilevski,

Hi moguilevski,

If you would like to store custom data into the advertising or scan response data, you should follow my previous reply and use the manufacturer specific data.

Thanks, PM_Dialog

moguilevski
Offline
Last seen: 3 weeks 3 days ago
Joined: 2019-04-30 12:25
Thank you.

Thank you.