Documentation
¶
Index ¶
- func GetSerial(retries int, mul0, mul1 gpio.Level, wait time.Duration) (*os.File, error)
- func NewSerialUnavailableError(msg string) error
- func ReleaseSerial(serialFile *os.File) error
- func SerialInUseFromTerminal() bool
- func SerialSendReceive(retries int, mul0, mul1 gpio.Level, wait time.Duration, data []byte) ([]byte, error)
- type SerialUnavailableError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSerial ¶
GetSerial will try to get a file lock on the serial port. If the file lock can be acquired, it will return the serial file and change mul0 and mul1 to the new values. defer ReleaseSerial(serialFile) should be called to release the lock and close the serial file.
func ReleaseSerial ¶
func SerialInUseFromTerminal ¶
func SerialInUseFromTerminal() bool
Types ¶
type SerialUnavailableError ¶
type SerialUnavailableError struct {
// contains filtered or unexported fields
}
func (*SerialUnavailableError) Error ¶
func (e *SerialUnavailableError) Error() string
Click to show internal directories.
Click to hide internal directories.