43 #ifndef DATA_LOGGING_H__
44 #define DATA_LOGGING_H__
50 #include "fat_fs/ff.h"
61 char param_name[MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN];
155 bool data_logging_create_new_log_file(
data_logging_t* data_logging,
const char* file_name, uint32_t sysid);
175 bool data_logging_add_parameter_uint8(
data_logging_t* data_logging, uint8_t* val,
const char* param_name);
186 bool data_logging_add_parameter_int8(
data_logging_t* data_logging, int8_t* val,
const char* param_name);
197 bool data_logging_add_parameter_uint16(
data_logging_t* data_logging, uint16_t* val,
const char* param_name);
208 bool data_logging_add_parameter_int16(
data_logging_t* data_logging, int16_t* val,
const char* param_name);
219 bool data_logging_add_parameter_uint32(
data_logging_t* data_logging, uint32_t* val,
const char* param_name);
230 bool data_logging_add_parameter_int32(
data_logging_t* data_logging, int32_t* val,
const char* param_name);
241 bool data_logging_add_parameter_uint64(
data_logging_t* data_logging, uint64_t* val,
const char* param_name);
252 bool data_logging_add_parameter_int64(
data_logging_t* data_logging, int64_t* val,
const char* param_name);
263 bool data_logging_add_parameter_float(
data_logging_t* data_logging,
float* val,
const char* param_name);
274 bool data_logging_add_parameter_double(
data_logging_t* data_logging,
double* val,
const char* param_name);
int buffer_name_size
The buffer for the size of the file's name.
Definition: data_logging.h:112
uint16_t max_logs
The max number of logged files with the same name on the SD card.
Definition: data_logging.h:76
uint32_t loop_count
Counter to try to mount the SD card many times.
Definition: data_logging.h:123
FATFS fs
The fatfs handler.
Definition: data_logging.h:107
int buffer_add_size
The buffer for the size of the file's extension char*.
Definition: data_logging.h:113
bool file_init
A flag to tell whether a file is init or not.
Definition: data_logging.h:118
uint16_t log_interval
The time interval in sec.
Definition: data_logging.h:77
uint16_t max_logs
The max number of logged files with the same name on the SD card.
Definition: data_logging.h:88
File system object structure (FATFS)
Definition: ff.h:81
uint16_t log_interval
The time interval in sec.
Definition: data_logging.h:89
char * name_n_extension
Stores the name of the file.
Definition: data_logging.h:116
FRESULT fr
The result of the fatfs functions.
Definition: data_logging.h:106
bool debug
Indicates if debug messages should be printed for each param change.
Definition: data_logging.h:103
Set of data logging parameters.
Definition: data_logging.h:72
bool file_name_init
A flag to tell whether a valid name was proposed.
Definition: data_logging.h:120
uint32_t max_data_logging_count
Maximum number of parameters.
Definition: data_logging.h:87
uint32_t data_logging_count
Number of data logging parameter effectively in the array.
Definition: data_logging.h:74
const state_t * state
The pointer to the state structure.
Definition: data_logging.h:131
bool file_opened
A flag to tell whether a file is opened or not.
Definition: data_logging.h:119
bool debug
Indicates if debug messages should be printed for each param change.
Definition: data_logging.h:90
char * file_name
The file name.
Definition: data_logging.h:115
The state structure.
Definition: state.h:79
uint32_t max_data_logging_count
Maximum number of logged parameters.
Definition: data_logging.h:75
uint32_t logging_time
The time that we've passed logging since the last f_close.
Definition: data_logging.h:125
uint32_t log_data
A flag to stop/start writing to file.
Definition: data_logging.h:127
Configuration for the module data logging.
Definition: data_logging.h:85
data_logging_set_t * data_logging_set
Pointer to a set of parameters, needs memory allocation.
Definition: data_logging.h:104
uint32_t log_data
The initial state of writing a file.
Definition: data_logging.h:91
File object structure (FIL)
Definition: ff.h:119
mavlink_message_type_t data_type
Parameter type.
Definition: data_logging.h:62
Structure of data logging parameter.
Definition: data_logging.h:57
bool sys_mounted
A flag to tell whether the file system is mounted.
Definition: data_logging.h:121
uint32_t sys_id
the system ID
Definition: data_logging.h:129
FIL fil
The fatfs file handler.
Definition: data_logging.h:108
The structure to log the data.
Definition: data_logging.h:101
double * param_double
Pointer to the parameter value.
Definition: data_logging.h:59
uint32_t time_ms
The microcontroller time in ms.
Definition: data_logging.h:110