cmd

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

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 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)
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL