Protocol data redecoding before write

OFW PR 1723 by nminaylov
This commit is contained in:
MX 2022-09-14 16:18:23 +03:00
parent b00117e02c
commit 4a61a28f57
No known key found for this signature in database
GPG Key ID: 6C4C311DFD4B4AB5
14 changed files with 60 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {