mirror of
https://github.com/Hamlib/Hamlib
synced 2026-08-13 17:32:05 -04:00
Stop parsing when an escape is missing or consumes no input, and count only successfully decoded bytes. This avoids the extra strtol call beyond the command terminator while preserving valid raw commands.
22 lines
687 B
Bash
Executable file
22 lines
687 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
printf '\n' | ./rigctl -m 1 >/dev/null
|
|
printf '\n' | ./rotctl -m 1 >/dev/null
|
|
printf '\n' | ./ampctl -m 1 >/dev/null
|
|
|
|
./rigctl -m 1 3>/dev/null <&3 >/dev/null
|
|
./rotctl -m 1 3>/dev/null <&3 >/dev/null
|
|
./ampctl -m 1 3>/dev/null <&3 >/dev/null
|
|
|
|
./rigctl -m 1 w FA >/dev/null
|
|
./rigctl -m 1 -t -1 w 'x01 x02' >/dev/null
|
|
./rotctl -m 1 -t -1 w '\0x01\0x02' >/dev/null
|
|
./rotctl -m 1 -t -1 w '\' >/dev/null
|
|
|
|
binary_reply='\0x00\0xFF 2'
|
|
test "$(./rigctl -m 1 -t -1 w 'x00 xff')" = "$binary_reply"
|
|
test "$(./rigctl -m 1 -t -1 w '\0x00\0xff')" = "$binary_reply"
|
|
test "$(./rigctl -m 1 -t -1 w 'x00ff')" = "$binary_reply"
|
|
test "$(./rigctl -m 1 -t -1 w 'x00xff')" = "$binary_reply"
|