From b8ef4d11fe0d00ce0884ccf982675845b20c3ce9 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 30 May 2024 16:00:32 +0200 Subject: software: Implement serial port detection --- software/vendor/go.bug.st/serial/serial_bsd.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 software/vendor/go.bug.st/serial/serial_bsd.go (limited to 'software/vendor/go.bug.st/serial/serial_bsd.go') diff --git a/software/vendor/go.bug.st/serial/serial_bsd.go b/software/vendor/go.bug.st/serial/serial_bsd.go new file mode 100644 index 0000000..fb7c849 --- /dev/null +++ b/software/vendor/go.bug.st/serial/serial_bsd.go @@ -0,0 +1,15 @@ +// +// Copyright 2014-2023 Cristian Maglie. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// + +//go:build darwin || dragonfly || freebsd || netbsd || openbsd + +package serial + +import "golang.org/x/sys/unix" + +func (port *unixPort) Drain() error { + return unix.IoctlSetInt(port.handle, unix.TIOCDRAIN, 0) +} -- cgit v1.2.3-70-g09d2