Willy-JL преди 1 година
родител
ревизия
2ee30f7b2d

+ 3 - 3
nfc_magic/magic/protocols/gen4/gen4.c

@@ -23,15 +23,15 @@ void gen4_copy(Gen4* dest, const Gen4* source) {
     memcpy(dest, source, sizeof(Gen4));
 }
 
-bool gen4_password_is_set (const Gen4Password* instance){
+bool gen4_password_is_set(const Gen4Password* instance) {
     return (instance->bytes[0] || instance->bytes[1] || instance->bytes[2] || instance->bytes[3]);
 }
 
-void gen4_password_reset (Gen4Password* instance){
+void gen4_password_reset(Gen4Password* instance) {
     memset(instance->bytes, 0, GEN4_PASSWORD_LEN);
 }
 
-void gen4_password_copy (Gen4Password* dest, const Gen4Password* source){
+void gen4_password_copy(Gen4Password* dest, const Gen4Password* source) {
     memcpy(dest->bytes, source->bytes, GEN4_PASSWORD_LEN);
 }
 

+ 3 - 3
nfc_magic/magic/protocols/gen4/gen4.h

@@ -90,11 +90,11 @@ void gen4_reset(Gen4* instance);
 
 void gen4_copy(Gen4* dest, const Gen4* source);
 
-bool gen4_password_is_set (const Gen4Password* instance);
+bool gen4_password_is_set(const Gen4Password* instance);
 
-void gen4_password_reset (Gen4Password* instance);
+void gen4_password_reset(Gen4Password* instance);
 
-void gen4_password_copy (Gen4Password* dest, const Gen4Password* source);
+void gen4_password_copy(Gen4Password* dest, const Gen4Password* source);
 
 const char* gen4_get_shadow_mode_name(Gen4ShadowMode mode);
 

+ 15 - 9
nfc_magic/magic/protocols/gen4/gen4_poller_i.c

@@ -253,15 +253,21 @@ Gen4PollerError gen4_poller_change_password(
 
         size_t response = bit_buffer_get_size_bytes(instance->rx_buffer);
 
-        FURI_LOG_D(TAG,
-                   "Trying to change password from 0x%02X %02X %02X %02X to "
-                   "0x%02X %02X %02X %02X. Card response: 0x%02X",
-                   pwd_current.bytes[0], pwd_current.bytes[1],
-                   pwd_current.bytes[2], pwd_current.bytes[3], pwd_new.bytes[0],
-                   pwd_new.bytes[1], pwd_new.bytes[2], pwd_new.bytes[3],
-                   response);
-
-        if (response != GEN4_RESPONSE_SUCCESS) {
+        FURI_LOG_D(
+            TAG,
+            "Trying to change password from 0x%02X %02X %02X %02X to "
+            "0x%02X %02X %02X %02X. Card response: 0x%02X",
+            pwd_current.bytes[0],
+            pwd_current.bytes[1],
+            pwd_current.bytes[2],
+            pwd_current.bytes[3],
+            pwd_new.bytes[0],
+            pwd_new.bytes[1],
+            pwd_new.bytes[2],
+            pwd_new.bytes[3],
+            response);
+
+        if(response != GEN4_RESPONSE_SUCCESS) {
             ret = Gen4PollerErrorProtocol;
             break;
         }

+ 1 - 1
nfc_magic/scenes/nfc_magic_scene_gen4_menu.c

@@ -96,7 +96,7 @@ bool nfc_magic_scene_gen4_menu_on_event(void* context, SceneManagerEvent event)
 
         scene_manager_set_scene_state(instance->scene_manager, NfcMagicSceneGen4Menu, event.event);
     } else if(event.type == SceneManagerEventTypeBack) {
-        if (gen4_password_is_set(&instance->gen4_password)) {
+        if(gen4_password_is_set(&instance->gen4_password)) {
             consumed = scene_manager_search_and_switch_to_previous_scene(
                 instance->scene_manager, NfcMagicSceneGen4ActionsMenu);
         } else {