RFID: fix read info screen (#1723)
* RFID: fix read info screen * Fix line break for long data string * Protocol data redecoding before write Co-authored-by: SG <who.just.the.doctor@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
d80329b323
commit
fb476c29e6
@ -24,14 +24,13 @@ void lfrfid_scene_read_success_on_enter(void* context) {
|
||||
uint8_t* data = (uint8_t*)malloc(size);
|
||||
protocol_dict_get_data(app->dict, app->protocol_id, data, size);
|
||||
for(uint8_t i = 0; i < size; i++) {
|
||||
if(i != 0) {
|
||||
string_cat_printf(tmp_string, " ");
|
||||
}
|
||||
|
||||
if(i >= 9) {
|
||||
string_cat_printf(tmp_string, "...");
|
||||
string_cat_printf(tmp_string, "..");
|
||||
break;
|
||||
} else {
|
||||
if(i != 0) {
|
||||
string_cat_printf(tmp_string, " ");
|
||||
}
|
||||
string_cat_printf(tmp_string, "%02X", data[i]);
|
||||
}
|
||||
}
|
||||
@ -43,7 +42,7 @@ void lfrfid_scene_read_success_on_enter(void* context) {
|
||||
string_cat_printf(tmp_string, "\r\n%s", string_get_cstr(render_data));
|
||||
string_clear(render_data);
|
||||
|
||||
widget_add_string_element(
|
||||
widget_add_string_multiline_element(
|
||||
widget, 0, 16, AlignLeft, AlignTop, FontSecondary, string_get_cstr(tmp_string));
|
||||
|
||||
notification_message_block(app->notifications, &sequence_set_green_255);
|
||||
|
@ -205,6 +205,10 @@ bool protocol_awid_write_data(ProtocolAwid* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_awid_encode(protocol->data, (uint8_t*)protocol->encoded_data);
|
||||
protocol_awid_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_awid_encode(protocol->data, (uint8_t*)protocol->encoded_data);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -248,6 +248,14 @@ bool protocol_em4100_write_data(ProtocolEM4100* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_em4100_encoder_start(protocol);
|
||||
em4100_decode(
|
||||
(uint8_t*)&protocol->encoded_data,
|
||||
sizeof(EM4100DecodedData),
|
||||
protocol->data,
|
||||
EM4100_DECODED_DATA_SIZE);
|
||||
|
||||
protocol_em4100_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -178,6 +178,10 @@ bool protocol_fdx_a_write_data(ProtocolFDXA* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_fdx_a_encoder_start(protocol);
|
||||
protocol_fdx_a_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_fdx_a_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -334,6 +334,10 @@ bool protocol_fdx_b_write_data(ProtocolFDXB* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_fdx_b_encoder_start(protocol);
|
||||
protocol_fdx_b_decode(protocol);
|
||||
|
||||
protocol_fdx_b_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -249,6 +249,10 @@ bool protocol_gallagher_write_data(ProtocolGallagher* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_gallagher_encoder_start(protocol);
|
||||
protocol_gallagher_decode(protocol);
|
||||
|
||||
protocol_gallagher_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -337,6 +337,10 @@ bool protocol_h10301_write_data(ProtocolH10301* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_h10301_encoder_start(protocol);
|
||||
protocol_h10301_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_h10301_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -171,6 +171,10 @@ bool protocol_hid_ex_generic_write_data(ProtocolHIDEx* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_hid_ex_generic_encoder_start(protocol);
|
||||
protocol_hid_ex_generic_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_hid_ex_generic_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -203,6 +203,10 @@ bool protocol_hid_generic_write_data(ProtocolHID* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_hid_generic_encoder_start(protocol);
|
||||
protocol_hid_generic_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_hid_generic_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -259,6 +259,10 @@ bool protocol_io_prox_xsf_write_data(ProtocolIOProxXSF* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_io_prox_xsf_encode(protocol->data, protocol->encoded_data);
|
||||
protocol_io_prox_xsf_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_io_prox_xsf_encode(protocol->data, protocol->encoded_data);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -169,6 +169,10 @@ bool protocol_jablotron_write_data(ProtocolJablotron* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_jablotron_encoder_start(protocol);
|
||||
protocol_jablotron_decode(protocol);
|
||||
|
||||
protocol_jablotron_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -182,6 +182,10 @@ bool protocol_pac_stanley_write_data(ProtocolPACStanley* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_pac_stanley_encoder_start(protocol);
|
||||
protocol_pac_stanley_decode(protocol);
|
||||
|
||||
protocol_pac_stanley_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -162,6 +162,10 @@ bool protocol_paradox_write_data(ProtocolParadox* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_paradox_encode(protocol->data, (uint8_t*)protocol->encoded_data);
|
||||
protocol_paradox_decode(protocol->encoded_data, protocol->data);
|
||||
|
||||
protocol_paradox_encode(protocol->data, (uint8_t*)protocol->encoded_data);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -219,6 +219,10 @@ bool protocol_pyramid_write_data(ProtocolPyramid* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_pyramid_encode(protocol);
|
||||
protocol_pyramid_decode(protocol);
|
||||
|
||||
protocol_pyramid_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
@ -157,6 +157,10 @@ bool protocol_viking_write_data(ProtocolViking* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
bool result = false;
|
||||
|
||||
// Correct protocol data by redecoding
|
||||
protocol_viking_encoder_start(protocol);
|
||||
protocol_viking_decode(protocol);
|
||||
|
||||
protocol_viking_encoder_start(protocol);
|
||||
|
||||
if(request->write_type == LFRFIDWriteTypeT5577) {
|
||||
|
Loading…
Reference in New Issue
Block a user