GithubHelp home page GithubHelp logo

techie66 / libisp2 Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 29 KB

Library for communicating using "Innovate Serial Protocol" version 2

License: GNU General Public License v2.0

Makefile 7.18% Shell 0.41% M4 8.12% C++ 84.30%

libisp2's Introduction

libISP2

A library designed to provide easy communication with a device sending data via the Innovate Serial Protocol version 2. This library is currently read-only.

About

The main project is the library, libISP2, which attempts to decode a stream that uses the Innovate Serial Protocol and provides a simple API to access any valid data within that stream.

There is an example project that shows basic usage with a file descriptor:

/libiSP2_example [-v] [-d] [-s] file

Where:

  • file - A file or device node. If a file, should be raw binary output from a supported Innovate device.
  • -s - file is a serial port (eg. /dev/ttyS0, /dev/ttyUSB0). Sets up correct baud rate and whatnot to work.
  • -d - Add a ~40ms delay to file input to simulate realtime. Don't use this with -s.
  • -v - Not implemented

Details

libISP2 provides the function ISP2::isp2_read. The first argument is a file descriptor, the second is an isp2_t struct. It will attempt to parse one packet from the given file descriptor into the given struct. If successful, ISP2::isp2_read will return 0. If ISP2::isp2_read cannot find a header, it will return -1.

Until I write more better documentation, please have a look at isp2.h for information about the isp2_t struct.

Installation

git clone https://github.com/nearwood/libISP2
cd libISP2
cmake --build build
make
#make install #TODO Incomplete

Binaries would be then located in build/bin and build/lib.

TODO

  • Fix serial port access
  • Move serial port to library, as optional at compile time
  • CLI example
  • GUI gauge example
  • Convert ISP2 library to C, not really using C++ features
  • Export NO_SERIAL_SUPPORT to cmake
  • Use non-blocking IO, and show some kind of RX indicator
  • Add more emojis

Credits

Innovate Motorsports provides documentation detailing the protocol:

libisp2's People

Contributors

techie66 avatar

Stargazers

Simon Keen avatar Ken Malinich avatar Nick avatar

Watchers

 avatar  avatar

Forkers

nearwood

libisp2's Issues

Arduino support / API class inheritance

This library could use out-of-the-box Arduino support.
It should be simple to do by checking for #ifdef Arduino_h and providing a different API that doesn't require file descriptors.

short reads

getting lots of "ISP2 short read: Success" in the log
every once in a while it picks up the correct value

Convert to C

As @nearwood pointed out, this library doesn't use any C++ features, so it should be ported to C.

It's already mostly C syntax anyway. Shouldn't be too hard.

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.