Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
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
Commits on May 15, 2013
  1. write: return number of bytes for partial writes

    Handle the case where write(2) is not able to write out the complete
    buffer. I would expect a partial write to be an exceptional condition
    and the code should crash (by matching against the 'ok' atom). My guess
    is that, instead of a partial write, the write will succeed and the next
    call to write will return -1 and set errno.
    The special case of 0 bytes written is not handled since we are not
    dealing with regular files (0 bytes can mean errno is set).
  2. Update rebar URL

Commits on Sep 23, 2012
  1. README cleanup

Commits on Aug 17, 2012
Commits on Mar 13, 2012
  1. Minor cleanup

  2. Rebar fix spam

Commits on Mar 11, 2012
  1. Add an exact read with an optional timeout

    Modified version of an exact read taken from the stk500 library.
    This version spawns another process to do the read from the serial device
    and blocks in receive. If the timeout is reached before the exact number
    of bytes is read (the default is infinity), any accumulated buffer is
    thrown away and an error is returned.
Something went wrong with that request. Please try again.