GithubHelp home page GithubHelp logo

jonaias / data-link-byte-framing Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 3.0 4 KB

Implement Data Link Layer framing using "Flag bytes with byte stuffing"

License: MIT License

QMake 1.47% C 98.53%
framing-protocols c11 byte-stuffing serial-communication data-link-layer

data-link-byte-framing's Introduction

Data Link framing using "Flag bytes with byte stuffing"

Implemented after https://eli.thegreenplace.net/2009/08/12/framing-in-serial-communications/. Frame size limit is defined by MAX_FRAME_SIZE.

Frame Encoding

The frame to be encoded is assumed to be complete when calling encodeFrame. Callback writeToDevice receives encoded bytes

Frame Decoding

DecodeData stores decodeFrame state, allowing consecutively calling with any number of bytes. Callback processDecodedFrame received decoded frame if any is formed.

DecodeData should be always initialized once with:

    data.currentOutput = data.decodedOutput;
    data.state = WAIT_HEADER;

As DecodeData uses pointer aritimetic to store output index, it should never be copied.

data-link-byte-framing's People

Contributors

jonaias avatar

Watchers

 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.