Skip to content

Add reboot() (SYSTEM_CONTROL/1007), captured + verified live - #9

Merged
widgetii merged 1 commit into
masterfrom
reboot
Sep 22, 2026
Merged

widgetii merged 1 commit into
masterfrom
reboot

Conversation

@widgetii

Copy link
Copy Markdown
Member

Third AjDevTools batch op automated: reboot (from "Batch Reboot").

Protocol (captured live)

SYSTEM_CONTROL_MESSAGE/1007 with an empty body → the camera reboots.

Changes

  • reboot() — fire-and-forget; the device reboots and drops the connection (reconnect after ~30 s).
  • Verified live: after reboot() the MTF45-4G_AF stopped responding to ping and came back ~30 s later.
  • Test asserts the 1007 empty-body frame; docs/devices.md updated. 67 green.

Captured AjDevTools 'Batch Reboot': SYSTEM_CONTROL_MESSAGE/1007 with an empty
body. reboot() sends it (fire-and-forget; the device reboots and drops the
connection). Verified live: after reboot() the MTF45-4G_AF stopped responding to
ping and came back ~30s later. Test + docs. 67 green.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can route each action level your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add camera reboot command using SYSTEM_CONTROL/1007

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Adds fire-and-forget reboot() using the captured SYSTEM_CONTROL/1007 empty-body command.
• Verifies the exact outbound reboot frame with a deviceless unit test.
• Documents live hardware behavior, connection loss, and approximately 30-second recovery.
Diagram

sequenceDiagram
    actor Caller
    participant Client as Anjoy Client
    participant Camera
    Caller->>Client: reboot()
    Client->>Camera: SYSTEM_CONTROL 1007
    Camera--xClient: Drop TCP connection
    Camera->>Camera: Restart device
    Note over Caller,Camera: Reconnect after about 30 seconds
    Caller->>Client: connect()
    Client->>Camera: Open TCP connection
Loading
High-Level Assessment

The dedicated reboot() method is the appropriate approach because it reuses the established _send framing path while exposing the captured protocol operation as a clear public API. A generic system-control method or the separate PTZ reboot verb would be less explicit and would not represent the verified Batch Reboot command.

Files changed (3) +20 / -0

Enhancement (1) +7 / -0
comm.pyAdd fire-and-forget camera reboot API +7/-0

Add fire-and-forget camera reboot API

• Adds 'AnjoyCommClient.reboot()', which sends an empty-body 'SYSTEM_CONTROL_MESSAGE' with code '1007'. Its documentation explains that the camera drops the connection during its approximately 30-second restart.

anjoy/comm.py

Tests (1) +8 / -0
test_comm.pyVerify the reboot wire frame +8/-0

Verify the reboot wire frame

• Adds a deviceless unit test asserting that 'reboot()' emits message type 'SYSTEM_CONTROL_MESSAGE', code '1007', and a self-closing empty message body.

tests/test_comm.py

Documentation (1) +5 / -0
devices.mdDocument the captured reboot protocol +5/-0

Document the captured reboot protocol

• Documents the SYSTEM_CONTROL/1007 reboot command, its empty body, fire-and-forget semantics, expected connection loss, recovery timing, and live-device verification.

docs/devices.md

@widgetii
widgetii merged commit 4f199c1 into master Sep 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant