Skip to content

Commit 816048f

Browse files
committed
linux: parse enroled/enabled false as hearing aid disabled
1 parent d6b98b7 commit 816048f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

linux/airpods_packets.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,17 @@ namespace AirPodsPackets
120120
return std::nullopt;
121121

122122
QByteArray value = data.mid(HEADER.size(), 2);
123-
if (value == QByteArray::fromHex("0101"))
123+
if (value.size() != 2)
124+
return std::nullopt;
125+
126+
char b1 = value.at(0);
127+
char b2 = value.at(1);
128+
129+
if (b1 == 0x01 && b2 == 0x01)
124130
return true;
125-
if (value == QByteArray::fromHex("0202"))
131+
if (b1 == 0x02 || b2 == 0x02)
126132
return false;
133+
127134
return std::nullopt;
128135
}
129136
}

0 commit comments

Comments
 (0)