StateServer 1.6.9
Compiled `c` application to handle task state logging and timing.
Loading...
Searching...
No Matches
Memory and Data Handlers

Allocate/deallocate memory, and save data.
More...

Functions

void cleanupThreadArgs (ThreadSafeArgs *args)
 Clean up the thread-safe argument structure.
 
int readTaskState (FILE *log, LogData *logData)
 Read task state data from a binary log file.
 
void saveParametersToFile (const char *paramFolderFS, TaskParameters *parameters, uint16_t parameters_index)
 Write parameters to text file.
 
void saveTaskState (FILE *log, LogData *logData)
 Write task state data to binary log file.
 

Detailed Description

Allocate/deallocate memory, and save data.

Function Documentation

◆ cleanupThreadArgs()

void cleanupThreadArgs ( ThreadSafeArgs * args)

Clean up the thread-safe argument structure.

Parameters
argsPointer to ThreadSafeArgs structure.

◆ readTaskState()

int readTaskState ( FILE * log,
LogData * logData )

Read task state data from a binary log file.

This function reads a single record from the binary log file log and populates the provided pointers trial, state, and set_index with the data read from the file.

Parameters
logThe binary log file to read from.
logDataPointer to the data structure to read into.
Returns
1 if successful, 0 if the end of file is reached or an error occurs.

◆ saveParametersToFile()

void saveParametersToFile ( const char * paramFolderFS,
TaskParameters * parameters,
uint16_t parameters_index )

Write parameters to text file.

Parameters
paramFolderFSFolder where the parameters files will be saved, using forward-slashes for file-separators and no "final" file separator.
parametersPointer to TaskParameters parameter struct.
parameters_indexIndex to be associated with the saved parameters.

◆ saveTaskState()

void saveTaskState ( FILE * log,
LogData * logData )

Write task state data to binary log file.

Parameters
logPointer to log file where data will be dumped.
logDataPointer to the data struct to dump to the file.