Git Product home page Git Product logo

libulink's Introduction

ULINK
=====

Micro data framing library for embedded applications. Implements data framing
mechanism similar to PPP. Ensures that we can separate data into packets when
sending it over a serial stream such as a UART port. 

Works on arduino. 

METHOD OF OPERATION
===================

* each frame ends with frame delimiter (0x7e)
* each frame delimiter inside the data is escaped using escape sequence (0x7d)
* each escape character in data is also escaped
* each escaped character is XORed with 0x20 before being placed inside the tx buffer

This guarantees that 0x7d and 0x7e never occur as part of the data inside a
packet. Upon reception, we unescape these sequences to recover the data by
XORing the escaped characters with 0x20 again. 

It is possible to pack arbitrary amounts of data and even split the data into
smaller packets when transmitting it (such as when sending the data over a
radio modem that supports only 64 byte packets). This library operates on
streams of data, so when you parse out a stream of incoming data, you can parse
as much as you receive and then continue when you receive more data by simply
calling the parser repeatedly. The parser always stores partial packet inside
it's buffer and resets it automatically when it receives corrupted packets. 

PACKET POLICY
=============

Corrupt packets are automatically dropped. This includes: 

* packets with wrong crc
* packets shorter than 2 bytes (crc is 2 bytes)
* packets that contain invalid escaped characters 

BUILDING
========

You can cross compile this library for any platform using standard configure
script and by passing cross compilation flags to it. 

To build the library locally do: 

./configure
make 
make install

LICENSE
=======

See COPYING

Copyright (c) 2016 Martin Schröder, All rights reserved. 

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.