59 char const *calibration_file_name = NULL;
79 FILE *file = fopen(calibration_file_name,
"r");
void calibration_reset_offsets(void)
int calibration_load(void)
void calibration_reset_scales(void)
rl_calibration_t rl_calibration
Global calibration data structure.
#define RL_CALIBRATION_FILE_HEADER_LENGTH
Calibration file header length.
#define RL_CALIBRATION_FILE_VERSION
Calibration file header version.
#define RL_CALIBRATION_FILE_MAGIC
Calibration file header magic.
int rl_log(rl_log_level_t log_level, char const *const format,...)
#define RL_CALIBRATION_SYSTEM_FILE
Default system wide calibration file path.
#define RL_CALIBRATION_USER_FILE
User folder calibration file path.
#define ERROR
Function return value for errors (use errno to indicate the error)
#define SUCCESS
Function return value for successful completion.
#define RL_CHANNEL_COUNT
Number of RocketLogger analog channels.
uint16_t file_version
File version number.
uint64_t calibration_time
Timestamp of the measurements used for calibration generation.
rl_calibration_t data
The actual calibration data.
uint32_t file_magic
File magic constant.
uint16_t header_length
Total size of the header in bytes.
double scales[RL_CHANNEL_COUNT]
Channel scales.
int offsets[RL_CHANNEL_COUNT]
Channel offsets (in bit)
uint64_t calibration_time
Time stamp of last calibration run.
char calibration_file[PATH_MAX]
Time stamp of last calibration run.