From a2df1795ac275ac48485329dc0697ab2324715bf Mon Sep 17 00:00:00 2001 From: lianggao Date: Mon, 20 Feb 2017 09:39:50 +0800 Subject: [PATCH] Jira 857, BLEPeripheral::connected() always returns false, git 444 Root casue: - The stack need use connected device to get the state. - The current code used local address to get the link and get an error. Code mods: 1. BLEPeripheral.cpp: - Use central's address to get connection state. --- libraries/CurieBLE/src/BLEPeripheral.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/CurieBLE/src/BLEPeripheral.cpp b/libraries/CurieBLE/src/BLEPeripheral.cpp index 760d374f..9fa572e2 100644 --- a/libraries/CurieBLE/src/BLEPeripheral.cpp +++ b/libraries/CurieBLE/src/BLEPeripheral.cpp @@ -146,7 +146,8 @@ BLECentral BLEPeripheral::central(void) bool BLEPeripheral::connected(void) { - return BLE.connected(); + BLEDevice centralBle = BLE.central(); + return centralBle.connected(); } void BLEPeripheral::init()