diff options
author | sina <sina@snix.ir> | 2023-03-01 10:47:02 +0330 |
---|---|---|
committer | sina <sina@snix.ir> | 2023-03-01 10:47:02 +0330 |
commit | 093b30d819ccefdfc4cee3f902828ef48b91b2ce (patch) | |
tree | 8f69f60be7e8136342db129df75a1abb245616d8 | |
parent | 18c771ef6a99911570d8618db76d624ecd2a1ab0 (diff) |
serial fd
-rw-r--r-- | ports.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -84,6 +84,9 @@ func (p *Port) Buffered() (int, error) { return unix.IoctlGetInt(int(p.f.Fd()), unix.TIOCOUTQ) } +// Expose serial fd to use in some special cases, ioctl etc... +func (p *Port) File() *os.File { return p.f } + func timeout(d time.Duration) (byte, byte) { if d > 0x0 { t := math.Min(math.Max(float64(d.Nanoseconds()/1e6/100), 0x01), 0xff) |