application: add command to set channels
This commit is contained in:
parent
ce9d927a5b
commit
89856091c7
|
@ -301,6 +301,34 @@ static void command_target_reset(void* argument)
|
|||
}
|
||||
}
|
||||
|
||||
/** set first channel of range to scan
|
||||
* @param[in] argument optional pointer to first channel number
|
||||
*/
|
||||
static void command_channel_start(void* argument)
|
||||
{
|
||||
if (argument) {
|
||||
const uint32_t channel = *(uint32_t*)argument;
|
||||
if (channel < CHANNEL_NUMBERS && channel < channel_stop) {
|
||||
channel_start = channel;
|
||||
}
|
||||
}
|
||||
printf("channels to probe: %u-%u\n", channel_start, channel_stop);
|
||||
}
|
||||
|
||||
/** set last channel of range to scan
|
||||
* @param[in] argument optional pointer to last channel number
|
||||
*/
|
||||
static void command_channel_stop(void* argument)
|
||||
{
|
||||
if (argument) {
|
||||
const uint32_t channel = *(uint32_t*)argument;
|
||||
if (channel < CHANNEL_NUMBERS && channel > channel_start) {
|
||||
channel_stop = channel;
|
||||
}
|
||||
}
|
||||
printf("channels to probe: %u-%u\n", channel_start, channel_stop);
|
||||
}
|
||||
|
||||
/** display available commands
|
||||
* @param[in] argument no argument required
|
||||
*/
|
||||
|
@ -568,6 +596,22 @@ static const struct menu_command_t menu_commands[] = {
|
|||
.argument_description = "[0|1|ODL|ODH|PPL|PPH]",
|
||||
.command_handler = &command_target_reset,
|
||||
},
|
||||
{
|
||||
.shortcut = 'c',
|
||||
.name = "start",
|
||||
.command_description = "first channel of range to probe",
|
||||
.argument = MENU_ARGUMENT_UNSIGNED,
|
||||
.argument_description = "[ch]",
|
||||
.command_handler = &command_channel_start,
|
||||
},
|
||||
{
|
||||
.shortcut = 'C',
|
||||
.name = "stop",
|
||||
.command_description = "last channel of range to probe",
|
||||
.argument = MENU_ARGUMENT_UNSIGNED,
|
||||
.argument_description = "[ch]",
|
||||
.command_handler = &command_channel_stop,
|
||||
},
|
||||
};
|
||||
|
||||
static void command_help(void* argument)
|
||||
|
|
Loading…
Reference in New Issue