Documentation
¶
Overview ¶
DSUL - Disturb State USB Light : Serial module.
Index ¶
- func GetBrightnessString(value string, cfg *settings.Config) (string, bool)
- func GetColorString(value string, cfg *settings.Config) (string, bool)
- func GetDimString(value string) (string, bool)
- func GetModeString(value string, cfg *settings.Config) (string, bool)
- func Init(cfg *settings.Config) serial.Port
- func Read(port serial.Port) string
- func Runner(cfg *settings.Config, verbosity bool, cmd_channel chan string, ...)
- func SendBrightnessCommand(port serial.Port, value string, cfg *settings.Config) bool
- func SendColorCommand(port serial.Port, value string, cfg *settings.Config) bool
- func SendDimCommand(port serial.Port, value string) bool
- func SendModeCommand(port serial.Port, value string, cfg *settings.Config) bool
- func SendOK(port serial.Port) bool
- func SendPing(port serial.Port) bool
- func SendRequest(port serial.Port) string
- func Write(port serial.Port, data []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBrightnessString ¶
Return a string ready to send to serial device, for setting LED brightness.
func GetColorString ¶
Return a string ready to send to serial device, for changing LED color.
func GetDimString ¶
Return a string ready to send to serial device, for dimming LED.
func GetModeString ¶
Return a string ready to send to serial device, for setting display mode.
func Runner ¶
Start runner for serial communication. Handles reading and writing in different goroutines.
func SendBrightnessCommand ¶
Send command to set the brightness. ??? - brightness value, 0-255
func SendColorCommand ¶
Send command to set the color. ???:???:??? - red:green:blue values, 0-255
func SendDimCommand ¶
Send command to set the dim mode. 0 = No dimming (turn off dim mode) 1 = Dimming (turn on dim mode)
func SendModeCommand ¶
Send command to set the mode. ??? - mode value, 0-4
func SendRequest ¶
Send request for information to device.
Types ¶
This section is empty.