Sternum iOS SDK
sternum_transmission_callbacks.h File Reference

Defines the SDK's transmission callbacks available for user implementation. More...

#include <stddef.h>

Go to the source code of this file.

Data structures

struct  sternum_transmission_callbacks_t
 

Typedefs

typedef void(* sternum_transmission_started_callback_t) (void)
 
typedef void(* sternum_transmission_finished_callback_t) (size_t packets_count, size_t bytes_count)
 
typedef void(* sternum_packets_lost_callback_t) (size_t packets_count, size_t bytes_count)
 
typedef void(* sternum_error_callback_t) (int error_code, const char *error_message)
 

Detailed Description

Defines the SDK's transmission callbacks available for user implementation.

Typedef Documentation

◆ sternum_error_callback_t

typedef void(* sternum_error_callback_t) (int error_code, const char *error_message)

Typedef for the error callback function. This function will be implemented by the user and registered with the SDK. It will be invoked when an error occurs during the transmission process.

Parameters
error_codeSTERNUM_CODE_FILE_CACHE_ACCESS_FAILURE 100 STERNUM_CODE_FILE_CACHE_RECOVERY_CLEAR 101
error_messageA null-terminated string containing a description of the error.
Note
It is not allowed to call Sternum SDK API functions from this callback.

◆ sternum_packets_lost_callback_t

typedef void(* sternum_packets_lost_callback_t) (size_t packets_count, size_t bytes_count)

Typedef for the packets lost callback function. This function will be implemented by the user and registered with the SDK.

Packets are considered lost when they fail to be stored in cache and thus not transmitted, or when the transmission is impossible permanently. Transmission failure itself is not considered packet lost because it will be retried until success.

Parameters
packets_lost_countThe number of packets that were lost.
bytes_countThe number of bytes that were lost.
Note
It is not allowed to call Sternum SDK API functions from this callback.

◆ sternum_transmission_finished_callback_t

typedef void(* sternum_transmission_finished_callback_t) (size_t packets_count, size_t bytes_count)

Typedef for the transmission finished callback function. This function will be implemented by the user and registered with the SDK. It will be invoked after the data transmission finishes.

Parameters
packets_countThe number of packets that were successfully transmitted.
bytes_countThe number of bytes that were successfully transmitted.
Note
It is not allowed to call Sternum SDK API functions from this callback.

◆ sternum_transmission_started_callback_t

typedef void(* sternum_transmission_started_callback_t) (void)

Typedef for the transmission started callback function. This function will be implemented by the user and registered with the SDK. It will be invoked before the data transmission starts.

Note
It is not allowed to call Sternum SDK API functions from this callback.