summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2016-02-10 11:59:41 +0200
committerAnas Nashif <anas.nashif@intel.com>2016-02-10 19:13:01 -0500
commitf23f8c3e966898c0e106552782eafb1c7279d69c (patch)
treeaf4fccbb10f3458680a4927e3d0406652d08d539 /samples
parentedd64e074684428adac2099f783c7c32ae9ce183 (diff)
Bluetooth: samples/peripheral_hr: Add adv-restart hack for nble
Force restarting advertising until nble is able to handle this by itself. Change-Id: Ife811eb69a63b98b3b0380b80e403d5d9dc10f22 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/bluetooth/peripheral_hr/src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/samples/bluetooth/peripheral_hr/src/main.c b/samples/bluetooth/peripheral_hr/src/main.c
index b1a63b3f3..22cab799a 100644
--- a/samples/bluetooth/peripheral_hr/src/main.c
+++ b/samples/bluetooth/peripheral_hr/src/main.c
@@ -175,6 +175,14 @@ static void connected(struct bt_conn *conn, uint8_t err)
static void disconnected(struct bt_conn *conn, uint8_t reason)
{
printk("Disconnected (reason %u)\n", reason);
+
+#if defined(CONFIG_NBLE)
+ /* FIXME: Remove this once nble is capable restarting advertising */
+ if (bt_le_adv_start(BT_LE_ADV(BT_LE_ADV_IND), ad, ARRAY_SIZE(ad),
+ sd, ARRAY_SIZE(sd))) {
+ printk("Advertising failed to restart\n");
+ }
+#endif
}
static struct bt_conn_cb conn_callbacks = {