MX hace 2 años
padre
commit
a605f4ed4d
Se han modificado 6 ficheros con 37 adiciones y 29 borrados
  1. 14 9
      README.md
  2. 1 1
      scenes/uhf_scene_config.h
  3. 16 16
      scenes/uhf_scene_module_info.c
  4. 1 2
      uhf_app.c
  5. 3 0
      uhf_app_i.h
  6. 2 1
      uhf_module.h

+ 14 - 9
README.md

@@ -33,17 +33,22 @@ Adding options like settings the access password, baud rate, rf power, channel,
 
 
 ## Features
 ## Features
 
 
-- [x] Read Single UHF RFID tag.
-- [x] View saved UHF RFID tag.
-- [x] Write Single UHF RFID tag.
-- [ ] Change Module setting parameters. **(In Progress)**
-  - [x] Set Baudrates 
+- [x] Read Single UHF RFID tag
+  - [x] EPC Bank
+  - [x] TID Bank
+  - [x] USER Bank
+- [x] View saved UHF RFID tags
+- [x] Write Single UHF RFID tag
+  - [x] EPC Bank
+  - [ ] TID Bank (Not Supported if locked)
+  - [x] USER Bank
+- [ ] Change Module setting parameters **(In Progress)**
+  - [x] Set Baudrates
+  - [x] Set RF Power
+  - [x] Set Region
   - [ ] Set/Reset Access Password
   - [ ] Set/Reset Access Password
   - [ ] Set Kill Password
   - [ ] Set Kill Password
   - [ ] Kill Tag
   - [ ] Kill Tag
-  - [x] Set RF Power
-  - [x] Set Region
-
 - [ ] Edit/Create new data to write.
 - [ ] Edit/Create new data to write.
 - Extras
 - Extras
   - [ ] Read multiple tags at once
   - [ ] Read multiple tags at once
@@ -74,7 +79,7 @@ To run this application on FlipperZero, you will need:
 1. Power on your FlipperZero device.
 1. Power on your FlipperZero device.
 2. Connect the uhf module to the flipper via gpio.
 2. Connect the uhf module to the flipper via gpio.
 3. Navigate to the UHF RFID app on FlipperZero's menu.
 3. Navigate to the UHF RFID app on FlipperZero's menu.
-4. Currently Reading the EPC tag is the only usable option
+4. Currently Read for EPC, TID, USER Banks are supported, as well as saving and Writing EPC, USER Banks
    ... will further update this page as it development goes
    ... will further update this page as it development goes
 
 
 ## Contributions
 ## Contributions

+ 1 - 1
scenes/uhf_scene_config.h

@@ -1,4 +1,4 @@
-ADD_SCENE(uhf, verify, Verify)
+ADD_SCENE(uhf, module_info, ModuleInfo)
 ADD_SCENE(uhf, start, Start)
 ADD_SCENE(uhf, start, Start)
 ADD_SCENE(uhf, read_tag, ReadTag)
 ADD_SCENE(uhf, read_tag, ReadTag)
 ADD_SCENE(uhf, read_tag_success, ReadTagSuccess)
 ADD_SCENE(uhf, read_tag_success, ReadTagSuccess)

+ 16 - 16
scenes/uhf_scene_verify.c → scenes/uhf_scene_module_info.c

@@ -1,17 +1,16 @@
 #include "../uhf_app_i.h"
 #include "../uhf_app_i.h"
 
 
-bool verify_success = false;
 FuriString* temp_str;
 FuriString* temp_str;
 
 
-void uhf_scene_verify_callback_event(UHFWorkerEvent event, void* ctx) {
+void uhf_scene_module_info_callback_event(UHFWorkerEvent event, void* ctx) {
     UNUSED(ctx);
     UNUSED(ctx);
     UHFApp* uhf_app = ctx;
     UHFApp* uhf_app = ctx;
-    if(event == UHFWorkerEventSuccess) verify_success = true;
+    if(event == UHFWorkerEventSuccess) uhf_app->device_verified = true;
 
 
     view_dispatcher_send_custom_event(uhf_app->view_dispatcher, UHFCustomEventVerifyDone);
     view_dispatcher_send_custom_event(uhf_app->view_dispatcher, UHFCustomEventVerifyDone);
 }
 }
 
 
-void uhf_scene_verify_widget_callback(GuiButtonType result, InputType type, void* ctx) {
+void uhf_scene_module_info_widget_callback(GuiButtonType result, InputType type, void* ctx) {
     furi_assert(ctx);
     furi_assert(ctx);
     UHFApp* uhf_app = ctx;
     UHFApp* uhf_app = ctx;
 
 
@@ -20,25 +19,26 @@ void uhf_scene_verify_widget_callback(GuiButtonType result, InputType type, void
     }
     }
 }
 }
 
 
-void uhf_scene_verify_on_enter(void* ctx) {
+void uhf_scene_module_info_on_enter(void* ctx) {
     UHFApp* uhf_app = ctx;
     UHFApp* uhf_app = ctx;
+    uhf_app->device_verified = false; // reset device verified
     uhf_worker_start(
     uhf_worker_start(
-        uhf_app->worker, UHFWorkerStateVerify, uhf_scene_verify_callback_event, uhf_app);
+        uhf_app->worker, UHFWorkerStateVerify, uhf_scene_module_info_callback_event, uhf_app);
     temp_str = furi_string_alloc();
     temp_str = furi_string_alloc();
     view_dispatcher_switch_to_view(uhf_app->view_dispatcher, UHFViewWidget);
     view_dispatcher_switch_to_view(uhf_app->view_dispatcher, UHFViewWidget);
 }
 }
 
 
-bool uhf_scene_verify_on_event(void* ctx, SceneManagerEvent event) {
+bool uhf_scene_module_info_on_event(void* ctx, SceneManagerEvent event) {
     UHFApp* uhf_app = ctx;
     UHFApp* uhf_app = ctx;
     bool consumed = false;
     bool consumed = false;
     if(event.event == SceneManagerEventTypeBack) {
     if(event.event == SceneManagerEventTypeBack) {
         uhf_app->worker->state = UHFWorkerStateStop;
         uhf_app->worker->state = UHFWorkerStateStop;
     } else if(event.type == SceneManagerEventTypeCustom) {
     } else if(event.type == SceneManagerEventTypeCustom) {
         if(event.event == GuiButtonTypeRight) {
         if(event.event == GuiButtonTypeRight) {
-            scene_manager_next_scene(uhf_app->scene_manager, UHFSceneStart);
-            consumed = true;
+            scene_manager_search_and_switch_to_another_scene(
+                uhf_app->scene_manager, UHFSceneStart);
         } else if(event.event == GuiButtonTypeLeft) {
         } else if(event.event == GuiButtonTypeLeft) {
-            if(!verify_success) {
+            if(!uhf_app->device_verified) {
                 widget_reset(uhf_app->widget);
                 widget_reset(uhf_app->widget);
                 furi_string_reset(temp_str);
                 furi_string_reset(temp_str);
                 uhf_worker_stop(uhf_app->worker);
                 uhf_worker_stop(uhf_app->worker);
@@ -49,11 +49,11 @@ bool uhf_scene_verify_on_event(void* ctx, SceneManagerEvent event) {
                 uhf_worker_start(
                 uhf_worker_start(
                     uhf_app->worker,
                     uhf_app->worker,
                     UHFWorkerStateVerify,
                     UHFWorkerStateVerify,
-                    uhf_scene_verify_callback_event,
+                    uhf_scene_module_info_callback_event,
                     uhf_app);
                     uhf_app);
             }
             }
         } else if(event.event == UHFCustomEventVerifyDone) {
         } else if(event.event == UHFCustomEventVerifyDone) {
-            if(verify_success) {
+            if(uhf_app->device_verified) {
                 widget_reset(uhf_app->widget);
                 widget_reset(uhf_app->widget);
                 furi_string_reset(temp_str);
                 furi_string_reset(temp_str);
                 M100Module* module = uhf_app->worker->module;
                 M100Module* module = uhf_app->worker->module;
@@ -99,7 +99,7 @@ bool uhf_scene_verify_on_event(void* ctx, SceneManagerEvent event) {
                     uhf_app->widget,
                     uhf_app->widget,
                     GuiButtonTypeRight,
                     GuiButtonTypeRight,
                     "Continue",
                     "Continue",
-                    uhf_scene_verify_widget_callback,
+                    uhf_scene_module_info_widget_callback,
                     uhf_app);
                     uhf_app);
             } else {
             } else {
                 widget_add_string_element(
                 widget_add_string_element(
@@ -122,13 +122,13 @@ bool uhf_scene_verify_on_event(void* ctx, SceneManagerEvent event) {
                     uhf_app->widget,
                     uhf_app->widget,
                     GuiButtonTypeLeft,
                     GuiButtonTypeLeft,
                     "Retry",
                     "Retry",
-                    uhf_scene_verify_widget_callback,
+                    uhf_scene_module_info_widget_callback,
                     uhf_app);
                     uhf_app);
                 widget_add_button_element(
                 widget_add_button_element(
                     uhf_app->widget,
                     uhf_app->widget,
                     GuiButtonTypeRight,
                     GuiButtonTypeRight,
                     "Skip",
                     "Skip",
-                    uhf_scene_verify_widget_callback,
+                    uhf_scene_module_info_widget_callback,
                     uhf_app);
                     uhf_app);
             }
             }
         }
         }
@@ -136,7 +136,7 @@ bool uhf_scene_verify_on_event(void* ctx, SceneManagerEvent event) {
     return consumed;
     return consumed;
 }
 }
 
 
-void uhf_scene_verify_on_exit(void* ctx) {
+void uhf_scene_module_info_on_exit(void* ctx) {
     UHFApp* uhf_app = ctx;
     UHFApp* uhf_app = ctx;
     // Clear string
     // Clear string
     furi_string_free(temp_str);
     furi_string_free(temp_str);

+ 1 - 2
uhf_app.c

@@ -182,7 +182,6 @@ void uhf_blink_stop(UHFApp* uhf_app) {
 
 
 void uhf_show_loading_popup(void* ctx, bool show) {
 void uhf_show_loading_popup(void* ctx, bool show) {
     UHFApp* uhf_app = ctx;
     UHFApp* uhf_app = ctx;
-
     if(show) {
     if(show) {
         // Raise timer priority so that animations can play
         // Raise timer priority so that animations can play
         furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
@@ -202,7 +201,7 @@ int32_t uhf_app_main(void* ctx) {
     // init pin a2
     // init pin a2
     // furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull);
     // furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull);
     furi_hal_uart_set_br(FuriHalUartIdUSART1, DEFAULT_BAUDRATE);
     furi_hal_uart_set_br(FuriHalUartIdUSART1, DEFAULT_BAUDRATE);
-    scene_manager_next_scene(uhf_app->scene_manager, UHFSceneVerify);
+    scene_manager_next_scene(uhf_app->scene_manager, UHFSceneModuleInfo);
     view_dispatcher_run(uhf_app->view_dispatcher);
     view_dispatcher_run(uhf_app->view_dispatcher);
 
 
     // disable 5v pin
     // disable 5v pin

+ 3 - 0
uhf_app_i.h

@@ -68,6 +68,9 @@ struct UHFApp {
     Loading* loading;
     Loading* loading;
     TextInput* text_input;
     TextInput* text_input;
     Widget* widget;
     Widget* widget;
+    // view setting
+    bool device_verified;
+    bool view_device_info;
 };
 };
 
 
 typedef enum {
 typedef enum {

+ 2 - 1
uhf_module.h

@@ -33,10 +33,11 @@ typedef enum {
 
 
 typedef struct {
 typedef struct {
     M100ModuleInfo* info;
     M100ModuleInfo* info;
-    uint32_t baudrate;
     WorkingRegion region;
     WorkingRegion region;
+    uint32_t baudrate;
     uint16_t region_frequency;
     uint16_t region_frequency;
     uint16_t transmitting_power;
     uint16_t transmitting_power;
+    uint16_t max_transmitting_power;
     bool freq_hopping;
     bool freq_hopping;
     Buffer* buf;
     Buffer* buf;
 } M100Module;
 } M100Module;