Diff between b54b7e535a3cb070f105d761289b4b2d8c0d7cd0 and 3140ddd6fed4d5a294cf1f5350dc225533c3b1d4

Changed Files

File Additions Deletions Status
profiles/gatt/gas.c +5 -0 modified

Full Patch

diff --git a/profiles/gatt/gas.c b/profiles/gatt/gas.c
index a828fcd..b42aa64 100644
--- a/profiles/gatt/gas.c
+++ b/profiles/gatt/gas.c
@@ -146,6 +146,11 @@ static void indication_cb(const uint8_t *pdu, uint16_t len, gpointer user_data)
 
 	DBG("Service Changed start: 0x%04X end: 0x%04X", start, end);
 
+	if (device_is_bonded(gas->device) == FALSE) {
+		DBG("Ignoring Service Changed: device is not bonded");
+		return;
+	}
+
 	/* Confirming indication received */
 	opdu = g_attrib_get_buffer(gas->attrib, &plen);
 	olen = enc_confirmation(opdu, plen);