first working version

This commit is contained in:
2022-12-03 20:00:11 +01:00
parent e67c12358f
commit 179778d4ac
10 changed files with 7165 additions and 56 deletions

View File

@@ -0,0 +1,62 @@
#include "led_cmd.h"
enum {set, get};
option_t set_options[] = {
{
.opt_id = 'p',
.name = "power",
.flags = SINGLE_VALE,
.description = "sets the power of the light",
},
{
.opt_id = 'l',
.name = "led",
.flags = MULTI_VALUE,
.description = "diode selection. OPTIONS = [Atop, Abot, Btop, Bbot, Ctop, Cbot, all]",
}
};
option_t get_options[] = {
{
.opt_id = 'p',
.name = "power",
.flags = NO_VALUE,
.description = "gets the power of the light",
},
{
.opt_id = 'l',
.name = "led",
.flags = MULTI_VALUE,
.description = "diode selection. OPTIONS = [Atop, Abot, Btop, Bbot, Ctop, Cbot, all]",
}
};
argument_t arguments[] = {
{
.name = "set",
.arg_id = set,
.options = set_options,
.opt_num = sizeof(set_options) / (sizeof(set_options[0])),
.description = "allows to set operating parameters",
},
{
.name = "get",
.arg_id = get,
.options = get_options,
.opt_num = sizeof(get_options) / (sizeof(get_options[0])),
.description = "allows to get operating parameters",
},
};
cmd_parser_t led_cmd = {
.name = "led",
.arguments = arguments,
.arg_num = sizeof(arguments) / sizeof(arguments[0]),
.description = "allows to controll and check leds",
.cmd_parser = parse_callback,
};