[FL-2456] App notifications update (#1175)
* Notifications update: SubGHz * Notifications: ibutton, infrared, rfid
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user