Lines Matching full:sh
24 static int parse_common_args(const struct shell *sh, char **argv, in parse_common_args() argument
31 shell_error(sh, in parse_common_args()
38 shell_error(sh, "Invalid LED number parameter %s", in parse_common_args()
46 static int cmd_off(const struct shell *sh, size_t argc, char **argv) in cmd_off() argument
52 err = parse_common_args(sh, argv, &dev, &led); in cmd_off()
57 shell_print(sh, "%s: turning off LED %d", dev->name, led); in cmd_off()
61 shell_error(sh, "Error: %d", err); in cmd_off()
67 static int cmd_on(const struct shell *sh, size_t argc, char **argv) in cmd_on() argument
73 err = parse_common_args(sh, argv, &dev, &led); in cmd_on()
78 shell_print(sh, "%s: turning on LED %d", dev->name, led); in cmd_on()
82 shell_error(sh, "Error: %d", err); in cmd_on()
110 static int cmd_get_info(const struct shell *sh, size_t argc, char **argv) in cmd_get_info() argument
118 err = parse_common_args(sh, argv, &dev, &led); in cmd_get_info()
123 shell_print(sh, "%s: getting LED %d information", dev->name, led); in cmd_get_info()
127 shell_error(sh, "Error: %d", err); in cmd_get_info()
131 shell_print(sh, "Label : %s", info->label ? : "<NULL>"); in cmd_get_info()
132 shell_print(sh, "Index : %d", info->index); in cmd_get_info()
133 shell_print(sh, "Num colors : %d", info->num_colors); in cmd_get_info()
135 shell_fprintf(sh, SHELL_NORMAL, "Colors : %s", in cmd_get_info()
138 shell_fprintf(sh, SHELL_NORMAL, ":%s", in cmd_get_info()
141 shell_fprintf(sh, SHELL_NORMAL, "\n"); in cmd_get_info()
147 static int cmd_set_brightness(const struct shell *sh, in cmd_set_brightness() argument
156 err = parse_common_args(sh, argv, &dev, &led); in cmd_set_brightness()
163 shell_error(sh, "Invalid LED brightness parameter %s", in cmd_set_brightness()
168 shell_error(sh, "Invalid LED brightness value %lu (max 100)", in cmd_set_brightness()
173 shell_print(sh, "%s: setting LED %d brightness to %lu", in cmd_set_brightness()
178 shell_error(sh, "Error: %d", err); in cmd_set_brightness()
184 static int cmd_set_color(const struct shell *sh, size_t argc, char **argv) in cmd_set_color() argument
193 err = parse_common_args(sh, argv, &dev, &led); in cmd_set_color()
200 shell_error(sh, in cmd_set_color()
212 shell_error(sh, "Invalid LED color parameter %s", in cmd_set_color()
217 shell_error(sh, in cmd_set_color()
225 shell_fprintf(sh, SHELL_NORMAL, "%s: setting LED %d color to %d", in cmd_set_color()
228 shell_fprintf(sh, SHELL_NORMAL, ":%d", color[i]); in cmd_set_color()
230 shell_fprintf(sh, SHELL_NORMAL, "\n"); in cmd_set_color()
234 shell_error(sh, "Error: %d", err); in cmd_set_color()
240 static int cmd_set_channel(const struct shell *sh, size_t argc, char **argv) in cmd_set_channel() argument
248 err = parse_common_args(sh, argv, &dev, &channel); in cmd_set_channel()
255 shell_error(sh, "Invalid channel value parameter %s", in cmd_set_channel()
260 shell_error(sh, "Invalid channel value %lu (max 255)", in cmd_set_channel()
265 shell_print(sh, "%s: setting channel %d to %lu", in cmd_set_channel()
270 shell_error(sh, "Error: %d", err); in cmd_set_channel()
277 cmd_write_channels(const struct shell *sh, size_t argc, char **argv) in cmd_write_channels() argument
286 err = parse_common_args(sh, argv, &dev, &start_channel); in cmd_write_channels()
293 shell_error(sh, in cmd_write_channels()
305 shell_error(sh, in cmd_write_channels()
311 shell_error(sh, in cmd_write_channels()
318 shell_fprintf(sh, SHELL_NORMAL, "%s: writing from channel %d: %d", in cmd_write_channels()
321 shell_fprintf(sh, SHELL_NORMAL, " %d", value[i]); in cmd_write_channels()
323 shell_fprintf(sh, SHELL_NORMAL, "\n"); in cmd_write_channels()
327 shell_error(sh, "Error: %d", err); in cmd_write_channels()