Greg Troxel
unread,May 13, 2025, 8:43:49 AMMay 13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rtl433
I have long had issues where if the USB connector is bumped there is a
read error or something and rtl_433 exits, and I need to restart. It
seems the newish -D option helps with that. Trying to understand it,
questions/comments:
1) The help does not give the default:
[-D restart | pause | quit | manual] Input device run mode options.
Further, the order does not match the enum:
typedef enum {
DEVICE_MODE_QUIT,
DEVICE_MODE_RESTART,
DEVICE_MODE_PAUSE,
DEVICE_MODE_MANUAL,
} device_mode_t;
and while quit and restart are intuitive, pause and manual are not.
There is help with -D help (or anything else invalid), and it would
be good to give a clue in the -h output. I can then understand
pause, sort of, but not really. I still don't understand manual.
2) Reading src/rtl_433.c:
case 'D':
if (!arg)
help_device_mode();
if (strcmp(arg, "quit") == 0) {
cfg->dev_mode = DEVICE_MODE_RESTART;
}
else if (strcmp(arg, "restart") == 0) {
cfg->dev_mode = DEVICE_MODE_RESTART;
}
else if (strcmp(arg, "pause") == 0) {
cfg->dev_mode = DEVICE_MODE_PAUSE;
}
else if (strcmp(arg, "manual") == 0) {
cfg->dev_mode = DEVICE_MODE_MANUAL;
}
else {
fprintf(stderr, "Invalid input device run mode: %s\n", arg);
help_device_mode();
}
break;
It seems
- quit is mapped to restart, an obvious bug
- I find no initialization, which seems to rely on QUIT being 0 in
the enum and the field being zero, because it is a global.
So I would like to:
fix -D quit to use the right enum value
add a comment about the value when there isn't -D, or really I'd
like to add a 'set defaults' section and assign it. This is too hard
to follow and too fragile.
add -D help to the -h output
specify what is the default in the -h and -D help output
sort help to be in the same order as the enum