[FL-2456] App notifications update (#1175)

* Notifications update: SubGHz
* Notifications: ibutton, infrared, rfid
This commit is contained in:
Nikolay Minaylov
2022-04-28 20:20:59 +03:00
committed by GitHub
parent af5e03ecb7
commit 4526503d81
29 changed files with 138 additions and 99 deletions

View File

@@ -1,6 +1,19 @@
#include "../subghz_i.h"
#include "../views/receiver.h"
static const NotificationSequence subghs_sequence_rx = {
&message_green_255,
&message_vibro_on,
&message_note_c6,
&message_delay_50,
&message_sound_off,
&message_vibro_off,
&message_delay_50,
NULL,
};
static void subghz_scene_receiver_update_statusbar(void* context) {
SubGhz* subghz = context;
string_t history_stat_str;
@@ -50,6 +63,8 @@ static void subghz_scene_add_to_history_callback(
subghz_receiver_reset(receiver);
string_reset(str_buff);
subghz->state_notifications = SubGhzNotificationStateRxDone;
subghz_history_get_text_item_menu(
subghz->txrx->history, str_buff, subghz_history_get_item(subghz->txrx->history) - 1);
subghz_view_receiver_add_item_to_menu(
@@ -95,7 +110,7 @@ void subghz_scene_receiver_on_enter(void* context) {
subghz_receiver_set_rx_callback(
subghz->txrx->receiver, subghz_scene_add_to_history_callback, subghz);
subghz->state_notifications = SubGhzNotificationStateRX;
subghz->state_notifications = SubGhzNotificationStateRx;
if(subghz->txrx->txrx_state == SubGhzTxRxStateRx) {
subghz_rx_end(subghz);
};
@@ -161,8 +176,12 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
}
switch(subghz->state_notifications) {
case SubGhzNotificationStateRX:
notification_message(subghz->notifications, &sequence_blink_blue_10);
case SubGhzNotificationStateRx:
notification_message(subghz->notifications, &sequence_blink_cyan_10);
break;
case SubGhzNotificationStateRxDone:
notification_message(subghz->notifications, &subghs_sequence_rx);
subghz->state_notifications = SubGhzNotificationStateRx;
break;
default:
break;