Fix C1000 Gen 2 subscribe using the new send_command interface - #67
Open
alec-pinson wants to merge 1 commit into
Open
Fix C1000 Gen 2 subscribe using the new send_command interface#67alec-pinson wants to merge 1 commit into
alec-pinson wants to merge 1 commit into
Conversation
The new send_command() interface takes a str cmd and a parameters dict, but _post_connect was still calling it with a bytes cmd and a raw payload. The required parameters argument was therefore never supplied and every connection raised TypeError, so the Gen 2 was never sent its subscribe command and streamed no telemetry. The raw payload a10121 is the parameter a1 with value 21, so it maps directly onto the new interface and the bytes on the wire are unchanged. Add a command test asserting the subscribe builds cmd 4100 with payload a10121. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
alec-pinson
force-pushed
the
fix_c1000g2_subscribe
branch
from
September 7, 2026 08:54
ad35e93 to
ffb77b5
Compare
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.
_post_connectstill calls_send_commandwith the pre-#61 signature (cmdas bytes,payload=), so the requiredparametersargument is never supplied:connect()catches this, so the connection survives but the subscribe is never sent — and the Gen 2 streams no telemetry without it. Every sensor reads unavailable. Regression from 685573a, first released in 4.0.0b1.The raw payload
a10121is parametera1with value21, so it maps directly onto the new interface and the bytes on the wire are unchanged from 3.9.0.Adds a command test asserting the subscribe builds cmd
4100with payloada10121. It fails with the aboveTypeErrorwithout the fix.Reproduced and verified on a real C1000 Gen 2 (A1763).