mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
fix: fix typo
This commit is contained in:
@@ -140,7 +140,7 @@ protected:
|
||||
this->initBleNotify = false;
|
||||
|
||||
// Connect to the remote BLE Server.
|
||||
BLEAddress bleServerAddress(settings.sensors.indoor.bleAddresss);
|
||||
BLEAddress bleServerAddress(settings.sensors.indoor.bleAddress);
|
||||
if (!pBleClient->connect(bleServerAddress)) {
|
||||
Log.swarningln(FPSTR(L_SENSORS_BLE), "Failed connecting to device at %s", bleServerAddress.toString().c_str());
|
||||
return;
|
||||
|
||||
@@ -130,7 +130,7 @@ struct Settings {
|
||||
struct {
|
||||
SensorType type = SensorType::MANUAL;
|
||||
byte gpio = DEFAULT_SENSOR_INDOOR_GPIO;
|
||||
uint8_t bleAddresss[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
uint8_t bleAddress[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
float offset = 0.0f;
|
||||
} indoor;
|
||||
} sensors;
|
||||
|
||||
22
src/utils.h
22
src/utils.h
@@ -410,14 +410,14 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
sprintf(
|
||||
bleAddress,
|
||||
"%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
src.sensors.indoor.bleAddresss[0],
|
||||
src.sensors.indoor.bleAddresss[1],
|
||||
src.sensors.indoor.bleAddresss[2],
|
||||
src.sensors.indoor.bleAddresss[3],
|
||||
src.sensors.indoor.bleAddresss[4],
|
||||
src.sensors.indoor.bleAddresss[5]
|
||||
src.sensors.indoor.bleAddress[0],
|
||||
src.sensors.indoor.bleAddress[1],
|
||||
src.sensors.indoor.bleAddress[2],
|
||||
src.sensors.indoor.bleAddress[3],
|
||||
src.sensors.indoor.bleAddress[4],
|
||||
src.sensors.indoor.bleAddress[5]
|
||||
);
|
||||
dst["sensors"]["indoor"]["bleAddresss"] = String(bleAddress);
|
||||
dst["sensors"]["indoor"]["bleAddress"] = String(bleAddress);
|
||||
dst["sensors"]["indoor"]["offset"] = roundd(src.sensors.indoor.offset, 2);
|
||||
|
||||
if (!safe) {
|
||||
@@ -1250,13 +1250,13 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
|
||||
#if USE_BLE
|
||||
if (!src["sensors"]["indoor"]["bleAddresss"].isNull()) {
|
||||
String value = src["sensors"]["indoor"]["bleAddresss"].as<String>();
|
||||
if (!src["sensors"]["indoor"]["bleAddress"].isNull()) {
|
||||
String value = src["sensors"]["indoor"]["bleAddress"].as<String>();
|
||||
int tmp[6];
|
||||
if(sscanf(value.c_str(), "%02x:%02x:%02x:%02x:%02x:%02x", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) == 6) {
|
||||
for(uint8_t i = 0; i < 6; i++) {
|
||||
if (dst.sensors.indoor.bleAddresss[i] != (uint8_t) tmp[i]) {
|
||||
dst.sensors.indoor.bleAddresss[i] = (uint8_t) tmp[i];
|
||||
if (dst.sensors.indoor.bleAddress[i] != (uint8_t) tmp[i]) {
|
||||
dst.sensors.indoor.bleAddress[i] = (uint8_t) tmp[i];
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user