Giter VIP home page Giter VIP logo

tinyframe's Issues

multiple instances with different frame structure?

Hi, I see in the readme file, it said:

TinyFrame is re-entrant and supports creating multiple instances with the limitation that their structure (field sizes and checksum type) is the same.

In my C++ desktop application, I have use the TinyFrame library for both UART and Socket communication. In Socket, I would like CRC disabled(Because this will save a lot of computation in the target ARM based circuit board) and in UART I would like CRC enabled. Is it possible?

Any workaround about this?
For example, maybe, I can create two namespaces, and wrap those .h and .c files in different namespaces?
Or, I just have to rename all the C global functions for another frame structure?
Thanks.

Disallow SOF in messages to handle mid-message death

If one side of the communications dies mid-transfer, it could get "out of sync" with the state machine's idea of what things should look like.

One approach could be to have a SOF byte and an escape byte. If either of those bytes need to appear in the stream, send the escape byte and invert the bits of the required byte.

Thus, if you receive a SOF mid-message, you know the message is bad and to restart the state machine.

Thoughts?

Add notes to the README about TF_Accept

The usage notes are very good about saying how to set up the write side, but mention nothing about the read side. I'd add a blurb about 'TF_Accept', but I'm still setting up my particular usage

Optional device address fields

Something I thought of when working with sx1278's

If the field is right at the beginning, one could use it for sync-word filtering. This would effectively make TinyFrame multi-drop / multi-master network capable.

This would be a big API / structure change, so it'd require a major version bump.

Maybe should add some ack mechanism

Hi, thank you share this libray, I want use this libray to my OTA funcation, Maybe,receiver should response to sender the complete and correct of data

A demo of using the Payloadparser

Hello,

Can you please make a simple demo of using the payload parser .

I did this and I am gettings segfaults.

`#include <stdio.h>
#include "./utilities/payload_parser.h"

PayloadParser *pp;

unsigned char buff[] = "Hello";
unsigned char *buf = buff;
bool emptyhandler()
{
printf("Error\n");
return true;
}

int main()
{
pp_start(buf, sizeof(buff), emptyhandler);
unsigned char ping = pp_u8(pp);
return 0;
}
`

if TF_CKSUM_NONE is used, we can use memcpy instead of single byte copy loop

The patch something like this:

#if TF_CKSUM_TYPE == TF_CKSUM_NONE
    memcpy(outbuff, data, data_len);
#else
    for (i = 0; i < data_len; i++) {
        b = data[i];
        outbuff[pos++] = b;
        CKSUM_ADD(*cksum, b);
    }
#endif // TF_CKSUM_TYPE

In our test, it looks like using memcpy is much faster, and in one test, it reduced to 1/40 of the manually loop byte copy time.

I have use this library in several projects.

For example, I use it in UDP data sending, I think we don't need CRC check here, because the UDP protocol already does some data check.
While the UDP package is not sending in a synchronized way, so I use the ID filed of the TinyFrame to resort the messages. It works really nice! Thanks for this great project!

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.