You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(upgrade): correct appendData params to {"length": N} (hardware-validated) (#3)
* fix(upgrade): correct appendData params to {"length": N} (hardware-validated)
Reversed from the hunter CUpgradeService::appendData handler and confirmed by a
live UART-free flash on a GK7205V510: appendData expects params {"length": N}
with an N-byte binary payload (the handler checks params.length == actual binary
length), NOT {"Offset","Length"} — which returned 400 "param error". prepare
({"Type":"System"}) and execute params are ignored. State machine: prepare(0->2)
-> appendData(2/4, repeatable) -> execute(4->0), with a ~60s idle timeout.
With this, DahuaClient.upgrade_firmware() successfully flashed an OpenIPC package
over DHIP end-to-end (device rebooted into the new firmware). const comment
updated to record the byte-proven param shape.
* review: refresh upgrade docs to validated state; assert appendData params in test
Addresses Qodo review on #3:
- upgrade_firmware docstring + confirm ValueError no longer claim the path is
byte-unproven / never run on hardware (it is validated end-to-end on a
GK7205V510); docstring now states the {"length":N}+binary contract and the
prepare/appendData/execute state machine.
- test_upgrade_streams_file_in_chunks now records each appendData params and the
real trailing-binary length and asserts params == {"length": N} with N equal
to the payload for every chunk. FakeDHIPServer exposes the binary payload
(__data__) so handlers can verify it. A revert to {"Offset","Length"} now
fails the test (previously it passed).
* review: README upgrade status reflects hardware validation
Finding 1 (Qodo) also pointed at README: the API table said 'mock-validated
only' and the device-support section said upgrade_firmware is 'intentionally
never run against a device' — both now contradicted the validated flow. Moved
firmware upgrade into 'Verified on hardware' (flashed OpenIPC on a GK7205V510
end-to-end), kept the destructive/confirm=True warning.
0 commit comments