rtl433
UNKNOWN
RTL-433 utility
|
Various utility functions handling file formats. More...
Functions | |
char const * | file_basename (char const *path) |
void | check_read_file_info (file_info_t *info) |
void | check_write_file_info (file_info_t *info) |
char const * | file_info_string (file_info_t *info) |
static void | file_type_set_format (uint32_t *type, uint32_t val) |
static void | file_type_set_content (uint32_t *type, uint32_t val) |
static uint32_t | file_type_guess_auto_format (uint32_t type) |
static void | file_type (char const *filename, file_info_t *info) |
char const * | last_plain_colon (char const *p) |
int | parse_file_info (char const *filename, file_info_t *info) |
This will detect file info and overrides. More... | |
void | assert_file_type (int check, char const *spec) |
void | assert_str_equal (char const *a, char const *b) |
int | main (int argc, char **argv) |
Various utility functions handling file formats.
Copyright (C) 2018 Christian Zuckschwerdt
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
void assert_file_type | ( | int | check, |
char const * | spec | ||
) |
References parse_file_info().
Referenced by main().
void assert_str_equal | ( | char const * | a, |
char const * | b | ||
) |
Referenced by main().
void check_read_file_info | ( | file_info_t * | info | ) |
References CF32_IQ, CS16_IQ, CU8_IQ, file_info_t::format, PULSE_OOK, S16_AM, and file_info_t::spec.
void check_write_file_info | ( | file_info_t * | info | ) |
char const* file_basename | ( | char const * | path | ) |
Referenced by data_acquired_handler().
char const* file_info_string | ( | file_info_t * | info | ) |
|
static |
References file_info_t::center_frequency, F_AM, F_CF32, F_CS16, F_CS32, F_CS8, F_CU8, F_F32, F_FM, F_I, F_IQ, F_LOGIC, F_OOK, F_Q, F_S16, F_S32, F_S8, F_U16, F_U32, F_U8, F_VCD, file_type_set_content(), file_type_set_format(), file_info_t::format, and file_info_t::sample_rate.
Referenced by parse_file_info().
Referenced by file_type().
Referenced by file_type().
char const* last_plain_colon | ( | char const * | p | ) |
Referenced by main(), and parse_file_info().
int main | ( | int | argc, |
char ** | argv | ||
) |
References assert_file_type(), assert_str_equal(), CF32_IQ, CS16_IQ, CU8_IQ, last_plain_colon(), S16_AM, and S16_FM.
int parse_file_info | ( | char const * | filename, |
file_info_t * | info | ||
) |
This will detect file info and overrides.
Parse "[0-9]+(\.[0-9]+)?[A-Za-z]" as frequency (suffix "M" or "[kMG]?Hz") or sample rate (suffix "k" or "[kMG]?sps")
Parse "[A-Za-z][0-9A-Za-z]+" as format or content specifier:
2ch formats: "cu8", "cs8", "cs16", "cs32", "cf32" 1ch formats: "u8", "s8", "s16", "u16", "s32", "u32", "f32" text formats: "vcd", "ook" content types: "iq", "i", "q", "am", "fm", "logic"
Parses left to right, with the exception of a prefix up to the last colon ":" This prefix is the forced override, parsed last and removed from the filename.
All matches are case-insensitive.
default detection, e.g.: path/filename.am.s16 overrides, e.g.: am:s16:path/filename.ext other styles are detected but discouraged, e.g.: am-s16:path/filename.ext, am.s16:path/filename.ext, path/filename.am_s16
References file_type(), file_type_guess_auto_format(), file_info_t::format, last_plain_colon(), file_info_t::path, file_info_t::raw_format, and file_info_t::spec.
Referenced by add_dumper(), assert_file_type(), and main().