fix
This commit is contained in:
parent
e955b10b4c
commit
19984c9913
12
ESPBMS.ino
12
ESPBMS.ino
@ -66,7 +66,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get remote service
|
// Get remote service
|
||||||
Serial.print("Get remote service...");
|
Serial.println("Get remote service...");
|
||||||
BLERemoteService* pRemoteService = pClient->getService(serviceUUID);
|
BLERemoteService* pRemoteService = pClient->getService(serviceUUID);
|
||||||
if (pRemoteService == nullptr){
|
if (pRemoteService == nullptr){
|
||||||
Serial.println(String("BLE: failed to find service UUID"));
|
Serial.println(String("BLE: failed to find service UUID"));
|
||||||
@ -77,7 +77,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get BMS receive characteristic
|
// Get BMS receive characteristic
|
||||||
Serial.print("Get BMS receive characteristic...");
|
Serial.println("Get BMS receive characteristic...");
|
||||||
BLERemoteCharacteristic* pRemoteCharacteristic_rx = pRemoteService->getCharacteristic(charUUID_rx);
|
BLERemoteCharacteristic* pRemoteCharacteristic_rx = pRemoteService->getCharacteristic(charUUID_rx);
|
||||||
if (pRemoteCharacteristic_rx == nullptr){
|
if (pRemoteCharacteristic_rx == nullptr){
|
||||||
Serial.println(String("BLE: failed to find RX UUID"));
|
Serial.println(String("BLE: failed to find RX UUID"));
|
||||||
@ -88,7 +88,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Register callback for remote characteristic (receive channel)
|
// Register callback for remote characteristic (receive channel)
|
||||||
Serial.print("Get BMS receive characteristic...");
|
Serial.println("Get BMS receive characteristic...");
|
||||||
if (pRemoteCharacteristic_rx->canNotify()){
|
if (pRemoteCharacteristic_rx->canNotify()){
|
||||||
pRemoteCharacteristic_rx->registerForNotify(MyNotifyCallback);
|
pRemoteCharacteristic_rx->registerForNotify(MyNotifyCallback);
|
||||||
}else{
|
}else{
|
||||||
@ -99,7 +99,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get BMS transmit characteristic
|
// Get BMS transmit characteristic
|
||||||
Serial.print("Get BMS transmit characteristic...");
|
Serial.println("Get BMS transmit characteristic...");
|
||||||
BLERemoteCharacteristic* pRemoteCharacteristic_tx = pRemoteService->getCharacteristic(charUUID_tx);
|
BLERemoteCharacteristic* pRemoteCharacteristic_tx = pRemoteService->getCharacteristic(charUUID_tx);
|
||||||
if (pRemoteCharacteristic_tx == nullptr){
|
if (pRemoteCharacteristic_tx == nullptr){
|
||||||
Serial.println(String("BLE: failed to find TX UUID"));
|
Serial.println(String("BLE: failed to find TX UUID"));
|
||||||
@ -110,7 +110,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check whether tx is writeable
|
// Check whether tx is writeable
|
||||||
Serial.print("Check whether tx is writeable...");
|
Serial.println("Check whether tx is writeable...");
|
||||||
if (!(pRemoteCharacteristic_tx->canWriteNoResponse())){
|
if (!(pRemoteCharacteristic_tx->canWriteNoResponse())){
|
||||||
Serial.println(String("BLE: failed TX remote characteristic is not writable"));
|
Serial.println(String("BLE: failed TX remote characteristic is not writable"));
|
||||||
Serial.println("Failed TX remote characteristic is not writable");
|
Serial.println("Failed TX remote characteristic is not writable");
|
||||||
@ -118,7 +118,7 @@ void loop() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.print("Get data...");
|
Serial.println("Get data...");
|
||||||
|
|
||||||
gotBasicInfo=false;
|
gotBasicInfo=false;
|
||||||
gotCellInfo=false;
|
gotCellInfo=false;
|
||||||
|
Loading…
Reference in New Issue
Block a user