Skip to content

Commit

Permalink
Merge pull request #164 from ian-xu/master
Browse files Browse the repository at this point in the history
feat: add ttyHS support for linux
  • Loading branch information
cmaglie committed Aug 9, 2023
2 parents e381f2c + 10b7b3e commit c89f81c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion serial_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package serial
import "golang.org/x/sys/unix"

const devFolder = "/dev"
const regexFilter = "(ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|ttymxc)[0-9]{1,3}"
const regexFilter = "(ttyS|ttyHS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|ttymxc)[0-9]{1,3}"

// termios manipulation functions

Expand Down
4 changes: 2 additions & 2 deletions serial_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ func nativeGetPortsList() ([]string, error) {

portName := devFolder + "/" + f.Name()

// Check if serial port is real or is a placeholder serial port "ttySxx"
if strings.HasPrefix(f.Name(), "ttyS") {
// Check if serial port is real or is a placeholder serial port "ttySxx" or "ttyHSxx"
if strings.HasPrefix(f.Name(), "ttyS") || strings.HasPrefix(f.Name(), "ttyHS") {
port, err := nativeOpen(portName, &Mode{})
if err != nil {
continue
Expand Down

0 comments on commit c89f81c

Please sign in to comment.