Add more input format validation

This commit is contained in:
Christian W. Zuckschwerdt
2019-11-07 15:26:12 +01:00
parent 9f4829be13
commit a9de8888bc
3 changed files with 7 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ if [ ! -z "$4" ] ; then
fi
# create channels
rtl_433 -q -s ${rate}k -r "$file" -w F32:I:analog-1-4-1 -w F32:Q:analog-1-5-1 -w F32:AM:analog-1-6-1 -w F32:FM:analog-1-7-1 -w U8:LOGIC:logic-1-1 >/dev/null 2>&1
rtl_433 -s ${rate}k -r "$file" -w F32:I:analog-1-4-1 -w F32:Q:analog-1-5-1 -w F32:AM:analog-1-6-1 -w F32:FM:analog-1-7-1 -w U8:LOGIC:logic-1-1 >/dev/null 2>&1
# create version tag
echo -n "2" >version
# create meta data

View File

@@ -30,7 +30,7 @@ if [ ! -z "$3" ] ; then
fi
# create channels
rtl_433 -q -s ${rate}k -r "$file" -w F32:I:analog-1-4-1 -w F32:Q:analog-1-5-1 -w F32:AM:analog-1-6-1 -w F32:FM:analog-1-7-1 -w U8:LOGIC:logic-1-1 >/dev/null 2>&1
rtl_433 -s ${rate}k -r "$file" -w F32:I:analog-1-4-1 -w F32:Q:analog-1-5-1 -w F32:AM:analog-1-6-1 -w F32:FM:analog-1-7-1 -w U8:LOGIC:logic-1-1 >/dev/null 2>&1
# create version tag
echo -n "2" >version
# create meta data

View File

@@ -1359,8 +1359,12 @@ int main(int argc, char **argv) {
|| demod->load_info.format == S16_AM
|| demod->load_info.format == S16_FM) {
demod->sample_size = sizeof(uint8_t); // CU8, AM, FM
} else {
} else if (demod->load_info.format == CS16_IQ
|| demod->load_info.format == CF32_IQ) {
demod->sample_size = sizeof(int16_t); // CF32, CS16
} else {
fprintf(stderr, "Input format invalid: %s\n", file_info_string(&demod->load_info));
break;
}
if (cfg->verbosity) {
fprintf(stderr, "Input format: %s\n", file_info_string(&demod->load_info));