This is CoAP library with a focus on simplicity. It offers minimal CoAP PDU construction and decoding to and from byte buffers.
Diff: dbg.h
- Revision:
- 2:6c2e2cdea46a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dbg.h Sun Jan 20 13:47:43 2019 +0000 @@ -0,0 +1,24 @@ + +#pragma once +#include <stdio.h> + +#define DEBUG 1 +//#undef DEBUG + +#define DBG_NEWLINE "\n" + +#define INFO(...) printf(__VA_ARGS__); printf(DBG_NEWLINE); +#define INFOX(...); printf(__VA_ARGS__); +#define ERR(...) printf(__VA_ARGS__); printf(DBG_NEWLINE); + +#ifdef DEBUG + #define DBG(...) fprintf(stderr,"%s:%d ",__FILE__,__LINE__); fprintf(stderr,__VA_ARGS__); fprintf(stderr,"\r\n"); + #define DBGX(...) fprintf(stderr,__VA_ARGS__); + #define DBGLX(...) fprintf(stderr,"%s:%d ",__FILE__,__LINE__); fprintf(stderr,__VA_ARGS__); + #define DBG_PDU() printBin(); +#else + #define DBG(...) {}; + #define DBGX(...) {}; + #define DBGLX(...) {}; + #define DBG_PDU() {}; +#endif \ No newline at end of file