All Projects → distributed → Sers

distributed / Sers

Licence: mit
Serial port access for the Go programming language.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Sers

St handeye graph
General hand-eye calibration based on reprojection error minimization and pose graph optimization
Stars: ✭ 26 (-13.33%)
Mutual labels:  cross-platform
Tty Which
Cross-platform implementation of Unix `which` command
Stars: ✭ 11 (-63.33%)
Mutual labels:  cross-platform
Awesome Flutter
An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.
Stars: ✭ 38,582 (+128506.67%)
Mutual labels:  cross-platform
Gwen Nolegacy Opentk Renderer
A C# port of the GWEN GUI library, with an OpenTK renderer
Stars: ✭ 26 (-13.33%)
Mutual labels:  cross-platform
Pgweb
Cross-platform client for PostgreSQL databases
Stars: ✭ 7,114 (+23613.33%)
Mutual labels:  cross-platform
Qpmx
A frontend for qpm, to provide source and build caching
Stars: ✭ 13 (-56.67%)
Mutual labels:  cross-platform
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (-16.67%)
Mutual labels:  cross-platform
Timeline
Awesome UI: Timeline with images in Xamarin.Forms.
Stars: ✭ 29 (-3.33%)
Mutual labels:  cross-platform
React Native Audio Toolkit
Cross-platform audio library for React Native
Stars: ✭ 861 (+2770%)
Mutual labels:  cross-platform
Youtube Dl Gui
A cross platform front-end GUI of the popular youtube-dl written in wxPython.
Stars: ✭ 7,914 (+26280%)
Mutual labels:  cross-platform
Real Live
A cross-platform network media aggregation application.
Stars: ✭ 942 (+3040%)
Mutual labels:  cross-platform
System.io.abstractions
Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!
Stars: ✭ 844 (+2713.33%)
Mutual labels:  cross-platform
Yarpm
CLI tool to run npm scripts with either npm or yarn, depending on how it was started
Stars: ✭ 13 (-56.67%)
Mutual labels:  cross-platform
Hozz
[Development indefinitely suspended] A better way to manage your hosts.
Stars: ✭ 937 (+3023.33%)
Mutual labels:  cross-platform
Dotfeather
A closs-platform generic gameengine built on C#/.NET Standard 2.1
Stars: ✭ 28 (-6.67%)
Mutual labels:  cross-platform
Uduino
Simple and easy connection between Arduino and Unity
Stars: ✭ 25 (-16.67%)
Mutual labels:  serial-ports
Giu
Cross platform rapid GUI framework for golang based on Dear ImGui.
Stars: ✭ 862 (+2773.33%)
Mutual labels:  cross-platform
Sandpolis
Experimental remote monitoring and management
Stars: ✭ 30 (+0%)
Mutual labels:  cross-platform
Zeus
A high performance, cross-platform Internet Communication Engine. Developed with native socket API. Aim at handling millions of concurrent connections.
Stars: ✭ 30 (+0%)
Mutual labels:  cross-platform
React Native Pathjs Charts
Android and iOS charts based on react-native-svg and paths-js
Stars: ✭ 877 (+2823.33%)
Mutual labels:  cross-platform

sers

Overview

Package sers offers serial port access for the Go programming language. It is a stated goal of this project to allow for configuration of non-traditional bit rates as the may be useful in a wide range of embedded projects.

Functionality

Primarily the library provides an implementation of the SerialPort interface for the supported platforms. For every serial port, you get the functionality of an io.ReadWriteCloser as well as methods to set and query various parameters. Secondarily it helps you communicate with the users of your programs through the use of mode strings that represent the data than can be written and read with {Get,Set}Mode.

The SetMode() and GetMode() methods allow setting and retrieving key parameters such as baud rate, number of data bits, number of stop bits and the used parity scheme. As far as the underlying platforms support it, SetMode allows you to set arbitrary, non-traditional baud rate. The generation of break conditions is supported through the SetBreak() method. The behavior of the Read() method can be fine tuned with the SetReadParams() method.

The library offers the concept of mode strings like 9600,7e1 or 57600,8n1,rtscts. These can be parsed by ParseModestring into an internal representation that can be set through SetModeStruct. The mode string is quite flexible and allows omission of certain parts. Mode strings are easily read and written by humans. This makes the user interface of programs that use serial ports easier to create and use: programs do not need to provide a plethora of command line switches, but can accept one string and delegate handling to sers.

Due to backwards compatibility there is a difference in data representation between SetMode and GetMode.

Platforms

sers has been successfully used on Mac OS X, Linux and Windows.

The following known restrictions apply.

Linux

  • cgo is needed to compile sers
  • Using non-traditional baud rates may not work. This depends on whether the system headers have correct definitions for struct termios2. Traditional baud rates use traditional termios baud rate setting methods via defines such as B1200 etc. The author is successfully using non-traditional baud rates on Linux, though.

OS X

  • Calling GetMode before having called SetMode will result in an error.
  • cgo is needed to compile sers

Windows

  • Only NO_HANDSHAKE is supported.

Feature ideas

Not relying on cgo

Compilation for Linux and OS X involved use of cgo and thus a C compiler. This makes cross compilation harder for every user of sers.

If all necessary definitions for serial port handling can be expressed in Go, it is conceivable to make a pure-Go version for both these operation systems.

Deadlines

Adding deadline methods, SetDeadline as well as Set{Read,Write}Deadline.

On termios platforms this relatively easy as we can let the runtime netpoller do the heavy lifting. On Windows I do not yet understand the most promising path to implementation.

net.Conn support

Building on deadlines, {Local,Remote}Addr methods would enable a SerialPort to implement net.Conn. This makes it easy to plug a SerialPort into various network protocol implementations that build on byte streams.

Regularize interface

With a working deadline implementation, the wart of SetReadParams could be dropped or, at least, relegated to platform specific support. {Get,Set}Mode can be made to both take a Mode struct. Representation of parity, stop bit and handshake settings will be move to their own type to prevent mixups.

These changes would mean a new major version as they imply modifications that are not backwards compatible.

Release History

v1.1.0

  • add GetMode() to SerialPort
  • add modestrings, ParseModestring
  • add Mode struct
  • add a more detailed README.md

v1.0.2

  • termios platofrms: make Close() unblock readers

v1.0.1

  • use our own definition of struct termios2 as the headers on a number of linux distributions are wrong.
  • add verification/setbaudrate

v1.0.0

sers appears in the primordial soup.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].