-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple instances with different frame structure? #21
Comments
Hi, unfortunately, as you already found, this isn't possible in the current implementation. Frame structure changes the typedefs and there are ifdefs to choose the checksum variant as well. One could change it to use For the record, I used CRC over USB before, despite USB having native checksums, and it helped me track bugs that mangled the data frames. The algorithms are fast, maybe check if the slowdown is really noticeable for you first. I'm not too familiar with C++, see if you get it working with the namespaces. I'm afraid there's no easy trick here.. |
Hi, thanks for the reply, and it looks like C++ namespace is a good way to solve this issue. I have attach the source files, and you can see I can use the two instance of different TinyFrame.
The way I use is to paste the content of the TF_Config.h file to the TinyFrame.h. And then I make two TinyFrame.h files and two TinyFrame.cpp files, which have different C++ namespace. The main.cpp and usage.cpp will use those different kinds of TinyFrame structures. |
I see a fork for C++ implementation of the TinyFrame which should solve this issue. marcelnabeck/TinyFramePlusPlus: Object-oriented implementation of TinyFrame in C++. — https://github.com/marcelnabeck/TinyFramePlusPlus |
Hi, I see in the readme file, it said:
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.
The text was updated successfully, but these errors were encountered: