[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

@@ -19,6 +19,7 @@ struct SubGhzFrequencyAnalyzer {
SubGhzFrequencyAnalyzerWorker* worker;
SubGhzFrequencyAnalyzerCallback callback;
void* context;
bool locked;
};
typedef struct {
@@ -86,6 +87,17 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
void subghz_frequency_analyzer_pair_callback(void* context, uint32_t frequency, float rssi) {
SubGhzFrequencyAnalyzer* instance = context;
if((rssi == 0.f) && (instance->locked)) {
if(instance->callback) {
instance->callback(SubGhzCustomEventSceneAnalyzerUnlock, instance->context);
}
} else if((rssi != 0.f) && (!instance->locked)) {
if(instance->callback) {
instance->callback(SubGhzCustomEventSceneAnalyzerLock, instance->context);
}
}
instance->locked = (rssi != 0.f);
with_view_model(
instance->view, (SubGhzFrequencyAnalyzerModel * model) {
model->rssi = rssi;

View File

@@ -293,7 +293,6 @@ bool subghz_read_raw_input(InputEvent* event, void* context) {
case SubGhzReadRAWStatusIDLE:
// Start TX
instance->callback(SubGhzCustomEventViewReadRAWSendStart, instance->context);
instance->callback(SubGhzCustomEventViewReadRAWVibro, instance->context);
model->satus = SubGhzReadRAWStatusTXRepeat;
ret = true;
break;
@@ -304,7 +303,6 @@ bool subghz_read_raw_input(InputEvent* event, void* context) {
case SubGhzReadRAWStatusLoadKeyIDLE:
// Start Load Key TX
instance->callback(SubGhzCustomEventViewReadRAWSendStart, instance->context);
instance->callback(SubGhzCustomEventViewReadRAWVibro, instance->context);
model->satus = SubGhzReadRAWStatusLoadKeyTXRepeat;
ret = true;
break;