{"id":38767175,"url":"https://github.com/blues/serial","last_synced_at":"2026-01-17T12:01:25.874Z","repository":{"id":101585624,"uuid":"221952363","full_name":"blues/serial","owner":"blues","description":"Copy of https://github.com/tarm/serial","archived":false,"fork":false,"pushed_at":"2019-11-20T21:29:05.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-12-26T17:50:43.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blues.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-15T15:34:38.000Z","updated_at":"2021-07-30T12:01:22.000Z","dependencies_parsed_at":"2023-06-19T07:06:05.734Z","dependency_job_id":null,"html_url":"https://github.com/blues/serial","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/blues/serial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fserial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fserial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fserial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fserial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blues","download_url":"https://codeload.github.com/blues/serial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fserial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T12:01:02.419Z","updated_at":"2026-01-17T12:01:25.812Z","avatar_url":"https://github.com/blues.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/tarm/serial?status.svg)](http://godoc.org/github.com/tarm/serial)\n[![Build Status](https://travis-ci.org/tarm/serial.svg?branch=master)](https://travis-ci.org/tarm/serial)\n\nSerial\n========\nA Go package to allow you to read and write from the\nserial port as a stream of bytes.\n\nDetails\n-------\nIt aims to have the same API on all platforms, including windows.  As\nan added bonus, the windows package does not use cgo, so you can cross\ncompile for windows from another platform.\n\nYou can cross compile with\n   GOOS=windows GOARCH=386 go install github.com/tarm/serial\n\nCurrently there is very little in the way of configurability.  You can\nset the baud rate.  Then you can Read(), Write(), or Close() the\nconnection.  By default Read() will block until at least one byte is\nreturned.  Write is the same.\n\nCurrently all ports are opened with 8 data bits, 1 stop bit, no\nparity, no hardware flow control, and no software flow control.  This\nworks fine for many real devices and many faux serial devices\nincluding usb-to-serial converters and bluetooth serial ports.\n\nYou may Read() and Write() simulantiously on the same connection (from\ndifferent goroutines).\n\nUsage\n-----\n```go\npackage main\n\nimport (\n        \"log\"\n\n        \"github.com/tarm/serial\"\n)\n\nfunc main() {\n        c := \u0026serial.Config{Name: \"COM45\", Baud: 115200}\n        s, err := serial.OpenPort(c)\n        if err != nil {\n                log.Fatal(err)\n        }\n        \n        n, err := s.Write([]byte(\"test\"))\n        if err != nil {\n                log.Fatal(err)\n        }\n        \n        buf := make([]byte, 128)\n        n, err = s.Read(buf)\n        if err != nil {\n                log.Fatal(err)\n        }\n        log.Printf(\"%q\", buf[:n])\n}\n```\n\nNonBlocking Mode\n----------------\nBy default the returned Port reads in blocking mode. Which means\n`Read()` will block until at least one byte is returned. If that's not\nwhat you want, specify a positive ReadTimeout and the Read() will\ntimeout returning 0 bytes if no bytes are read.  Please note that this\nis the total timeout the read operation will wait and not the interval\ntimeout between two bytes.\n\n```go\n\tc := \u0026serial.Config{Name: \"COM45\", Baud: 115200, ReadTimeout: time.Second * 5}\n\t\n\t// In this mode, you will want to suppress error for read\n\t// as 0 bytes return EOF error on Linux / POSIX\n\tn, _ = s.Read(buf)\n```\n\nPossible Future Work\n-------------------- \n- better tests (loopback etc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblues%2Fserial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblues%2Fserial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblues%2Fserial/lists"}