fbt format

This commit is contained in:
MX 2024-02-21 02:21:20 +03:00
parent b77e430df5
commit c69ce4c921
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
3 changed files with 63 additions and 41 deletions

View file

@ -226,7 +226,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
DateTime card_start_trip_minutes_s = {0};
from_minutes_to_datetime(
(card_start_trip_date)*24 * 60 + card_start_trip_time,
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
&card_start_trip_minutes_s,
1992);
furi_string_printf(

View file

@ -175,7 +175,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
DateTime card_start_trip_minutes_s = {0};
from_minutes_to_datetime(
(card_start_trip_date)*24 * 60 + card_start_trip_time,
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
&card_start_trip_minutes_s,
1992);
furi_string_printf(
@ -252,7 +252,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
DateTime card_start_trip_minutes_s = {0};
from_minutes_to_datetime(
(card_start_trip_date)*24 * 60 + card_start_trip_time,
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
&card_start_trip_minutes_s,
1992);
furi_string_printf(
@ -426,7 +426,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
from_days_to_datetime(card_use_before_date, &card_use_before_date_s, 1992);
DateTime card_start_trip_minutes_s = {0};
from_minutes_to_datetime(
(card_start_trip_date)*24 * 60 + card_start_trip_time,
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
&card_start_trip_minutes_s,
1992);
furi_string_printf(
@ -507,7 +507,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
from_days_to_datetime(card_use_before_date, &card_use_before_date_s, 1992);
DateTime card_start_trip_minutes_s = {0};
from_minutes_to_datetime(
(card_start_trip_date)*24 * 60 + card_start_trip_time,
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
&card_start_trip_minutes_s,
1992);
furi_string_printf(
@ -647,7 +647,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
DateTime card_start_trip_minutes_s = {0};
from_minutes_to_datetime(
(card_valid_to_date)*24 * 60 + card_valid_for_minutes - card_start_trip_neg_minutes,
(card_valid_to_date) * 24 * 60 + card_valid_for_minutes - card_start_trip_neg_minutes,
&card_start_trip_minutes_s,
2016); //-time
furi_string_printf(

View file

@ -403,43 +403,65 @@ static void subghz_protocol_magellan_get_event_serialize(uint8_t event, FuriStri
const char* event_type;
const char* event_subtype;
switch ((event >> 4) & 0x0F) {
case 0x00: event_type = "Nothing"; break;
case 0x01: event_type = "Door"; break;
case 0x02: event_type = "Motion"; break;
case 0x03: event_type = "Smoke Alarm"; break;
case 0x04: event_type = "REM1"; break;
case 0x05:
event_type = "REM1";
event_subtype = "Off1";
furi_string_cat_printf(output, "%s - %s", event_type, event_subtype);
return;
case 0x06:
event_type = "REM2";
event_subtype = "Off1";
furi_string_cat_printf(output, "%s - %s", event_type, event_subtype);
return;
default: event_type = "Unknown"; break;
switch((event >> 4) & 0x0F) {
case 0x00:
event_type = "Nothing";
break;
case 0x01:
event_type = "Door";
break;
case 0x02:
event_type = "Motion";
break;
case 0x03:
event_type = "Smoke Alarm";
break;
case 0x04:
event_type = "REM1";
break;
case 0x05:
event_type = "REM1";
event_subtype = "Off1";
furi_string_cat_printf(output, "%s - %s", event_type, event_subtype);
return;
case 0x06:
event_type = "REM2";
event_subtype = "Off1";
furi_string_cat_printf(output, "%s - %s", event_type, event_subtype);
return;
default:
event_type = "Unknown";
break;
}
switch (event & 0x0F) {
case 0x00:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Arm1" : "Sealed";
break;
case 0x01:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Btn1" : "Alarm";
break;
case 0x02:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Btn2" : "Tamper";
break;
case 0x03:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Btn3" : "Alarm + Tamper";
break;
case 0x08: event_subtype = "Reset"; break;
case 0x09: event_subtype = "LowBatt"; break;
case 0x0A: event_subtype = "BattOk"; break;
case 0x0B: event_subtype = "Learn"; break;
default: event_subtype = "Unknown"; break;
switch(event & 0x0F) {
case 0x00:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Arm1" : "Sealed";
break;
case 0x01:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Btn1" : "Alarm";
break;
case 0x02:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Btn2" : "Tamper";
break;
case 0x03:
event_subtype = (((event >> 4) & 0x0F) > 0x03) ? "Btn3" : "Alarm + Tamper";
break;
case 0x08:
event_subtype = "Reset";
break;
case 0x09:
event_subtype = "LowBatt";
break;
case 0x0A:
event_subtype = "BattOk";
break;
case 0x0B:
event_subtype = "Learn";
break;
default:
event_subtype = "Unknown";
break;
}
furi_string_cat_printf(output, "%s - %s", event_type, event_subtype);