43#define RL_FILE_MAGIC 0x444C5225
46#define RL_FILE_VERSION 0x04
49#define RL_FILE_CHANNEL_NAME_LENGTH 16
52#define RL_FILE_CHANNEL_NO_LINK (UINT16_MAX)
55#define RL_FILE_COMMENT_ALIGNMENT_BYTES sizeof(uint32_t)
58#define RL_FILE_CSV_DELIMITER ","
61#define RL_FILE_AMBIENT_SUFFIX "-ambient"
64#define RL_FILE_AMBIENT_DATA_BLOCK_SIZE 1
69#define RL_SCALE_PICO -12
70#define RL_SCALE_TEN_PICO -11
71#define RL_SCALE_NANO -9
72#define RL_SCALE_TEN_NANO -8
73#define RL_SCALE_MICRO -6
74#define RL_SCALE_MILLI -3
75#define RL_SCALE_UNIT 0
76#define RL_SCALE_KILO 3
77#define RL_SCALE_MEGA 6
78#define RL_SCALE_GIGA 9
79#define RL_SCALE_TERA 12
281 uint32_t
const *digital_buffer,
size_t buffer_size,
char * rl_unit_to_string(rl_unit_t unit)
@ RL_UNIT_VOLT
Voltage (electric)
@ RL_UNIT_UNDEFINED
Undefined unit.
@ RL_UNIT_LUX
Lux (illuminance)
@ RL_UNIT_AMPERE
Current (electric)
@ RL_UNIT_INTEGER
Integer channel (numeric)
@ RL_UNIT_BINARY
Binary signal.
@ RL_UNIT_PASCAL
Pascal (pressure)
@ RL_UNIT_RANGE_VALID
Range valid information.
@ RL_UNIT_PERCENT
Percent (numeric, humidity)
@ RL_UNIT_SECOND
Second (time delta)
@ RL_UNIT_UNITLESS
Unitless.
@ RL_UNIT_DEG_C
Degree celsius (temperature)
void rl_file_setup_ambient_header(rl_file_header_t *const file_header, rl_config_t const *const config)
void rl_file_store_header_bin(FILE *file_handle, rl_file_header_t *const file_header)
void rl_file_update_header_bin(FILE *file_handle, rl_file_header_t const *const file_header)
int rl_file_add_data_block(FILE *data_file, int32_t const *analog_buffer, uint32_t const *digital_buffer, size_t buffer_size, rl_timestamp_t const *const timestamp_realtime, rl_timestamp_t const *const timestamp_monotonic, rl_config_t const *const config)
void rl_file_store_header_csv(FILE *file_handle, rl_file_header_t const *const file_header)
void rl_file_setup_ambient_lead_in(rl_file_lead_in_t *const lead_in, rl_config_t const *const config)
void rl_file_setup_data_header(rl_file_header_t *const file_header, rl_config_t const *const config)
void rl_file_update_header_csv(FILE *file_handle, rl_file_header_t const *const file_header)
int rl_file_add_ambient_block(FILE *ambient_file, int32_t const *ambient_buffer, size_t buffer_size, rl_timestamp_t const *const timestamp_realtime, rl_timestamp_t const *const timestamp_monotonic, rl_config_t const *const config)
#define RL_FILE_CHANNEL_NAME_LENGTH
Maximum channel description length.
char * rl_file_get_ambient_file_name(char const *const data_file_name)
void rl_file_setup_data_lead_in(rl_file_lead_in_t *const lead_in, rl_config_t const *const config)
char name[RL_FILE_CHANNEL_NAME_LENGTH]
Channel name/description.
uint16_t data_size
Datum size in bytes (for voltage and current)
rl_unit_t unit
Channel unit.
int32_t channel_scale
Channel scale (in power of ten, for voltage and current)
uint16_t valid_data_channel
Link to channel valid data (for low-range current channels)
uint32_t comment_length
Comment length.
uint16_t sample_rate
Sampling rate of the measurement.
uint16_t file_version
File version number.
rl_timestamp_t start_time
Start time of the measurement in UNIX time, UTC.
uint64_t sample_count
Total sample count.
uint8_t mac_address[MAC_ADDRESS_LENGTH]
Instrument ID (mac address)
uint16_t channel_count
Analog channel count.
uint32_t data_block_count
Number of data blocks stored in the file.
uint32_t data_block_size
Size of the data blocks in the file in rows.
uint16_t header_length
Total size of the header in bytes.
uint32_t file_magic
File magic constant.
uint16_t channel_bin_count
Binary channel count.
#define MAC_ADDRESS_LENGTH
MAC address length in bytes.