[FL-1748] NFC, iButton edit fix (#680)

* nfc: fix edit UID without confirmation
* ibutton: fix key edit
* nfc: fix nfc uid edition
* nfc: fix structure type name
This commit is contained in:
gornekich
2021-09-02 12:28:40 +03:00
committed by GitHub
parent ae08c88bd6
commit 4b7d9b79a9
5 changed files with 12 additions and 10 deletions

11
applications/ibutton/scene/ibutton-scene-add-value.cpp Normal file → Executable file
View File

@@ -8,14 +8,9 @@ void iButtonSceneAddValue::on_enter(iButtonApp* app) {
iButtonAppViewManager* view_manager = app->get_view_manager();
ByteInput* byte_input = view_manager->get_byte_input();
auto callback = cbc::obtain_connector(this, &iButtonSceneAddValue::byte_input_callback);
memcpy(this->new_key_data, app->get_key()->get_data(), app->get_key()->get_type_data_size());
byte_input_set_result_callback(
byte_input,
callback,
NULL,
app,
app->get_key()->get_data(),
app->get_key()->get_type_data_size());
byte_input, callback, NULL, app, this->new_key_data, app->get_key()->get_type_data_size());
byte_input_set_header_text(byte_input, "Enter the key");
view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewByteInput);
@@ -45,6 +40,6 @@ void iButtonSceneAddValue::byte_input_callback(void* context) {
iButtonEvent event;
event.type = iButtonEvent::Type::EventTypeByteEditResult;
memcpy(app->get_key()->get_data(), this->new_key_data, app->get_key()->get_type_data_size());
app->get_view_manager()->send_event(&event);
}

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ibutton-scene-generic.h"
#include "../ibutton-key.h"
class iButtonSceneAddValue : public iButtonScene {
public:
@@ -9,4 +10,5 @@ public:
private:
void byte_input_callback(void* context);
uint8_t new_key_data[IBUTTON_KEY_DATA_SIZE] = {};
};