Sternum Embedded SDK
sternum_sdk.h File Reference

Provides API for Sternum SDK usage. More...

Go to the source code of this file.

Functions

sternum_code_t sternum_sdk_initialize (sternum_sdk_settings_t *settings)
 Initializes the Sternum SDK. More...
 
sternum_code_t sternum_sdk_flush (void)
 Flush transmission queue. More...
 
size_t sternum_sdk_cached_traces_count (void)
 Returns a number of pending traces in cache buffer. More...
 
size_t sternum_sdk_cache_space_available (void)
 Returns available space in packets buffer [bytes]. More...
 
void sternum_sdk_close (void)
 Closes the Sternum SDK. More...
 

Detailed Description

Provides API for Sternum SDK usage.

Function Documentation

◆ sternum_sdk_cache_space_available()

size_t sternum_sdk_cache_space_available ( void  )

Returns available space in packets buffer [bytes].

Returns
size_t Available space in packets buffer [bytes]

◆ sternum_sdk_cached_traces_count()

size_t sternum_sdk_cached_traces_count ( void  )

Returns a number of pending traces in cache buffer.

Returns
size_t Number of pending traces in cache buffer.

◆ sternum_sdk_close()

void sternum_sdk_close ( void  )

Closes the Sternum SDK.

Call initialize to reinitialize.

Note
Call flush before close to prevent data loss
This function blocks until the all resources are released.

◆ sternum_sdk_flush()

sternum_code_t sternum_sdk_flush ( void  )

Flush transmission queue.

This function will send all cached traces to the cloud.

Note
This function will block until all pending data is processed and sent to the cloud.
This function will return without transmission attempt if minimum time between transmissions didn't pass
Returns
STERNUM_SDK_SUCCESS - Transmission successful or no data pending or minimum time between transmission didn't pass (traces will be sent on next flush call)
STERNUM_SDK_NOT_INITIALIZED - Flush not triggered because Sternum SDK is not initialized
STERNUM_SDK_ERROR - Transmission error

◆ sternum_sdk_initialize()

sternum_code_t sternum_sdk_initialize ( sternum_sdk_settings_t settings)

Initializes the Sternum SDK.

This function initializes the Sternum SDK with the provided settings. After successful initialization Sternum SDK is ready to use. The provided settings structure is copied internally for use within the program, ensuring that any changes to the original structure will not affect the functionality.

Parameters
settingsPointer to configured SDK settings structure.
Returns
code_t Status code indicating the success or failure of the initialization. STERNUM_SDK_SUCCESS - initialization successful STERNUM_SDK_INVALID_ARGUMENT - invalid settings provided