-
Notifications
You must be signed in to change notification settings - Fork 315
Add sensor-config commands (guidance needed) #903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
b54ac0e
e3b3b4c
36cd2b2
2b7b9e9
485ad47
a9f42a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1121,6 +1121,11 @@ def setSimpleConfig(modem_preset): | |
| print(f"Waiting {args.wait_to_disconnect} seconds before disconnecting") | ||
| time.sleep(int(args.wait_to_disconnect)) | ||
|
|
||
| if args.sensor_config: | ||
| closeNow = True | ||
| waitForAckNak = True | ||
| interface.getNode(args.dest, False, **getNode_kwargs).sensorConfig(args.sensor_config) | ||
|
|
||
| # if the user didn't ask for serial debugging output, we might want to exit after we've done our operation | ||
| if (not args.seriallog) and closeNow: | ||
| interface.close() # after running command then exit | ||
|
|
@@ -2035,6 +2040,14 @@ def addRemoteAdminArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentPars | |
| metavar="TIMESTAMP", | ||
| ) | ||
|
|
||
| group.add_argument( | ||
| "--sensor-config", | ||
| help="Send a sensor admin command to configure sensor parameters.", | ||
| action="store", | ||
| nargs='+', | ||
| default=None | ||
| ) | ||
|
Comment on lines
+2043
to
+2049
|
||
|
|
||
| return parser | ||
|
|
||
| def initParser(): | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -994,6 +994,180 @@ def onAckNak(self, p): | |||||||||||
| print(f"Received an ACK.") | ||||||||||||
| self.iface._acknowledgment.receivedAck = True | ||||||||||||
|
|
||||||||||||
| def sensorConfig(self, commands: List = None): | ||||||||||||
| """Send a sensor configuration command""" | ||||||||||||
| self.ensureSessionKey() | ||||||||||||
|
|
||||||||||||
|
||||||||||||
| if not commands: | |
| print("No sensor configuration commands were provided.") | |
| return |
Copilot
AI
Mar 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send_command is assigned but never read. This is dead code and may trigger linting failures; either remove it or use it to control the “Nothing to request”/sending behavior consistently across all sensor config fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--sensor-configis executed after the global ACK/NAK wait block, but it setswaitForAckNak = Trueonly inside this late block. As a result, remote--sensor-configcommands won’t trigger the “Waiting for an acknowledgment…” path and the interface may close immediately after sending. Please move this handling up with the other remote-admin actions (before the ACK/NAK wait section), or explicitly calliface.waitForAckNak()right aftersensorConfig()when--destis remote.