First become reader

This commit is contained in:
Nemanja Nedeljkovic
2023-08-22 17:11:31 +02:00
parent d5485f33a4
commit 6d77fc87a7
+7 -7
View File
@@ -502,13 +502,6 @@ static void btn_fn_copy_ic_uid(void) {
case TAG_TYPE_EM410X: {
uint8_t status;
uint8_t id_buffer[5] = { 0x00 };
status = PcdScanEM410X(id_buffer);
if(status != LF_TAG_OK) {
return;
}
bool is_reader_mode_now = get_device_mode() == DEVICE_MODE_READER;
// first, we need switch to reader mode.
if (!is_reader_mode_now) {
@@ -518,6 +511,13 @@ static void btn_fn_copy_ic_uid(void) {
NRF_LOG_INFO("Start reader mode to offline copy.")
}
uint8_t id_buffer[5] = { 0x00 };
status = PcdScanEM410X(id_buffer);
if(status != LF_TAG_OK) {
return;
}
tag_data_buffer_t* buffer = get_buffer_by_tag_type(TAG_TYPE_EM410X);
memcpy(buffer->buffer, id_buffer, LF_EM410X_TAG_ID_SIZE);
tag_emulation_load_by_buffer(TAG_TYPE_EM410X, false);