Typed setters: set_language (227), set_motion (822) - #12
Merged
Merged
Conversation
Two more section setters, codes recovered from libtools.so disassembly (MsgSet*Config wrappers load the wire code into r0 before MsgSetModuleConfig) and confirmed live on MTF45-4G_AF: - set_language(language, confirm=True): code 227 = SystemConfig/MiscConfig. Verified live (zh_cn <-> en). - set_motion(enable, sensitivity=None, alarm_threshold=None, confirm=True): code 822 = AlarmConfig/MotionDetectAlarm. Read-modify-write of the full element (captured from "Batch Motion Detection") so the detection grid, day/night thresholds, arming schedule and alarm actions are preserved. Verified live (Enable 0<->1, children preserved). const.CFG_MISC="227", CFG_MOTION="822". Tests: frame/confirm-gate for language; RMW round-trip preserving children, confirm-gate and no-section error for motion. Docs: the code-recovery method, the two new codes/setters, and notes that TimeConfig (222) needs a dedicated capture and clock-sync is off-8091.
PR Summary by QodoAdd typed language and motion configuration setters
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can route each action level your way: inline, summary, both, or drop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two more typed wrappers over
set_config_section, extending PR #11. Section codes were recovered fromlibtools.sodisassembly (eachMsgSet*Configwrapper loads the wire code intor0beforeMsgSetModuleConfig(code, xml);MsgSetVideoOSDConfig=525 matches the earlier live capture) and confirmed live on an MTF45-4G_AF.set_language(language, confirm=True)— code 227 =SystemConfig/MiscConfig. Verified live (zh_cn↔en).set_motion(enable, sensitivity=None, alarm_threshold=None, confirm=True)— code 822 =AlarmConfig/MotionDetectAlarm. Read-modify-write of the full element (captured from "Batch Motion Detection"), so the detection grid (BlockConfig), day/night thresholds, arming schedule and alarm actions are preserved. Verified live (Enable 0↔1, children preserved).Notes
const.CFG_MISC="227",CFG_MOTION="822".TimeConfig(222) did not acknowledge a full-element write (itsNTPConfigchild likely triggers a blocking NTP re-sync), and AjDevTools' "Batch Sync Time" clock-sync uses a non-8091 (ONVIF/HTTP) channel.Changes
anjoy/comm.py:set_language,set_motion(RMW).anjoy/const.py:CFG_MISC,CFG_MOTION.tests/test_comm.py: frame/confirm-gate for language; RMW round-trip preserving children, confirm-gate and no-section error for motion (84 tests pass).docs/devices.md: code-recovery method + the new codes/setters + the deferred-sections note.