Documentation ¶
Overview ¶
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FreqCmd = &cobra.Command{ Use: "freq [MHz]", Short: "Get or Set current frequency", Run: func(cmd *cobra.Command, args []string) { freq := "" if len(args) != 0 { freq = args[0] } port, err := djx100.Connect(rootCmd.PersistentFlags().Lookup("port").Value.String()) if err != nil { fmt.Println(err) os.Exit(1) } response, err := djx100.SendCmd(port, "AL~FREQ"+freq) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(response) }, }
View Source
var GPSCmd = &cobra.Command{ Use: "gps", Short: "GPS Info", Run: func(cmd *cobra.Command, args []string) { port, err := djx100.Connect(rootCmd.PersistentFlags().Lookup("port").Value.String()) if err != nil { fmt.Println(err) os.Exit(1) } response, err := djx100.SendCmd(port, "AL~GPS") if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(response) }, }
View Source
var ReadCmd = &cobra.Command{ Use: "read [address]", Short: "Read Data", Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { port, err := djx100.Connect(rootCmd.PersistentFlags().Lookup("port").Value.String()) if err != nil { fmt.Println(err) os.Exit(1) } response, err := djx100.ReadData(port, args[0]) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(response) }, }
View Source
var SQLCmd = &cobra.Command{ Use: "sql <level>", Short: "Set SQL [0-35]", Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { port, err := djx100.Connect(rootCmd.PersistentFlags().Lookup("port").Value.String()) if err != nil { fmt.Println(err) os.Exit(1) } response, err := djx100.SendCmd(port, "AL~SQL"+args[0]) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(response) }, }
View Source
var VolCmd = &cobra.Command{ Use: "vol <level>", Short: "Set Volume [0-35]", Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { port, err := djx100.Connect(rootCmd.PersistentFlags().Lookup("port").Value.String()) if err != nil { fmt.Println(err) os.Exit(1) } response, err := djx100.SendCmd(port, "AL~VOL"+args[0]) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(response) }, }
View Source
var WriteCmd = &cobra.Command{ Use: "write [address] [data]", Short: "Write Data", Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { port, err := djx100.Connect(rootCmd.PersistentFlags().Lookup("port").Value.String()) if err != nil { fmt.Println(err) os.Exit(1) } if len(args[1]) != 256 { fmt.Println("Data size must be 256") os.Exit(1) } response, err := djx100.WriteData(port, args[0], args[1]) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(response) err = djx100.RestartCmd(port) if err != nil { fmt.Println(err) os.Exit(1) } }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.