mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00:00
fbt format
This commit is contained in:
parent
b77e430df5
commit
c69ce4c921
3 changed files with 63 additions and 41 deletions
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue