Started CLI implementation of USB gadget settings
This commit is contained in:
@@ -19,6 +19,13 @@ var ledCmd = &cobra.Command{
|
||||
var ledGetCmd = &cobra.Command{
|
||||
Use: "get",
|
||||
Short: "Get LED blink count",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if ls, err := ClientGetLED(StrRemoteHost, StrRemotePort); err == nil {
|
||||
fmt.Printf("LED blink count %v\n", ls.BlinkCount)
|
||||
} else {
|
||||
log.Println(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
var ledSetCmd = &cobra.Command{
|
||||
@@ -44,14 +51,5 @@ func init() {
|
||||
ledCmd.AddCommand(ledGetCmd)
|
||||
ledCmd.AddCommand(ledSetCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// usbCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// usbCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
ledSetCmd.Flags().Uint32Var(&blink_count,"blink", 0,"Set blink count (0: Off, 1..254: blink n times, >254: On)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user