c_tlm_binary.h File Reference
#include "c_tlm_comp.h"
Include dependency graph for c_tlm_binary.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint32_t tlm_binary_get_size_one (tlm_component *comp_ptr)
 
uint32_t tlm_binary_get_size_all (void)
 
uint32_t tlm_binary_get_one (tlm_component *comp_ptr, char *binary)
 
uint32_t tlm_binary_get_all (char *binary)
 
bool tlm_binary_compare_one (tlm_component *comp_ptr, char *binary)
 
bool tlm_binary_compare_all (char *binary)
 

Detailed Description

This file allows to get telemetry data in binary format. This only provides the raw, contiguous data, not the data type, size or name etc.

Applications of this API :

  • Provide raw contiguous data
  • Provide means to compare if telemetry data has changed.
Warning
This API should only be used if no additional telemetry registration will take place.
char *binary = (char*)malloc(size);
tlm_binary_get_one(my_comp, binary));
if(!tlm_binary_compare_one(my_comp, binary)) {
// Data changed, do something
}

Function Documentation

bool tlm_binary_compare_all ( char *  binary)
bool tlm_binary_compare_one ( tlm_component comp_ptr,
char *  binary 
)

Compare the binary data with the latest telemetry's binary data

Parameters
comp_ptrThe component pointer
binaryThe binary data at which to compare
Returns
true if the binary data is the same as the latest telemetry data
uint32_t tlm_binary_get_all ( char *  binary)
uint32_t tlm_binary_get_one ( tlm_component comp_ptr,
char *  binary 
)

Copy the telemetry data to the provided memory pointer

Parameters
comp_ptrThe component pointer
binaryThe data pointer to which data will be copied
Returns
The number of bytes copied into the data pointer.
uint32_t tlm_binary_get_size_all ( void  )
uint32_t tlm_binary_get_size_one ( tlm_component comp_ptr)

Get the size of the binary data which should be used to allocate memory before calling tlm_binary_get_xxx() functions.

Parameters
comp_ptrThe component pointer