Sternum Embedded SDK
sternum_sdk_settings_t Struct Reference

Detailed Description

Configuration structure for initializing the SDK.

This structure must be filled by the user before initializing the SDK.

#include <sternum_settings.h>

Data Fields

uint32_t inter_transmission_delay_ms
 Time to wait between each transmission [ms]. More...
 
const char * firmware_version
 String identifying client's application firmware version. More...
 
bool flush_automatically
 Option for transmitting traces immediately if possible. More...
 
unsigned char * trace_buffer
 Pointer to trace_buffer - array serving as buffer for constructing single trace. More...
 
size_t trace_buffer_size
 Size of trace_buffer in bytes. More...
 
unsigned char * communication_buffer
 Pointer to communication_buffer - array serving as RAM cache for all pending traces. More...
 
size_t communication_buffer_size
 Size of communication_buffer in bytes. More...
 
uint64_t access_token
 Access token is device type ID. More...
 
uint64_t device_id
 Device ID unique for each device (eg. More...
 

Field Documentation

◆ access_token

uint64_t sternum_sdk_settings_t::access_token

Access token is device type ID.

It must match access token in Sternum Platform.

◆ communication_buffer

unsigned char* sternum_sdk_settings_t::communication_buffer

Pointer to communication_buffer - array serving as RAM cache for all pending traces.

The communication buffer size should be greater than the trace_buffer size to ensure it can accommodate the protocol header and pending traces. If the communication buffer becomes full, any additional traces will be dropped. Therefore, it is crucial to configure the size appropriately based on the expected volume of trace data and frequency of transmission.

Note
Minimum suggested size is 1024. The bigger this buffer is, the more pending traces can be accumulated. Adjust the size according to specific application needs, ensuring that it is sufficient to handle the expected load without causing trace data loss.

◆ communication_buffer_size

size_t sternum_sdk_settings_t::communication_buffer_size

Size of communication_buffer in bytes.

◆ device_id

uint64_t sternum_sdk_settings_t::device_id

Device ID unique for each device (eg.

device serial number or unique random number).

◆ firmware_version

const char* sternum_sdk_settings_t::firmware_version

String identifying client's application firmware version.

◆ flush_automatically

bool sternum_sdk_settings_t::flush_automatically

Option for transmitting traces immediately if possible.

If enabled, each usage of STERNUM_ADS_TRACE(...) will trigger transmission attempt immediately.

Note
If the elapsed time since last transmissions is less than inter_transmission_delay_ms trace will not be sent, but will be kept in in packet buffer until next transmission request.

◆ inter_transmission_delay_ms

uint32_t sternum_sdk_settings_t::inter_transmission_delay_ms

Time to wait between each transmission [ms].

Note
Ensure a minimal time gap between consecutive transmissions for successful transmission. If the time is set too small, it may lead to transmission failures and packet loss.

If flush or automatic flush is called before inter_transmission_delay_ms time passed, it will not be executed. Traces will be kept in buffer awaiting next transmission attempt.

Possible value range [0; UINT_MAX]. The value should be chosen based on your network specification. Requires proper implementation of sternum_port_get_time. Default is 100 [ms].

◆ trace_buffer

unsigned char* sternum_sdk_settings_t::trace_buffer

Pointer to trace_buffer - array serving as buffer for constructing single trace.

The buffer size determines the maximum length of a single trace. Increasing the buffer size allows for longer trace construction and transmission.

Trace buffer of size 1024 bytes should fit the length of most traces. If memory constraints are a concern, consider reducing the size accordingly. Minimum suggested size for this buffer is 124. Note it will disallow to construct longer traces.

◆ trace_buffer_size

size_t sternum_sdk_settings_t::trace_buffer_size

Size of trace_buffer in bytes.