Fix iBeacons ids
This commit is contained in:
parent
c2e994c7e9
commit
0a23b48999
|
@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.5.0]
|
||||||
|
|
||||||
|
- Breaking Change: iBeacon id's were backwards, they are now correct and match HA Companion
|
||||||
|
- Bump NimBLE to 1.3.1
|
||||||
|
|
||||||
## [1.4.4]
|
## [1.4.4]
|
||||||
|
|
||||||
- Additional sonos fingerprinting
|
- Additional sonos fingerprinting
|
||||||
|
|
|
@ -84,13 +84,7 @@ void BleFingerprint::fingerprint(BLEAdvertisedDevice *advertisedDevice)
|
||||||
{
|
{
|
||||||
BLEBeacon oBeacon = BLEBeacon();
|
BLEBeacon oBeacon = BLEBeacon();
|
||||||
oBeacon.setData(strManufacturerData);
|
oBeacon.setData(strManufacturerData);
|
||||||
|
pid = Sprintf("iBeacon:%s-%d-%d", std::string(oBeacon.getProximityUUID()).c_str(), ENDIAN_CHANGE_U16(oBeacon.getMajor()), ENDIAN_CHANGE_U16(oBeacon.getMinor()));
|
||||||
String proximityUUID = getProximityUUIDString(oBeacon);
|
|
||||||
|
|
||||||
int major = ENDIAN_CHANGE_U16(oBeacon.getMajor());
|
|
||||||
int minor = ENDIAN_CHANGE_U16(oBeacon.getMinor());
|
|
||||||
|
|
||||||
pid = "iBeacon:" + proximityUUID + "-" + major + "-" + minor;
|
|
||||||
calRssi = oBeacon.getSignalPower();
|
calRssi = oBeacon.getSignalPower();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -23,26 +23,3 @@ static int median_of_3(int a, int b, int c)
|
||||||
int the_median = the_max ^ the_min ^ a ^ b ^ c;
|
int the_median = the_max ^ the_min ^ a ^ b ^ c;
|
||||||
return (the_median);
|
return (the_median);
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getProximityUUIDString(BLEBeacon beacon)
|
|
||||||
{
|
|
||||||
std::string serviceData = beacon.getProximityUUID().toString().c_str();
|
|
||||||
int serviceDataLength = serviceData.length();
|
|
||||||
String returnedString = "";
|
|
||||||
int i = serviceDataLength;
|
|
||||||
while (i > 0)
|
|
||||||
{
|
|
||||||
if (serviceData[i - 1] == '-')
|
|
||||||
{
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
char a = serviceData[i - 1];
|
|
||||||
char b = serviceData[i - 2];
|
|
||||||
returnedString += b;
|
|
||||||
returnedString += a;
|
|
||||||
|
|
||||||
i -= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnedString;
|
|
||||||
}
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ lib_deps_external =
|
||||||
marvinroger/AsyncMqttClient@^0.9.0
|
marvinroger/AsyncMqttClient@^0.9.0
|
||||||
bblanchon/ArduinoJson@^6.17.3
|
bblanchon/ArduinoJson@^6.17.3
|
||||||
juerd/ESP-WiFiSettings@^3.7.2
|
juerd/ESP-WiFiSettings@^3.7.2
|
||||||
h2zero/NimBLE-Arduino@^1.2.0
|
h2zero/NimBLE-Arduino@^1.3.1
|
||||||
me-no-dev/AsyncTCP@^1.1.1
|
me-no-dev/AsyncTCP@^1.1.1
|
||||||
bbx10/DNSServer@^1.1.0
|
bbx10/DNSServer@^1.1.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue