Skip to content
Commits on Mar 10, 2016
  1. Use common test

    committed Mar 10, 2016
Commits on Mar 4, 2016
  1. Fix Makefile

    Any make target failed with:
    make: *** No rule to make target 'rebar3', needed by 'compile'.  Stop.
    Reported by @jj1bdx in #4
    committed Mar 4, 2016
Commits on Aug 13, 2015
  1. @nrdufour
  2. @nrdufour

    Porting srly to rebar3.

    nrdufour committed with Aug 12, 2015
Commits on Jul 31, 2015
  1. srly: handle fd errors

    Any read/write errors will cause the port to close. srly will receive an
    'EXIT' message from the port.
    Always return 'ok' from close/1 since the gen_server may have stopped
    due to the port exiting.
    committed Jul 31, 2015
Commits on Jul 30, 2015
  1. write/2: check for partial writes in Erlang code

    Simplify the C code by always returning the number of bytes written.
    Check for a complete write in the Erlang code and return the atom 'ok'.
    committed Jul 30, 2015
Commits on Jun 26, 2015
Commits on Jun 22, 2015
  1. tcsetattr/3: add tcsasoft

    committed Jun 22, 2015
Commits on Jun 20, 2015
  1. Fix dialyzer warnings

    committed Jun 20, 2015
  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.
    committed Jun 20, 2015
Commits on Jun 19, 2015
Commits on Jun 18, 2015
  1. readme: update constants

    committed Jun 18, 2015
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!
    committed Jun 17, 2015
  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!
    committed Jun 17, 2015
Commits on May 18, 2015
  1. constants: add TIOCMSET

    committed May 18, 2015
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
    committed May 17, 2015
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!
    committed Jan 31, 2015
  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
    committed Jan 31, 2015
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
    committed Jan 16, 2015
  2. Add test for constant/0,1

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

    committed Jan 15, 2015
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
    committed Jan 14, 2015
Commits on Dec 30, 2014
  1. Compilation fix for Solaris

    committed Dec 30, 2014
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.
    committed Nov 25, 2014
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.
    committed Nov 24, 2014
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
    committed Nov 23, 2014
  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.
    committed Nov 23, 2014
  3. Add typespecs for NIF functions

    committed Nov 23, 2014
  4. write: accept an iolist

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

    committed Sep 28, 2014
Commits on Sep 26, 2014
  1. Copyright heartbeat

    committed Sep 26, 2014
Something went wrong with that request. Please try again.