svperbeast / struct

pack and unpack binary data.
MIT License
65 stars 17 forks source link

Does this library work on Arduino IDE? #9

Open VigneshVicky97 opened 4 months ago

VigneshVicky97 commented 4 months ago

How can I convert this library so that I can use it with Arduino IDE. I am sending struct.pack() data from RPi4 to ESP32 through UART. In order to decode the received message, I want this library to work on my Arduino IDE for ESP32. How can I do that?

svperbeast commented 4 months ago

Hi @VigneshVicky97

struct depends on following standard headers:

#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <math.h>

These header files would be installed as part of Arduino IDE package.

You can include struct.h, struct_endian.h, struct.c, struct_endian.c files into your project.

ref. adding external c file