Skip to content

hootrhino/goserial

This branch is 4 commits ahead of goburrow/serial:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ad41645 · Oct 16, 2024

History

30 Commits
Jun 23, 2024
Jan 3, 2016
Oct 16, 2024
Mar 1, 2017
Apr 17, 2015
Jun 23, 2024
Feb 9, 2017
Oct 16, 2024
Oct 16, 2024
Oct 16, 2024
Oct 22, 2021
Feb 9, 2017
Feb 9, 2017
Oct 22, 2021
Oct 16, 2024
Jul 31, 2022
Oct 16, 2024
Feb 9, 2017
Oct 22, 2021
Oct 3, 2017
Oct 3, 2017
Oct 3, 2017
Oct 22, 2021
Jan 3, 2016
Oct 16, 2024
Jun 23, 2024

Repository files navigation

go serial port

Example

package main

import (
	"log"
	"github.com/goburrow/serial"
)

func main() {
	port, err := serial.Open(&serial.Config{Address: "/dev/ttyUSB0"})
	if err != nil {
		log.Fatal(err)
	}
	defer port.Close()

	_, err = port.Write([]byte("ok"))
	if err != nil {
		log.Fatal(err)
	}
}

Testing

Linux

socat

sudo apt install socat
socat -d -d pty,raw,echo=0 pty,raw,echo=0

Windows

Packages

No packages published

Languages

  • Go 99.6%
  • Batchfile 0.4%