UP 多服同步

This commit is contained in:
jixishi
2024-06-12 14:43:43 +08:00
parent c841dfeae4
commit 2fc4b4f41a
11 changed files with 265 additions and 195 deletions
+8 -4
View File
@@ -14,7 +14,10 @@ type Command struct {
function func()
}
var commands []Command
var (
commands []Command
args []string
)
func cmdhelp() {
var page = 0
@@ -24,6 +27,8 @@ func cmdhelp() {
}
}
func cmdexit() {
CloseTrzsz()
CloseSerial()
os.Exit(0)
}
func cmdargs() {
@@ -31,12 +36,11 @@ func cmdargs() {
strout(out, config.outputCode, fmt.Sprintf("%q\n", args[1:]))
}
func cmdctrl() {
var err error
b := []byte(args[1])
x := []byte{b[0] & 0x1f}
_, err = serialPort.Write(x)
if err != nil {
log.Fatal(err)
}
ErrorF(err)
strout(out, config.outputCode, fmt.Sprintf("Ctrl+%s\n", b))
}
func cmdhex() {