Add Machine.set_memory_broadcast() for the unicast memory-snapshot stream - #13
Merged
Conversation
Wrap the firmware's authenticated /api/memory/toggle-broadcast route so
clients (like Memory Mapper) can turn the live SRAM broadcast on and off
without reaching for Machine.call(). Enabling takes a frequency_ms
clamped to the firmware's 10-60000 ms bounds; disabling sends
{"enable": false}. Documented in docs/memory.md and covered by the
wrapper-route table plus a body/clamping test.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xy1GfVJXuAkgZTMwUDDRTb
Coverage report✅ Total coverage: 100.00% (0.00% vs base |
The firmware no longer broadcasts memory snapshots to the whole network (vector#369); it streams to a single target IP, defaulting to the requesting client. Add the optional ip= parameter to set_memory_broadcast() and update the docs to describe the unicast behavior, including the USB caveat where ip must be passed explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xy1GfVJXuAkgZTMwUDDRTb
mullinmax
marked this pull request as ready for review
July 16, 2026 18:43
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.
Summary
Adds a
Machine.set_memory_broadcast(enabled, frequency_ms=100, ip=None)wrapper for the firmware's authenticated/api/memory/toggle-broadcastroute, so clients can turn the live SRAM UDP stream (port 2040, 4-byte offset header + up to 256 data bytes per packet) on and off without reaching forMachine.call().ippicks the target explicitly; when omitted, the firmware streams back to the requester — usually exactly right, since the listener typically runs where the code runs. Over USB there is no requester IP, soipmust be passed.{"enable": true, "frequency_ms": N}(+"ip"when given) withfrequency_msclamped to the firmware's 10–60000 ms bounds; disabling sends{"enable": false}._call_gatedso a missing route on old firmware raisesUnsupportedFirmwareErrorwith the firmware version named.docs/memory.md(new "Live snapshot streaming" section) and covered by the wrapper-route table plus a body/clamping/ip test.Motivation: memory-mapper#31 needs to start the stream on machines the user selects; this gives it (and anyone else) a proper API instead of a raw route call.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xy1GfVJXuAkgZTMwUDDRTb