package main import ( "log" "xengineering.eu/iot-core/communication" ) func main() { ports, err := communication.GetStSerials() if err != nil { log.Fatal(err) } if len(ports) != 1 { log.Fatalf("Require exactly one serial port from STMicroelectronics but %d attached", len(ports)) } log.Printf("Detected serial port: %s\n", ports[0]) phy, err := communication.NewPhy(ports[0]) log.Println("Starting to print out incoming data from serial port") err = phy.Cat() if err != nil { log.Fatal(err) } }