Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'applications/cli')
-rw-r--r--applications/cli/cli_commands.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c
index 101ff6ee..6df4967b 100644
--- a/applications/cli/cli_commands.c
+++ b/applications/cli/cli_commands.c
@@ -4,6 +4,7 @@
#include <rtc.h>
#include <task-control-block.h>
#include <time.h>
+#include <notification/notification-messages.h>
void cli_command_help(Cli* cli, string_t args, void* context) {
(void)args;
@@ -106,9 +107,13 @@ void cli_command_hw_info(Cli* cli, string_t args, void* context) {
void cli_command_vibro(Cli* cli, string_t args, void* context) {
if(!string_cmp(args, "0")) {
- api_hal_vibro_on(false);
+ NotificationApp* notification = furi_record_open("notification");
+ notification_message_block(notification, &sequence_reset_vibro);
+ furi_record_close("notification");
} else if(!string_cmp(args, "1")) {
- api_hal_vibro_on(true);
+ NotificationApp* notification = furi_record_open("notification");
+ notification_message_block(notification, &sequence_set_vibro_on);
+ furi_record_close("notification");
} else {
printf("Wrong input");
}
@@ -116,7 +121,7 @@ void cli_command_vibro(Cli* cli, string_t args, void* context) {
void cli_command_led(Cli* cli, string_t args, void* context) {
// Get first word as light name
- Light light;
+ NotificationMessage notification_led_message;
string_t light_name;
string_init(light_name);
size_t ws = string_search_char(args, ' ');
@@ -131,13 +136,13 @@ void cli_command_led(Cli* cli, string_t args, void* context) {
}
// Check light name
if(!string_cmp(light_name, "r")) {
- light = LightRed;
+ notification_led_message.type = NotificationMessageTypeLedRed;
} else if(!string_cmp(light_name, "g")) {
- light = LightGreen;
+ notification_led_message.type = NotificationMessageTypeLedGreen;
} else if(!string_cmp(light_name, "b")) {
- light = LightBlue;
+ notification_led_message.type = NotificationMessageTypeLedBlue;
} else if(!string_cmp(light_name, "bl")) {
- light = LightBacklight;
+ notification_led_message.type = NotificationMessageTypeLedDisplay;
} else {
printf("Wrong argument");
string_clear(light_name);
@@ -151,7 +156,20 @@ void cli_command_led(Cli* cli, string_t args, void* context) {
printf("Wrong argument");
return;
}
- api_hal_light_set(light, value);
+
+ // Set led value
+ notification_led_message.data.led.value = value;
+
+ // Form notification sequence
+ const NotificationSequence notification_sequence = {
+ &notification_led_message,
+ NULL,
+ };
+
+ // Send notification
+ NotificationApp* notification = furi_record_open("notification");
+ notification_internal_message_block(notification, &notification_sequence);
+ furi_record_close("notification");
}
void cli_command_gpio_set(Cli* cli, string_t args, void* context) {