Merge remote-tracking branch 'ul/dev' into mntm-dev

This commit is contained in:
Willy-JL
2024-10-16 00:04:21 +01:00
21 changed files with 313 additions and 390 deletions
@@ -116,6 +116,37 @@ Iso14443_4aError iso14443_4a_poller_send_block(
return error;
}
Iso14443_4aError iso14443_4a_poller_send_chain_block(
Iso14443_4aPoller* instance,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer) {
iso14443_4_layer_set_i_block(instance->iso14443_4_layer, true, false);
Iso14443_4aError error = iso14443_4a_poller_send_block(instance, tx_buffer, rx_buffer);
return error;
}
Iso14443_4aError iso14443_4a_poller_send_receive_ready_block(
Iso14443_4aPoller* instance,
bool acknowledged,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer) {
bool CID_present = bit_buffer_get_size_bytes(tx_buffer) != 0;
iso14443_4_layer_set_r_block(instance->iso14443_4_layer, acknowledged, CID_present);
Iso14443_4aError error = iso14443_4a_poller_send_block(instance, tx_buffer, rx_buffer);
return error;
}
Iso14443_4aError iso14443_4a_poller_send_supervisory_block(
Iso14443_4aPoller* instance,
bool deselect,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer) {
bool CID_present = bit_buffer_get_size_bytes(tx_buffer) != 0;
iso14443_4_layer_set_s_block(instance->iso14443_4_layer, deselect, CID_present);
Iso14443_4aError error = iso14443_4a_poller_send_block(instance, tx_buffer, rx_buffer);
return error;
}
Iso14443_4aError iso14443_4a_poller_send_block_pwt_ext(
Iso14443_4aPoller* instance,
const BitBuffer* tx_buffer,
@@ -164,34 +195,3 @@ Iso14443_4aError iso14443_4a_poller_send_block_pwt_ext(
return error;
}
Iso14443_4aError iso14443_4a_poller_send_chain_block(
Iso14443_4aPoller* instance,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer) {
iso14443_4_layer_set_i_block(instance->iso14443_4_layer, true, false);
Iso14443_4aError error = iso14443_4a_poller_send_block(instance, tx_buffer, rx_buffer);
return error;
}
Iso14443_4aError iso14443_4a_poller_send_receive_ready_block(
Iso14443_4aPoller* instance,
bool acknowledged,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer) {
bool CID_present = bit_buffer_get_size_bytes(tx_buffer) != 0;
iso14443_4_layer_set_r_block(instance->iso14443_4_layer, acknowledged, CID_present);
Iso14443_4aError error = iso14443_4a_poller_send_block(instance, tx_buffer, rx_buffer);
return error;
}
Iso14443_4aError iso14443_4a_poller_send_supervisory_block(
Iso14443_4aPoller* instance,
bool deselect,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer) {
bool CID_present = bit_buffer_get_size_bytes(tx_buffer) != 0;
iso14443_4_layer_set_s_block(instance->iso14443_4_layer, deselect, CID_present);
Iso14443_4aError error = iso14443_4a_poller_send_block(instance, tx_buffer, rx_buffer);
return error;
}
+2 -14
View File
@@ -490,23 +490,12 @@ void subghz_protocol_decoder_gangqi_get_string(void* context, FuriString* output
((instance->generic.data >> 24) & 0xFF) -
((instance->generic.data >> 16) & 0xFF) - ((instance->generic.data >> 8) & 0xFF);
// Get 3 bytes sum
uint16_t sum_3bytes_serial = ((instance->generic.serial >> 16) & 0xFF) +
((instance->generic.serial >> 8) & 0xFF) +
(instance->generic.serial & 0xFF);
// Returns true if serial is valid
bool serial_is_valid =
(((!(sum_3bytes_serial & 0x3)) &&
((0xB < sum_3bytes_serial) && (sum_3bytes_serial < 0x141))) &&
(((instance->generic.serial >> 16) & 0xFF) <= 0x3));
furi_string_cat_printf(
output,
"%s %db\r\n"
"Key: 0x%X%08lX\r\n"
"Serial: 0x%05lX CRC: 0x%02X\r\n"
"Btn: 0x%01X - %s\r\n"
"Serial is %s\r\n",
"Btn: 0x%01X - %s\r\n",
instance->generic.protocol_name,
instance->generic.data_count_bit,
(uint8_t)(instance->generic.data >> 32),
@@ -514,6 +503,5 @@ void subghz_protocol_decoder_gangqi_get_string(void* context, FuriString* output
instance->generic.serial,
crc,
instance->generic.btn,
subghz_protocol_gangqi_get_button_name(instance->generic.btn),
serial_is_valid ? "valid" : "invalid");
subghz_protocol_gangqi_get_button_name(instance->generic.btn));
}