Files
ptb/cts.go
2025-02-03 15:37:45 +01:00

15 lines
334 B
Go

//go:build !android
package main
import "github.com/albenik/go-serial/v2"
// cts returns the clear-to-send status of a device. On Android it will return true as GetModemStatusBits() fails there.
func cts(p *serial.Port) (bool, error) {
r, err := p.GetModemStatusBits()
if err != nil {
return false, err
}
return r.CTS, nil
}