Golioth Firmware SDK
Loading...
Searching...
No Matches
golioth_sys.h File Reference
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <golioth/config.h>

Go to the source code of this file.

Data Structures

struct  golioth_timer_config
 
struct  golioth_thread_config
 

Macros

#define GOLIOTH_SYS_WAIT_FOREVER   -1
 
#define golioth_sys_malloc(sz)   malloc((sz))
 
#define golioth_sys_free(ptr)   free((ptr))
 
#define golioth_sys_srand(seed)   srand((seed))
 
#define golioth_sys_rand()   rand()
 
#define GLTH_LOGV(TAG, ...)
 
#define GLTH_LOGD(TAG, ...)
 
#define GLTH_LOGI(TAG, ...)
 
#define GLTH_LOGW(TAG, ...)
 
#define GLTH_LOGE(TAG, ...)
 
#define GLTH_LOG_BUFFER_HEXDUMP(TAG, ...)
 

Typedefs

typedef void * golioth_sys_sem_t
 
typedef void * golioth_sys_timer_t
 
typedef void(* golioth_sys_timer_fn_t) (golioth_sys_timer_t timer, void *user_arg)
 
typedef void * golioth_sys_thread_t
 
typedef void(* golioth_sys_thread_fn_t) (void *user_arg)
 

Functions

void golioth_sys_msleep (uint32_t ms)
 
uint64_t golioth_sys_now_ms (void)
 
golioth_sys_sem_t golioth_sys_sem_create (uint32_t sem_max_count, uint32_t sem_initial_count)
 
bool golioth_sys_sem_take (golioth_sys_sem_t sem, int32_t ms_to_wait)
 
bool golioth_sys_sem_give (golioth_sys_sem_t sem)
 
void golioth_sys_sem_destroy (golioth_sys_sem_t sem)
 
int golioth_sys_sem_get_fd (golioth_sys_sem_t sem)
 
golioth_sys_timer_t golioth_sys_timer_create (const struct golioth_timer_config *config)
 
bool golioth_sys_timer_start (golioth_sys_timer_t timer)
 
bool golioth_sys_timer_reset (golioth_sys_timer_t timer)
 
void golioth_sys_timer_destroy (golioth_sys_timer_t timer)
 
golioth_sys_thread_t golioth_sys_thread_create (const struct golioth_thread_config *config)
 
void golioth_sys_thread_destroy (golioth_sys_thread_t thread)
 
void golioth_sys_client_connected (void *client)
 
void golioth_sys_client_disconnected (void *client)
 

Macro Definition Documentation

◆ GLTH_LOG_BUFFER_HEXDUMP

#define GLTH_LOG_BUFFER_HEXDUMP ( TAG,
... )

Definition at line 195 of file golioth_sys.h.

◆ GLTH_LOGD

#define GLTH_LOGD ( TAG,
... )

Definition at line 191 of file golioth_sys.h.

◆ GLTH_LOGE

#define GLTH_LOGE ( TAG,
... )

Definition at line 194 of file golioth_sys.h.

◆ GLTH_LOGI

#define GLTH_LOGI ( TAG,
... )

Definition at line 192 of file golioth_sys.h.

◆ GLTH_LOGV

#define GLTH_LOGV ( TAG,
... )

Definition at line 190 of file golioth_sys.h.

◆ GLTH_LOGW

#define GLTH_LOGW ( TAG,
... )

Definition at line 193 of file golioth_sys.h.

◆ golioth_sys_free

#define golioth_sys_free ( ptr)    free((ptr))

Definition at line 90 of file golioth_sys.h.

◆ golioth_sys_malloc

#define golioth_sys_malloc ( sz)    malloc((sz))

Definition at line 86 of file golioth_sys.h.

◆ golioth_sys_rand

#define golioth_sys_rand ( )    rand()

Definition at line 103 of file golioth_sys.h.

◆ golioth_sys_srand

#define golioth_sys_srand ( seed)    srand((seed))

Definition at line 99 of file golioth_sys.h.

◆ GOLIOTH_SYS_WAIT_FOREVER

#define GOLIOTH_SYS_WAIT_FOREVER   -1

Definition at line 19 of file golioth_sys.h.

Typedef Documentation

◆ golioth_sys_sem_t

typedef void* golioth_sys_sem_t

Definition at line 29 of file golioth_sys.h.

◆ golioth_sys_thread_fn_t

typedef void(* golioth_sys_thread_fn_t) (void *user_arg)

Definition at line 66 of file golioth_sys.h.

◆ golioth_sys_thread_t

typedef void* golioth_sys_thread_t

Definition at line 64 of file golioth_sys.h.

◆ golioth_sys_timer_fn_t

typedef void(* golioth_sys_timer_fn_t) (golioth_sys_timer_t timer, void *user_arg)

Definition at line 44 of file golioth_sys.h.

◆ golioth_sys_timer_t

typedef void* golioth_sys_timer_t

Definition at line 42 of file golioth_sys.h.

Function Documentation

◆ 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()

void golioth_sys_sem_destroy ( golioth_sys_sem_t sem)

◆ golioth_sys_sem_get_fd()

int golioth_sys_sem_get_fd ( golioth_sys_sem_t sem)

◆ golioth_sys_sem_give()

bool golioth_sys_sem_give ( golioth_sys_sem_t sem)

◆ golioth_sys_sem_take()

bool golioth_sys_sem_take ( golioth_sys_sem_t sem,
int32_t ms_to_wait )

◆ golioth_sys_thread_create()

golioth_sys_thread_t golioth_sys_thread_create ( const struct golioth_thread_config * config)

◆ golioth_sys_thread_destroy()

void golioth_sys_thread_destroy ( golioth_sys_thread_t thread)

◆ golioth_sys_timer_create()

golioth_sys_timer_t golioth_sys_timer_create ( const struct golioth_timer_config * config)

◆ golioth_sys_timer_destroy()

void golioth_sys_timer_destroy ( golioth_sys_timer_t timer)

◆ golioth_sys_timer_reset()

bool golioth_sys_timer_reset ( golioth_sys_timer_t timer)

◆ golioth_sys_timer_start()

bool golioth_sys_timer_start ( golioth_sys_timer_t timer)