Code Monkey home page Code Monkey logo

erlusb's Introduction

erlusb

erlusb might become an Erlang library with a general purpose interface to USB devices some time.

This is my fork of ndim's erlusb project. I like his coding style which is why his code is the basis for this fork. However the gen_server does not store any state so is unnecessary. If the genserver is unnecessary then so is the supervisor, and the code simply becomes a library application.

Run:

$ autoreconf -ivs
$ mkdir _b && cd _b
$ ../configure --prefix=$PWD/../_i
$ make all check install installcheck

This requires that a number of software packages are installed, such as autoconf, automake, erlang, gcc, libtool, GNU make, and more.

It might also be possible to build in the source directory ("./configure && make && make install"), but this is not tested regularly.

No idea (yet). The complex2.erl and stuff are from the Erlang docs, anyway. Strong contenders for the license are LGPL and MIT/Erlang.

As of 2009-01-21, the code is marked as LGPL, but that might change later, depending on many factors internal and external.

  • gen_server for USB device access
    • One gen_server for each Erlang port / USB device, init/2 will open port.
    • handle_info/N being called by behaviour when non-OTP message is received (data from port)
  • USB devices being local, the usb server process only makes sense as {local, Foo}
  • A gen_fsm for devices might make more sense than a gen_server. Communicating with another device by messages is a classical example for communicating FSMs, after all.
  • Make a decision: One Erlang port (one libusb instance per USB host) for all devices, or one Erlang port (one libusb instance per USB device) for each device?

First off, we needed to find out which underlying C API to use. Candidates included libusb-0.1, libusb-1.0, and openusb.

  • libusb-0.1 (or libusb-compat-0.1)
    • compatible implementation for Win32 exists (libusb-win32)
    • no isochronous transfer mode support
    • very commonly used
  • libusb-1.0
    • implementation for Win32 is in the works
    • isochronous transfer mode support
    • very commonly used
  • openusb
    • does anyone use this at all?

The safest bet appeared to be libusb-1.0. It is widely used, and supports all transfer modes. So erlusb builds on libusb-1.0.

erlusb's People

Contributors

ndim avatar tonywallace64 avatar

Watchers

James Cloos avatar  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.