Giter Site home page Giter Site logo

tiny-cute-serializer's Introduction

Tiny-cute-serializer

Simple and reliable data serializer dedicated for 8 bit microcontrollers to use with UART/SPI etc.

Features

  • auto detection of packet types
  • driven by events

Usage

Example usage is shown in main.cpp file.
Build using:

make

Example data packet

For struct

#pragma pack(push, 1)
struct testStruct
{
  char someString[8];
  char character;
  uint32_t number;
};
#pragma pack(pop)


testStruct myStruct;
strcpy(myStruct.someString, "cutestr");
myStruct.number =  0xdeadbeef;
myStruct.character = '~';

packet should be: :020d63757465737472007eefbeadde
I'm using : as start of packet and data is sent in hexadecimal format but by ASCII (which makes it 2 times slower than raw format) but it's still faster and simpler than sending data by JSON. It's important to put these #pragmas because it forces struct to generate same results on diifferent hardware which is important when using my library to communicate PC and embdedded stuff.

TODO

  • move ASCII style packet functions to core of the library (almost done except parsePacket)
  • add examples
  • add headers and modify makefile to generate library file
  • check for bugs
  • optimize for memory usage

tiny-cute-serializer's People

Contributors

domin746826 avatar

Watchers

 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.