#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include "golioth_config.h"
#include <stdio.h>
#include "golioth_debug.h"
Go to the source code of this file.
|
#define | GOLIOTH_SYS_WAIT_FOREVER -1 |
|
#define | golioth_sys_malloc(sz) malloc((sz)) |
|
#define | golioth_sys_free(ptr) free((ptr)) |
|
#define | LOG_COLOR_RED "31" |
|
#define | LOG_COLOR_GREEN "32" |
|
#define | LOG_COLOR_BROWN "33" |
|
#define | LOG_COLOR(COLOR) "\033[0;" COLOR "m" |
|
#define | LOG_RESET_COLOR "\033[0m" |
|
#define | LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED) |
|
#define | LOG_COLOR_W LOG_COLOR(LOG_COLOR_BROWN) |
|
#define | LOG_COLOR_I LOG_COLOR(LOG_COLOR_GREEN) |
|
#define | LOG_COLOR_D |
|
#define | LOG_COLOR_V |
|
#define | GLTH_LOGX(COLOR, LEVEL, LEVEL_STR, TAG, ...) |
|
#define | GLTH_LOGV(TAG, ...) GLTH_LOGX(LOG_COLOR_V, GOLIOTH_DEBUG_LOG_LEVEL_VERBOSE, "V", TAG, __VA_ARGS__) |
|
#define | GLTH_LOGD(TAG, ...) GLTH_LOGX(LOG_COLOR_D, GOLIOTH_DEBUG_LOG_LEVEL_DEBUG, "D", TAG, __VA_ARGS__) |
|
#define | GLTH_LOGI(TAG, ...) GLTH_LOGX(LOG_COLOR_I, GOLIOTH_DEBUG_LOG_LEVEL_INFO, "I", TAG, __VA_ARGS__) |
|
#define | GLTH_LOGW(TAG, ...) GLTH_LOGX(LOG_COLOR_W, GOLIOTH_DEBUG_LOG_LEVEL_WARN, "W", TAG, __VA_ARGS__) |
|
#define | GLTH_LOGE(TAG, ...) GLTH_LOGX(LOG_COLOR_E, GOLIOTH_DEBUG_LOG_LEVEL_ERROR, "E", TAG, __VA_ARGS__) |
|
#define | GLTH_LOG_BUFFER_HEXDUMP(TAG, payload, size, level) |
|
◆ GLTH_LOG_BUFFER_HEXDUMP
#define GLTH_LOG_BUFFER_HEXDUMP |
( |
|
TAG, |
|
|
|
payload, |
|
|
|
size, |
|
|
|
level |
|
) |
| |
Value: do { \
golioth_debug_hexdump(TAG, payload, size); \
} \
} while (0);
golioth_debug_log_level_t golioth_debug_get_log_level(void)
Definition at line 155 of file golioth_sys.h.
◆ GLTH_LOGD
◆ GLTH_LOGE
◆ GLTH_LOGI
◆ GLTH_LOGV
◆ GLTH_LOGW
◆ GLTH_LOGX
#define GLTH_LOGX |
( |
|
COLOR, |
|
|
|
LEVEL, |
|
|
|
LEVEL_STR, |
|
|
|
TAG, |
|
|
|
... |
|
) |
| |
Value: do { \
printf(COLOR "%s (%" PRIu64 ") %s: ", LEVEL_STR, now_ms, TAG); \
printf(__VA_ARGS__); \
golioth_debug_printf(now_ms, LEVEL, TAG, __VA_ARGS__); \
puts(""); \
} \
} while (0)
uint64_t golioth_time_millis(void)
Time since boot, in milliseconds.
Definition at line 115 of file golioth_sys.h.
◆ golioth_sys_free
#define golioth_sys_free |
( |
|
ptr | ) |
free((ptr)) |
◆ golioth_sys_malloc
#define golioth_sys_malloc |
( |
|
sz | ) |
malloc((sz)) |
◆ GOLIOTH_SYS_WAIT_FOREVER
#define GOLIOTH_SYS_WAIT_FOREVER -1 |
◆ LOG_COLOR
#define LOG_COLOR |
( |
|
COLOR | ) |
"\033[0;" COLOR "m" |
◆ LOG_COLOR_BROWN
#define LOG_COLOR_BROWN "33" |
◆ LOG_COLOR_D
◆ LOG_COLOR_E
◆ LOG_COLOR_GREEN
#define LOG_COLOR_GREEN "32" |
◆ LOG_COLOR_I
◆ LOG_COLOR_RED
#define LOG_COLOR_RED "31" |
◆ LOG_COLOR_V
◆ LOG_COLOR_W
◆ LOG_RESET_COLOR
#define LOG_RESET_COLOR "\033[0m" |
◆ golioth_sys_sem_t
◆ golioth_sys_thread_fn_t
typedef void(* golioth_sys_thread_fn_t) (void *user_arg) |
◆ golioth_sys_thread_t
◆ golioth_sys_timer_fn_t
◆ golioth_sys_timer_t
◆ golioth_sys_client_connected()
void golioth_sys_client_connected |
( |
void * |
client | ) |
|
◆ golioth_sys_client_disconnected()
void golioth_sys_client_disconnected |
( |
void * |
client | ) |
|
◆ golioth_sys_msleep()
void golioth_sys_msleep |
( |
uint32_t |
ms | ) |
|
◆ golioth_sys_now_ms()
uint64_t golioth_sys_now_ms |
( |
void |
| ) |
|
◆ golioth_sys_sem_create()
golioth_sys_sem_t golioth_sys_sem_create |
( |
uint32_t |
sem_max_count, |
|
|
uint32_t |
sem_initial_count |
|
) |
| |
◆ golioth_sys_sem_destroy()
◆ golioth_sys_sem_give()
◆ golioth_sys_sem_take()
◆ golioth_sys_thread_create()
◆ golioth_sys_thread_destroy()
◆ golioth_sys_timer_create()
◆ golioth_sys_timer_destroy()
◆ golioth_sys_timer_reset()
◆ golioth_sys_timer_start()