Merge pull request #164 from ian-xu/master
feat: add ttyHS support for linux
This commit is contained in:
@@ -9,7 +9,7 @@ package serial
|
|||||||
import "golang.org/x/sys/unix"
|
import "golang.org/x/sys/unix"
|
||||||
|
|
||||||
const devFolder = "/dev"
|
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
|
// termios manipulation functions
|
||||||
|
|
||||||
|
|||||||
@@ -313,8 +313,8 @@ func nativeGetPortsList() ([]string, error) {
|
|||||||
|
|
||||||
portName := devFolder + "/" + f.Name()
|
portName := devFolder + "/" + f.Name()
|
||||||
|
|
||||||
// Check if serial port is real or is a placeholder serial port "ttySxx"
|
// Check if serial port is real or is a placeholder serial port "ttySxx" or "ttyHSxx"
|
||||||
if strings.HasPrefix(f.Name(), "ttyS") {
|
if strings.HasPrefix(f.Name(), "ttyS") || strings.HasPrefix(f.Name(), "ttyHS") {
|
||||||
port, err := nativeOpen(portName, &Mode{})
|
port, err := nativeOpen(portName, &Mode{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user