From 559f05ef7b5fd50f63eee72ab1b5b57fb18c169c Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 22 Nov 2022 07:50:43 +0000 Subject: [PATCH] set file deadlines --- serial_linux.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/serial_linux.go b/serial_linux.go index 65420f3..9a6d2d4 100644 --- a/serial_linux.go +++ b/serial_linux.go @@ -5,6 +5,7 @@ package serial import ( "fmt" "os" + "syscall" "time" "unsafe" @@ -142,6 +143,22 @@ func (p *Port) Write(b []byte) (n int, err error) { return p.f.Write(b) } +func (p *Port) SetWriteDeadline(t time.Time) (err error) { + return p.f.SetWriteDeadline(t) +} + +func (p *Port) SetDeadline(t time.Time) (err error) { + return p.f.SetDeadline(t) +} + +func (p *Port) SetReadDeadline(t time.Time) (err error) { + return p.f.SetReadDeadline(t) +} + +func (p *Port) SyscallConn() (syscall.RawConn, error) { + return p.f.SyscallConn() +} + // Discards data written to the port but not transmitted, // or data received but not read func (p *Port) Flush() error {