Sternum Embedded SDK
system_port.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "sternum_sdk/api/sternum_error_codes.h"

Go to the source code of this file.

Functions

int sternum_port_initialize_lock_objects (void)
 Sternum's port to initialize synchronization objects. More...
 
void sternum_port_deinitialize_lock_objects (void)
 Sternum's port to deinitialize synchronization objects. More...
 
int sternum_port_trace_buffer_mutex_lock (void)
 Sternum's port to lock the trace buffer mutex. More...
 
void sternum_port_trace_buffer_mutex_unlock (void)
 Sternum's port to unlock the trace buffer mutex. More...
 
void sternum_port_packets_buffer_mutex_lock (void)
 Sternum's port to lock the packets buffer mutex. More...
 
void sternum_port_packets_buffer_mutex_unlock (void)
 Sternum's port to unlock the packets buffer mutex. More...
 
void sternum_port_transmission_mutex_lock (void)
 Sternum's port to lock the transmission mutex. More...
 
void sternum_port_transmission_mutex_unlock (void)
 Sternum's port to unlock the transmission mutex. More...
 
void sternum_port_transmission_state_mutex_lock (void)
 Sternum's port to lock the transmission timestamp mutex. More...
 
void sternum_port_transmission_state_mutex_unlock (void)
 Sternum's port to unlock the transmission timestamp mutex. More...
 
unsigned long int sternum_port_get_time (void)
 Sternum's port to return the current time in milliseconds. More...
 
void sternum_log (int log_level, const char *format,...)
 Logging function for the SDK. More...
 

Function Documentation

◆ sternum_log()

void sternum_log ( int  log_level,
const char *  format,
  ... 
)

Logging function for the SDK.

Implement this function if you wish to use your system's logger. Default implementing will use printf.

Parameters
log_levellog level
formatlog format
...log arguments

◆ sternum_port_deinitialize_lock_objects()

void sternum_port_deinitialize_lock_objects ( void  )

Sternum's port to deinitialize synchronization objects.

This function should release all acquired resources and allocated memory.

◆ sternum_port_get_time()

unsigned long int sternum_port_get_time ( void  )

Sternum's port to return the current time in milliseconds.

Returns
The current time in milliseconds.

◆ sternum_port_initialize_lock_objects()

int sternum_port_initialize_lock_objects ( void  )

Sternum's port to initialize synchronization objects.

This function should create and initialize mutexes.

Note
This port will be executed only after the initialization of the Sternum system. At that point, it is assumed that the relevant hardware/software were already enabled.
Returns
0 on success and 1 on failure.

◆ sternum_port_packets_buffer_mutex_lock()

void sternum_port_packets_buffer_mutex_lock ( void  )

Sternum's port to lock the packets buffer mutex.

Note
this function should block indefinitely.

◆ sternum_port_packets_buffer_mutex_unlock()

void sternum_port_packets_buffer_mutex_unlock ( void  )

Sternum's port to unlock the packets buffer mutex.

◆ sternum_port_trace_buffer_mutex_lock()

int sternum_port_trace_buffer_mutex_lock ( void  )

Sternum's port to lock the trace buffer mutex.

Note
this function should block indefinitely.
Returns
0 on success and 1 on failure.

◆ sternum_port_trace_buffer_mutex_unlock()

void sternum_port_trace_buffer_mutex_unlock ( void  )

Sternum's port to unlock the trace buffer mutex.

◆ sternum_port_transmission_mutex_lock()

void sternum_port_transmission_mutex_lock ( void  )

Sternum's port to lock the transmission mutex.

Note
this function should block indefinitely.

◆ sternum_port_transmission_mutex_unlock()

void sternum_port_transmission_mutex_unlock ( void  )

Sternum's port to unlock the transmission mutex.

◆ sternum_port_transmission_state_mutex_lock()

void sternum_port_transmission_state_mutex_lock ( void  )

Sternum's port to lock the transmission timestamp mutex.

Note
this function should block indefinitely.

◆ sternum_port_transmission_state_mutex_unlock()

void sternum_port_transmission_state_mutex_unlock ( void  )

Sternum's port to unlock the transmission timestamp mutex.