gotelem/cmd/gotelem/cli/client.go

43 lines
802 B
Go
Raw Normal View History

2023-05-20 19:53:10 +00:00
package cli
import (
"fmt"
"github.com/kschamplin/gotelem"
"github.com/kschamplin/gotelem/mprpc"
"github.com/urfave/cli/v2"
)
func init() {
subCmds = append(subCmds, clientCmd)
}
var clientCmd = &cli.Command{
2023-05-29 00:39:03 +00:00
Name: "client",
Aliases: []string{"c"},
Usage: "interact with a gotelem server",
2023-05-20 19:53:10 +00:00
ArgsUsage: "[server url]",
Flags: []cli.Flag{
&cli.BoolFlag{
2023-05-29 00:39:03 +00:00
Name: "gui",
2023-05-20 19:53:10 +00:00
Aliases: []string{"g"},
2023-05-29 00:39:03 +00:00
Usage: "start a local TUI",
2023-05-20 19:53:10 +00:00
},
},
Description: `
Connects to a gotelem server or relay. Can be used to
`,
2023-05-28 03:06:05 +00:00
Action: client,
}
func client(ctx *cli.Context) error {
return nil
2023-05-20 19:53:10 +00:00
}
// the client should connect to a TCP server and listen to packets.
2023-05-29 00:39:03 +00:00
func CANFrameHandler(f *gotelem.Frame) (*mprpc.RPCEmpty, error) {
2023-05-20 19:53:10 +00:00
fmt.Printf("got frame, %v\n", f)
return nil, nil
}