tarm / serial

BSD 3-Clause "New" or "Revised" License
1.6k stars 451 forks source link

all serials #127

Open gitchander opened 1 year ago

gitchander commented 1 year ago

Hello! How I can get all serial ports?

jd-boyd commented 1 year ago

It would be extremely helpful if a method to list available serial ports was provided.

FObersteiner commented 1 year ago

This issue already exists

I've implemented a 'serial port finder' in my fork; feel free to adopt :)

mappedbyte commented 11 months ago

Thank you very much for the solution you provided, but when the program is compiled into an executable file, the execution platform may not have GOOS environment variables. Does this also need to be considered

FObersteiner commented 11 months ago

@oneAsiaPeople to my understanding, you'll have to set GOOS when cross-compiling anyways; e.g. I set GOOS=windows GOARCH=amd64 go build [...] if I want to compile from my Linux machine to Windows.