Fix PTZ bugs with unsupported & unchanged fields - #3192
Conversation
|
Channel deleted. |
Test Results 73 files 541 suites 0s ⏱️ Results for commit 71f0f88. ♻️ This comment has been updated with latest results. |
|
matter-switch_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 71f0f88 |
|
One related PTZ issue remains in Single-axis commands still depend on the cached values of the other axes: For Matter's optional PTZ fields, this should instead be: This is not only relevant for cameras without one of the mechanical features. On the G350, all three axes are supported, but we observed a valid state where So a |
The The implementation matches the one I've been testing: single-axis commands only set and clamp the requested coordinate and leave the other two fields My test driver additionally gates the MPTZ commands against I also like the additional presence checks for the individual fields in incoming So from my side, the fix looks correct. |
…y#3192) * Fix PTZ feature naming bug * Fix PTZ optionality for absolute commands as well * Add defensive check on `ib.data.elements`
Description of Change
Issue # 1
The attribute handler and device config used
MPAN/MTILT/MZOOM/MPRESETS(based on "feature code" from spec), which don't exist in the generated files in lua libs (CameraAvSettingsUserLevelManagement/types/Feature.luaonly definesMECHANICAL_PAN/TILT/ZOOM/PRESETSbased on "feature name" in SDK XML).In Lua, indexing an undefined table field returns nil rather than erroring, so every feature-support check silently evaluated to "supported," and
MatterDevice:get_endpoints'sopts.feature_bitmap == nilshort-circuit treated any device with the cluster as having all PTZ features. On a device whose FeatureMap excludes zoom, this caused the driver to read a zoom field that the device never sends, crashing withattempt to index a nil value (field 'zoom').Fixed by using the correct
MECHANICAL_*names everywhere.Issue # 2
Separately,
ptz_relative_move_factoryalways sent all three deltas toMPTZRelativeMove, defaulting unused axes to 0 instead of omitting them. Per spec, each delta's conformance is tied to its own feature bit, so an explicit 0 isn't the same as an omitted field and essentially a zoom-less device rejected the command withINVALID_COMMAND.Fixed by only setting the delta for the axis being moved and leaving the others nil.
Summary of Completed Tests