From 7dc5596de70996f39f4f6a571ed8a9b963da0771 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 10 Feb 2016 12:16:59 +0200 Subject: [PATCH] drivers/nble: Pass correct handle in bt_gatt_notify Change-Id: I90d85e681e4274722ed94dce839287e5868a93af Signed-off-by: Johan Hedberg --- drivers/nble/gatt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/nble/gatt.c b/drivers/nble/gatt.c index 82b1a393cb2..bdfb125a9d2 100644 --- a/drivers/nble/gatt.c +++ b/drivers/nble/gatt.c @@ -15,11 +15,13 @@ */ #include +#include #include #include #include +#include "conn_internal.h" #include "gatt_internal.h" #define NBLE_BUF_SIZE 384 @@ -354,7 +356,12 @@ int bt_gatt_notify(struct bt_conn *conn, const struct bt_gatt_attr *attr, { struct ble_gatt_send_notif_ind_params notif; - notif.conn_handle = 0xFFFF; + if (conn) { + notif.conn_handle = conn->handle; + } else { + notif.conn_handle = 0xffff; + } + notif.params.attr = (struct bt_gatt_attr *)attr; notif.params.offset = 0;