25 #define COAP_DEBUG_FD stdout
32 #define COAP_ERR_FD stderr
45 #define COAP_LOG_CIPHERS (LOG_DEBUG+2)
50 #if !defined(RIOT_VERSION)
75 #define LOG_NOTICE (5)
78 #define COAP_LOG_CIPHERS (9)
136 #if (defined(__GNUC__))
138 const char *format, ...) __attribute__ ((format(printf, 2, 3)));
152 #define coap_log(level, ...) do { \
153 if ((int)((level))<=(int)coap_get_log_level()) \
154 coap_log_impl((level), __VA_ARGS__); \
218 unsigned char *buffer,
size_t size);
int coap_debug_set_packet_loss(const char *loss_level)
Set the packet loss level for testing.
int coap_debug_send_packet(void)
Check to see whether a packet should be sent or not.
void coap_set_log_handler(coap_log_handler_t handler)
Add a custom log callback handler.
const char * coap_package_name(void)
Get the library package name.
coap_log_t coap_get_log_level(void)
Get the current logging level.
char * coap_string_tls_version(char *buffer, size_t bufsize)
Build a string containing the current (D)TLS library linked with and built for version.
void coap_show_pdu(coap_log_t level, const coap_pdu_t *pdu)
Display the contents of the specified pdu.
coap_log_t
Pre-defined log levels akin to what is used in syslog with LOG_CIPHERS added.
void coap_set_log_level(coap_log_t level)
Sets the log level to the specified value.
void coap_log_impl(coap_log_t level, const char *format,...)
Writes the given text to COAP_ERR_FD (for level <= LOG_CRIT) or COAP_DEBUG_FD (for level >= LOG_ERR).
size_t coap_print_addr(const coap_address_t *address, unsigned char *buffer, size_t size)
Print the address into the defined buffer.
void coap_show_tls_version(coap_log_t level)
Display the current (D)TLS library linked with and built for version.
void coap_set_show_pdu_output(int use_fprintf)
Defines the output mode for the coap_show_pdu() function.
const char * coap_package_version(void)
Get the library package version.
char * coap_string_tls_support(char *buffer, size_t bufsize)
Build a string containing the current (D)TLS library support.
void(* coap_log_handler_t)(coap_log_t level, const char *message)
Logging callback handler definition.
@ COAP_LOG_CIPHERS
CipherInfo.
Pre-defined constants that reflect defaults for CoAP.
multi-purpose address abstraction
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload mark...