hirotakaster / CoAP-simple-library

Other
111 stars 48 forks source link

Use std::function in stead of function pointer for callback #6

Closed jackjansen closed 4 years ago

jackjansen commented 6 years ago

This change facilitates much easier integration of CoAP-simple-library with C++ code: in stead of using a C function pointer callbacks are specified using a std::function. This seems common practice nowadays (see for example the esp8266 HTTP Server). By using a std::function it becomes possible to specify instance methods as the callbacks without having to go through C helper functions.

The change should be API-compatible with the original code.

jackjansen commented 4 years ago

This pull request is now superseded by #18, which contains this fix and a few others.