mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
CMF Buds: Fix reading ANC status on newer buds
Newer buds send 6 bytes for ANC status instead of 3. Since the relevant information is in the first 3 bytes and identical allow extra trailing bytes when parsing. Confirmed on the Buds 2 Plus. Likely also applies to Ear(a) (see #3994), possibly other models as well.
This commit is contained in:
committed by
José Rebelo
parent
aaf5b3011f
commit
0cb14eb30d
+1
-1
@@ -300,7 +300,7 @@ public class Ear1Support extends AbstractHeadphoneBTBRDeviceSupport {
|
||||
private GBDeviceEventUpdatePreferences handleAudioModeStatus(byte[] payload) {
|
||||
final GBDeviceEventUpdatePreferences preferencesEvent = new GBDeviceEventUpdatePreferences();
|
||||
|
||||
if (payload.length == 3 && payload[0] == 0x01 && payload[2] == 0x00) {
|
||||
if (payload.length >= 3 && payload[0] == 0x01 && payload[2] == 0x00) {
|
||||
try {
|
||||
NothingAudioMode mode = NothingAudioMode.fromBitmask(payload[1]);
|
||||
LOG.info("Audio mode: " + mode.name());
|
||||
|
||||
Reference in New Issue
Block a user