Skip to content
Permalink
Browse files

samples: bluetooth: ibeacon: change to ADV_NONCONN_IND type

According to the Apple iBeacon spec chapter "2.1 Advertising Packet",
"beacons must use a non connectable undirected Advertising PDU,
ADV_NONCONN_IND". Refer to https://developer.apple.com/ibeacon/

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
  • Loading branch information...
overheat authored and jhedberg committed May 3, 2019
1 parent ffcbf12 commit 631cd007bd0f2ffa152276a0b0419d2737ce03fb
Showing with 1 addition and 10 deletions.
  1. +0 −1 samples/bluetooth/ibeacon/prj.conf
  2. +1 −9 samples/bluetooth/ibeacon/src/main.c
@@ -1,3 +1,2 @@
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_DEVICE_NAME="Zephyr iBeacon Demo"
@@ -12,9 +12,6 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>

#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)

#ifndef IBEACON_RSSI
#define IBEACON_RSSI 0xc8
#endif
@@ -43,11 +40,6 @@ static const struct bt_data ad[] = {
IBEACON_RSSI) /* Calibrated RSSI @ 1m */
};

/* Set Scan Response data */
static const struct bt_data sd[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
};

static void bt_ready(int err)
{
if (err) {
@@ -59,7 +51,7 @@ static void bt_ready(int err)

/* Start advertising */
err = bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad),
sd, ARRAY_SIZE(sd));
NULL, 0);
if (err) {
printk("Advertising failed to start (err %d)\n", err);
return;

0 comments on commit 631cd00

Please sign in to comment.
You can’t perform that action at this time.