hirotakaster / CoAP-simple-library

Other
111 stars 48 forks source link

Made the library compatible with stock Arduino #21

Closed al3xsh closed 3 years ago

al3xsh commented 3 years ago

This pull request does two things:

  1. We revert the implementation of CoapCallback to use function pointers because Arduino doesn't have access to the C++ 11 standard template library (so can't use typedef std::function<void(CoapPacket &, IPAddress, int)> CoapCallback;)

  2. We reduce the maximum size of the COAP buffer so it works out-of-the-box with the Arduino Uno. I've changed it to 128, but you can get away with 256 (or potentially even 512) - but this doesn't leave you much space to play with on the Arduino Uno.

Regards,

Alex