Skip to content

Commit a2df179

Browse files
sgbihuSidLeung
authored andcommitted
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.
1 parent bc56500 commit a2df179

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: libraries/CurieBLE/src/BLEPeripheral.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ BLECentral BLEPeripheral::central(void)
146146

147147
bool BLEPeripheral::connected(void)
148148
{
149-
return BLE.connected();
149+
BLEDevice centralBle = BLE.central();
150+
return centralBle.connected();
150151
}
151152

152153
void BLEPeripheral::init()

0 commit comments

Comments
 (0)