summaryrefslogtreecommitdiff
path: root/samples/bluetooth/peripheral_hr/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/bluetooth/peripheral_hr/src/main.c')
-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 = {