How can I add device name in the iBeacon advertising 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//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
ustbzhangm
Offline
Last seen:5 months 1 week ago
Joined:2015-08-24 07:50
How can I add device name in the iBeacon advertising data?

Hi,all.
I want to add device name in the advertising data.
As the maximal length of the advertising data is 0x1C (0x1F-3) bytes.
And the iBeacon data structure is:
uint8_t adv_header[2]; //static for ibeacon
uint8_t company_id[2];
uint8_t data_type; //static
uint8_t beacon_length;/ /静态
uint8_t uuid[16]; //Configurable
uint8_t major[2]; //Configurable
uint8_t minor[2]; //Configurable
uint8_t tx_power;
The iBeacon structure occupy 0x1B (27) bytes.
And then, only one byte (0x1C-0x1B) left that can be used.
So, how can I add the device name in the iBeacon advertising data?
3ks

Device:
PM_Dialog
Offline
Last seen:2 days 15 hours ago
Staff
Joined:2018-02-08 11:03
Hi ustbzhangm,

Hi ustbzhangm,

Could you please let me know which project are you using in order to advertise ibeacon packet? Are you using the beacon project or any example of the SDK> Depending how you are using the SDK and which example you are using be aware that the SDK will append any extra data that don’t fit in the advertising string in the scan response data. In the first indication (advertising indication) the advertising data will populate the data, and then in the second indication (scan response indication) the scan response data will populate the struct. In order to catch the scan response data, you should configure your device as GAPM_SCAN_ACTIVE to get a scan response. Could you please clarify which scan mode are you using in your application? GAPM_SCAN_ACTIVE or GAPM_SCAN_PASSIVE configuration?

Thanks, PM_Dialog

ustbzhangm
Offline
Last seen:5 months 1 week ago
Joined:2015-08-24 07:50
Hi, PM_Dialog.

Hi, PM_Dialog.
Thank you very much.
Yes, I want to advertise ibeacon packet. And I want to advertise extra data at the same time.
I use the Dialog reference design Battery powered Beacon project. There is no space in 'cmd->info.host.adv_data[ ]' to hold extra data.
我可以把extr吗an data in the 'cmd->info.host.scan_rsp_data[ ]' ? If I want to advertise the device name, Can I put the '\x05\x09\x54\x45\x53\x54' in the scan_rsp_data? And this will work?

ustbzhangm
Offline
Last seen:5 months 1 week ago
Joined:2015-08-24 07:50
I have tested again.

I have tested again.
In connectable mode, I can add the device name data in the response data packet. And it worked, I can get the device name while scanning by cellphone.
But in non-connectbale mode, I add the device name data in response data packet. The BLE device can not work normally. Because I can not scan the device.

ustbzhangm
Offline
Last seen:5 months 1 week ago
Joined:2015-08-24 07:50
I find a articl:

I find a articl:
Non-connectable mode A device in this mode either does not send advertising packets at all or it sends ADV_NONCONN_IND or ADV_SCAN_IND advertising packets (see Table 2-1). In both cases, the device is, as the mode name implies, not connectable, meaning that no centrals may establish a connection with it.
But I can not find "ADV_SCAN_IND" mode in the DA14580 SDK. Can the DA14580 work in ADV_SCAN_IND mode?

PM_Dialog
Offline
Last seen:2 days 15 hours ago
Staff
Joined:2018-02-08 11:03
Hi ustbzhangm,

Hi ustbzhangm,

The ADV_SCAN_IND packets (scannable undirected advertising) are non-connectable packets and you will be able to send scan response data in the case of a scan request. In order to activate those kind of packets in the SDK you will have to set the scan response data and the SDK will send those kind of packets. But, be aware that there is no detection if the scanner is configured as GAPM_SCAN_ACTIVE, and as a result the peripheral will always have the receiver open. This means that when the peripheral transmitting data during the advertising event, it will also open the receiver for hearing scan requests. So the device will always send scan responses when it gets a scan request.

Thanks, PM_Dialog