Repository navigation
Add SYS.Model SREQ to report the actual chip model - #295
CubeZ2mDeveloper wants to merge 3 commits into
Conversation
The node model is currently inferred from the stack version and NV struct alignment: every Z-Stack 3.x device becomes a generic "CC2652", and older devices are either a "CC2531" or a "CC2538". This cannot distinguish between chips like the CC2652R, CC2652P, and CC2652RB, and is wrong for coordinators running customized Z-Stack builds on other hardware. Add a `SYS.Model` SREQ command (0x40) that returns the chip model as a length-prefixed UTF-8 string, and probe it while loading network info. The command is a firmware extension, not part of TI's documented MT SYS command set, so the probe degrades gracefully: firmware that does not recognize it (stock Z-Stack replies with `RPCError.CommandNotRecognized`) or does not answer within 5 seconds falls back to the existing inference. Stock firmware is unaffected and incurs no additional startup delay.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #295 +/- ##
==========================================
- Coverage 98.57% 98.55% -0.03%
==========================================
Files 43 43
Lines 3582 3589 +7
==========================================
+ Hits 3531 3537 +6
- Misses 51 52 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
For reference, other chips include CC2674 (CC2674P/CC2674R). CC1354 (CC1354P/CC1354R), and CC1354 (CC1352P/CC1352R): |
|
|
||
| try: | ||
| model_rsp = ( | ||
| await self.request(c.SYS.Model.Req(), timeout=5) |
There was a problem hiding this comment.
We don't pass timeout for any other commands. If this command doesn't need an override, timeout=5 should be removed.
| except CommandNotRecognized: | ||
| model_rsp = None | ||
| if model_rsp: | ||
| model = model_rsp |
There was a problem hiding this comment.
This code currently is untested. Can you add a test? See BaseZStack3CC2531 as an example. I think adding a new base class that has the LED command would allow you to simulate behavior both with and without this command to ensure both branches are exercised.
Remove the explicit timeout override so SYS.Model uses the configured SREQ timeout. Add a simulated firmware base class with SYS.Model support and test: - CC2674P10 model reporting - Fallback when the command is unsupported or returns an empty model - UTF-8 response decoding
The node model is currently inferred from the stack version and NV struct alignment: every Z-Stack 3.x device becomes a generic "CC2652", and older devices are either a "CC2531" or a "CC2538". This cannot distinguish between chips like the CC2652R, CC2652P, and CC2652RB, and is wrong for coordinators running customized Z-Stack builds on other hardware.
Add a
SYS.ModelSREQ command (0x40) that returns the chip model as a length-prefixed UTF-8 string, and probe it while loading network info. The command is a firmware extension, not part of TI's documented MT SYS command set, so the probe degrades gracefully: firmware that does not recognize it (stock Z-Stack replies withRPCError.CommandNotRecognized) or does not answer within 5 seconds falls back to the existing inference. Stock firmware is unaffected and incurs no additional startup delay.