Print BLE 128-bit UUIDs according to spec (#2061)

Since the iterator integer counts the bytes backwards we need to
use the complement to 15.
This commit is contained in:
Stefan Agner 2021-07-26 10:49:38 +02:00 committed by GitHub
parent 237edd75d1
commit c2637a76f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ std::string ESPBTUUID::to_string() {
for (int8_t i = 15; i >= 0; i--) {
sprintf(bpos, "%02X", this->uuid_.uuid.uuid128[i]);
bpos += 2;
if (i == 3 || i == 5 || i == 7 || i == 9)
if (i == 6 || i == 8 || i == 10 || i == 12)
sprintf(bpos++, "-");
}
sbuf[47] = '\0';