Skip to content

Commit 932a23d

Browse files
authored
Merge pull request #50 from UMSATS/ack-option-from-dev
Add ack option to send command in SOTI CLI
2 parents c04f194 + b8a85a0 commit 932a23d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

soti/umsats_soti/parser/parser.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def parse_send(args: str, default_sender: NodeID) -> Message:
104104
priority: int = 255
105105
sender_id: NodeID = default_sender
106106
recipient_id: NodeID | None = get_implied_recipient(cmd_id)
107+
is_ack: bool = False
107108

108109
# represents the bytes that will be sent in the data section of the message
109110
data = bytearray()
@@ -128,6 +129,13 @@ def parse_send(args: str, default_sender: NodeID) -> Message:
128129
recipient_id = NodeID(parse_int(value))
129130
except ValueError as exc:
130131
raise ArgumentException(f"Invalid node ID '{value}'") from exc
132+
elif key == "ack":
133+
if value.lower() == "true":
134+
is_ack = True
135+
elif value.lower() == "false":
136+
is_ack = False
137+
else:
138+
raise ArgumentException(f"Invalid value for ack '{value}'. Expected true or false")
131139
else:
132140
raise ArgumentException(f"Unknown option '{key}'")
133141

@@ -183,5 +191,5 @@ def parse_send(args: str, default_sender: NodeID) -> Message:
183191
priority,
184192
sender_id,
185193
recipient_id,
186-
False
194+
is_ack
187195
)

0 commit comments

Comments
 (0)