serial

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

DSUL - Disturb State USB Light : Serial module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBrightnessString

func GetBrightnessString(value string, cfg *settings.Config) (string, bool)

Return a string ready to send to serial device, for setting LED brightness.

func GetColorString

func GetColorString(value string, cfg *settings.Config) (string, bool)

Return a string ready to send to serial device, for changing LED color.

func GetDimString

func GetDimString(value string) (string, bool)

Return a string ready to send to serial device, for dimming LED.

func GetModeString

func GetModeString(value string, cfg *settings.Config) (string, bool)

Return a string ready to send to serial device, for setting display mode.

func Init

func Init(cfg *settings.Config) serial.Port

Initialize serial port.

func Read

func Read(port serial.Port) string

Read serial port and return data.

func Runner

func Runner(cfg *settings.Config, verbosity bool, cmd_channel chan string, rsp_channel chan string)

Start runner for serial communication. Handles reading and writing in different goroutines.

func SendBrightnessCommand

func SendBrightnessCommand(port serial.Port, value string, cfg *settings.Config) bool

Send command to set the brightness. ??? - brightness value, 0-255

func SendColorCommand

func SendColorCommand(port serial.Port, value string, cfg *settings.Config) bool

Send command to set the color. ???:???:??? - red:green:blue values, 0-255

func SendDimCommand

func SendDimCommand(port serial.Port, value string) bool

Send command to set the dim mode. 0 = No dimming (turn off dim mode) 1 = Dimming (turn on dim mode)

func SendModeCommand

func SendModeCommand(port serial.Port, value string, cfg *settings.Config) bool

Send command to set the mode. ??? - mode value, 0-4

func SendOK

func SendOK(port serial.Port) bool

Send OK to device.

func SendPing

func SendPing(port serial.Port) bool

Send ping to device.

func SendRequest

func SendRequest(port serial.Port) string

Send request for information to device.

func Write

func Write(port serial.Port, data []byte)

Write data to serial port.

Types

This section is empty.

Jump to

Keyboard shortcuts

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