|
@@ -3,17 +3,12 @@
|
|
|
|
|
|
|
|
void uhf_read_tag_worker_callback(UHFWorkerEvent event, void* ctx) {
|
|
void uhf_read_tag_worker_callback(UHFWorkerEvent event, void* ctx) {
|
|
|
UNUSED(event);
|
|
UNUSED(event);
|
|
|
- UNUSED(ctx);
|
|
|
|
|
- // UHFApp* uhf_app = ctx;
|
|
|
|
|
- // testing
|
|
|
|
|
- FURI_LOG_E("THREAD", "uhf_read_tag_worker_callback %d", event);
|
|
|
|
|
- // furi_delay_ms(3000);
|
|
|
|
|
- // scene_manager_set_scene_state(uhf_app->scene_manager, UHFSceneReadTag, UHFSceneStart);
|
|
|
|
|
- // view_dispatcher_send_custom_event(uhf_app->view_dispatcher, UHFCustomEventWorkerExit);
|
|
|
|
|
|
|
+ UHFApp* uhf_app = ctx;
|
|
|
|
|
+ view_dispatcher_send_custom_event(uhf_app->view_dispatcher, UHFCustomEventWorkerExit);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void uhf_scene_read_tag_on_enter(void* ctx) {
|
|
void uhf_scene_read_tag_on_enter(void* ctx) {
|
|
|
- FURI_LOG_E("33", "uhf_scene_read_tag_on_enter was called!");
|
|
|
|
|
|
|
+ // FURI_LOG_E("33", "uhf_scene_read_tag_on_enter was called!");
|
|
|
UHFApp* uhf_app = ctx;
|
|
UHFApp* uhf_app = ctx;
|
|
|
dolphin_deed(DolphinDeedNfcRead);
|
|
dolphin_deed(DolphinDeedNfcRead);
|
|
|
|
|
|
|
@@ -33,21 +28,22 @@ void uhf_scene_read_tag_on_enter(void* ctx) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool uhf_scene_read_tag_on_event(void* ctx, SceneManagerEvent event) {
|
|
bool uhf_scene_read_tag_on_event(void* ctx, SceneManagerEvent event) {
|
|
|
- UNUSED(ctx);
|
|
|
|
|
- // UHFApp* uhf_app = ctx;
|
|
|
|
|
|
|
+ UHFApp* uhf_app = ctx;
|
|
|
bool consumed = false;
|
|
bool consumed = false;
|
|
|
- FURI_LOG_E("33", "uhf_scene_read_tag_on_event was called! event.event: %lu", event.event);
|
|
|
|
|
|
|
+ uint8_t cmd[] = {0xBB, 0x00, 0x22, 0x00, 0x00, 0x22, 0x7E};
|
|
|
|
|
+ // while(uhf_worker->state != UHFWorkerStateStop || !first_data->data_full) {
|
|
|
|
|
+ FURI_LOG_E("uhf_scene_read_tag_on_event", "sending single polling command");
|
|
|
|
|
+ furi_hal_uart_tx(FuriHalUartIdUSART1, cmd, 7);
|
|
|
|
|
+ if(uhf_app->worker->data->data->data_full) {
|
|
|
|
|
+ scene_manager_next_scene(uhf_app->scene_manager, UHFSceneReadTagSuccess);
|
|
|
|
|
+ consumed = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ // FURI_LOG_E("33", "uhf_scene_read_tag_on_event was called! event.event: %lu", event.event);
|
|
|
if(event.type == SceneManagerEventTypeCustom) {
|
|
if(event.type == SceneManagerEventTypeCustom) {
|
|
|
- FURI_LOG_E("36", "SceneManagerEventTypeCustom");
|
|
|
|
|
|
|
+ // FURI_LOG_E("36", "SceneManagerEventTypeCustom");
|
|
|
if(event.event == UHFCustomEventWorkerExit) {
|
|
if(event.event == UHFCustomEventWorkerExit) {
|
|
|
- FURI_LOG_E("38", "UHFCustomEventWorkerExit");
|
|
|
|
|
- // if(memcmp(uhf_app->dev->dev_data.pacs.key, uhf_factory_debit_key, PICOPASS_BLOCK_LEN) ==
|
|
|
|
|
- // 0) {
|
|
|
|
|
- // scene_manager_next_scene(uhf_app->scene_manager, PicopassSceneReadFactorySuccess);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // scene_manager_next_scene(uhf_app->scene_manager, PicopassSceneReadCardSuccess);
|
|
|
|
|
- // }
|
|
|
|
|
- // scene_manager_next_scene(uhf_app->scene_manager, UHFSceneStart);
|
|
|
|
|
|
|
+ uhf_app->worker->state = UHFWorkerStateStop;
|
|
|
|
|
+ // scene_manager_next_scene(uhf_app->scene_manager, UHFSceneReadTagSuccess);
|
|
|
consumed = true;
|
|
consumed = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -56,7 +52,6 @@ bool uhf_scene_read_tag_on_event(void* ctx, SceneManagerEvent event) {
|
|
|
|
|
|
|
|
void uhf_scene_read_tag_on_exit(void* ctx) {
|
|
void uhf_scene_read_tag_on_exit(void* ctx) {
|
|
|
UHFApp* uhf_app = ctx;
|
|
UHFApp* uhf_app = ctx;
|
|
|
-
|
|
|
|
|
// Stop worker
|
|
// Stop worker
|
|
|
uhf_worker_stop(uhf_app->worker);
|
|
uhf_worker_stop(uhf_app->worker);
|
|
|
// Clear view
|
|
// Clear view
|