Record feature versions in Centurion Phase A (parent/direct) too

The previous commit fixed version recording for bridge-routed sub-device
features (Phase B). This applies the same fix to Phase A, which is used
for parent features on a wireless dongle AND for the whole feature set
on direct-USB Centurion devices like the wired G522 (PID 0x0B19).

Without this, a wired Centurion headset would enumerate all features
with version=0 and version-gated settings (sidetone 3-byte format,
auto-sleep 2/3-byte timer) would send the wrong payload and get
OUT_OF_RANGE rejections — same symptom the wireless G522 had before.
This commit is contained in:
Ken Sanislo 2026-04-18 01:30:17 -07:00
parent 4cc8ac0d46
commit fdfb921ee8
1 changed files with 7 additions and 1 deletions

View File

@ -196,13 +196,19 @@ class FeaturesArray(dict):
response = self.device.request((fs_index << 8) | 0x10, index)
if response is None or len(response) < 3:
continue
# Centurion FeatureSet response: [remaining_count, feat_hi, feat_lo, type, flags]
# Centurion FeatureSet response: [remaining_count, feat_hi, feat_lo, type, version]
feat_id = struct.unpack("!H", response[1:3])[0]
feat_type = response[3] if len(response) > 3 else 0
feat_version = response[4] if len(response) > 4 else 0
feature = resolve_feature(feat_id, centurion=True)
if feature is None:
feature = f"unknown:{feat_id:04X}"
self[feature] = index
self.inverse[index] = feature
# Record version/flags so version-gated settings (sidetone, auto-sleep)
# use the correct payload format on direct USB Centurion devices too.
self.version[feature] = feat_version
self.flags[feature] = feat_type
if feature is CenturionCoreFeature.CENT_PP_BRIDGE:
bridge_index = index