Giter VIP home page Giter VIP logo

sl's Introduction

SL is a Unix (and Windows in the future?) interface for serial port devices.

API
---
start() -> Port

 Load the driver, if needed,  and open a port to the driver.

stop(Port) -> ok

 Terminate the port, and cleanup if neccessary.

options() -> [Opts]

  Return a list of the options names possible to configure:

     dev    - The device name i.e "/dev/ttyS0" "COM1"
     baud       - The baud rate         (9600...115200 .. os specific)
     csize      - Character size        (5,6,7,8)
     bufsz      - Receive buffer size   (integer())
     stopb      - Number of stop bits   (0,1,2)
     parity     - The Parity bits       (0,1)
     hwflow     - Hardware flow control (true/false)
     swflow     - Software flow control (true/false)
     xonchar    - Flow control char when swflow
     xoffchar   - Flow control char when swflow
     echo   - Echo mode

getopts(Port, [Opt]) ->
          [{Opt,Value}]

  For each option Opt return the pair {Opt,Value}

setopt(P, Opt, Arg) -> ok | {error,Reason}

  Set an option.

setopts(P, [{Opt,Arg}]) -> ok | {error,Reason}

open(Dev, Opts) -> {ok,P} | {error,Reason}

  A combined operation of start/setopts/open.

open(P) -> ok | {error,Reason}

  Open the device set by setopt(.., [{dev,Device}])

close(P) -> ok

  Closes the device opened by open/1.

connect(P) -> ok.

  Same as open.

disconnect(P) -> ok.

  Do a hangup then close.

revert(P) -> ok.

  Revert settings done by setopt.

update(P) -> ok.

  Update the parameters changed with setopt.

send(P, Data) -> ok.

  Transmit the iolist in Data to the device in P

sl's People

Contributors

alexeyr avatar halzy avatar pusewicz avatar

Watchers

James Cloos avatar Duncan McGreggor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.