Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Commits on Jun 26, 2015
Commits on Jun 22, 2015
  1. tcsetattr/3: add tcsasoft

Commits on Jun 20, 2015
  1. Fix dialyzer warnings

  2. serctl: fix handling of invalid constants

    A bug in the handling of non-portable/invalid constants would result
    in an infinite loop. Better define the behaviour of atoms when used as
    * tcsetattr/3
      If the action atom is not supported on this platform, return
      {error,unsupported}. The documentation lists only 3 valid atoms
      (tcsanow, tcsadrain, tcsaflush), however it is possible that some
      platforms may support other actions (e.g., TCSASOFT on the BSDs).
    * cfsetispeed/2, cfsetospeed/2, ispeed/2, ospeed/2
      These functions do not return an error. Use of an invalid speed on
      this platform will generate a badarg. Portable code will have to
      either test the atom using constant/1 or catch the badarg.
Commits on Jun 19, 2015
Commits on Jun 18, 2015
  1. readme: update constants

Commits on Jun 17, 2015
  1. examples/strobe: remove check for flow control

    From Bob Ballance:
        Another note — I’m using the FTDI drivers suggested by Arduino and
        AdaFruit on my Mac. They have the funny attribute that when you get
        attributes, the flow control is *always* set. So I can set the `flow`
        to false without an error, but the next call to `tcgetattr` shows the
        flow as being true.   This is not the case with a raw tty, just with
        the ‘usb.modem’ device attached to the Arduino.
        As a result, the following line in the strobe example fails:
            ok = serctl:tcsetattr(FD, tcsanow, Termios),
            {ok, Termios1} = serctl:tcgetattr(FD),
        >>>    false = serctl:flow(Termios1),
        I  tested the behavior with raw C code, and confirmed it.
    Thanks Bob!
  2. Fix termios on 64-bit Mac OS X

    struct termios fields on Mac OS X are 8 bytes when running a 64-bit
    version of erlang.
    Thanks to Bob Ballance for discovering the problem and providing a fix!
Commits on May 18, 2015
  1. constants: add TIOCMSET

Commits on May 17, 2015
  1. Update README

    Remove some of the scary language. Hopefully most of the portability
    issues have now been dealt with. The runtime lookup of termios, etc., is
    not performance critical. Most applications will be doing read/writes to
    the serial device. As for the safety of the native serial interface,
    that makes srly useful for finding bugs in the OS!
    Also remove the note about needing to set the serial device into raw
    mode. There are 2 situations where blocking mode might be used:
    * the caller passes in a fd opened by other means
      There's a note already explaining that the fd should be opened in
    * the caller uses tcsetattr/3 to change the mode
Commits on Feb 24, 2015
Commits on Jan 31, 2015
  1. Bump version and tag

    Increment the version and mark this as the stable release:
    Thanks wmealing!
  2. Fix termios/1 on Solaris

    struct termios on Solaris does not contain the ispeed/ospeed fields.
    Add a special case just for solaris.
    Testing was done on a SmartOS VM without a serial port. To simulate:
        export SRLY_TEST_PORT=/dev/tty
        make test
Commits on Jan 16, 2015
  1. Add hw tests for non-destructive functions

    Test requiring hardware. To use the environment variable must be set:
        export SRLY_TEST_PORT=/dev/ttyUSB0
  2. Add test for constant/0,1

    Add a test that will at least exercise loading and running the NIF.
Commits on Jan 15, 2015
  1. serctl: add typespecs

Commits on Jan 14, 2015
  1. readx: perform selective/receive on mailbox

    Use a tagged tuple in the response when reading from the serial port to
    avoid readx/2,3 from matching any message in the process mailbox.
    Reported in #1. Thanks
Commits on Dec 30, 2014
  1. Compilation fix for Solaris

Commits on Nov 25, 2014
  1. Include support for NetBSD and OpenBSD

    From inspection of the header files, struct termios under Net/OpenBSD is
    identical to FreeBSD.
Commits on Nov 24, 2014
  1. cfset[io]speed: crash on allocation failure

    The cfsetispeed(3) and cfsetospeed(3) functions do not fail, however
    the NIF wrapper may fail while trying to allocate memory. Instead of
    expecting the caller to test for an error condition, generate a badarg
    exception, since the error is likely non-recoverable anyway.
Commits on Nov 23, 2014
  1. Bump the version

    Increment the version for typespec changes. Further planned
    * complete typespecs
    * add tests, at least for the functions not dealing with i/o
    * fix the return value of cfsetospeed/cfsetispeed
      Functions return:
        binary() | {error,enomem}
      Since these functions may fail, they should either throw an exception
      on allocation failure or, for pattern matching, be changed to return:
        {ok,binary()} | {error,enomem}
    * per suggestion, make srly into a well behaved application
      srly should be able to deal with the addition and removal of USB
      serial ports.
    * optionally use inert for flow control of data from the serial port
  2. open/1: disallow bad fd

    Fail immediately if an invalid file descriptor is passed into open/1,
    rather than deferring the error to the next read/write.
  3. write: accept an iolist

Commits on Sep 28, 2014
  1. Fix compile errors on BSD

Commits on Sep 26, 2014
  1. Copyright heartbeat

Commits on Feb 8, 2014
Commits on Nov 26, 2013
  1. Fix load problems when using a release

    Thanks to Jan Willem Luiten!
Commits on Nov 11, 2013
Commits on Nov 7, 2013
Commits on Nov 6, 2013
Something went wrong with that request. Please try again.