mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-10-03 18:05:50 +02:00
Improve Hormann BiSecur readability in SubGHz history
This commit is contained in:
@@ -63,7 +63,7 @@ const SubGhzProtocolDecoder subghz_protocol_hormann_bisecur_decoder = {
|
||||
.serialize = subghz_protocol_decoder_hormann_bisecur_serialize,
|
||||
.deserialize = subghz_protocol_decoder_hormann_bisecur_deserialize,
|
||||
.get_string = subghz_protocol_decoder_hormann_bisecur_get_string,
|
||||
.get_string_brief = NULL,
|
||||
.get_string_brief = subghz_protocol_decoder_hormann_bisecur_get_string_brief,
|
||||
};
|
||||
|
||||
const SubGhzProtocolEncoder subghz_protocol_hormann_bisecur_encoder = {
|
||||
@@ -573,6 +573,25 @@ void subghz_protocol_decoder_hormann_bisecur_get_string(void* context, FuriStrin
|
||||
instance->generic.data_2);
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_hormann_bisecur_get_string_brief(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderHormannBiSecur* instance = context;
|
||||
subghz_protocol_hormann_bisecur_parse_data(instance);
|
||||
bool valid_crc = subghz_protocol_decoder_hormann_bisecur_check_crc(instance);
|
||||
|
||||
if(!valid_crc) {
|
||||
furi_string_cat_printf(output, "HBS Bad checksum");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t data_hash = subghz_protocol_blocks_xor_bytes(
|
||||
(const uint8_t*)&instance->generic.data, sizeof(uint64_t));
|
||||
data_hash ^= subghz_protocol_blocks_xor_bytes(
|
||||
(const uint8_t*)&instance->generic.data_2, sizeof(uint64_t));
|
||||
|
||||
furi_string_cat_printf(output, "HBS %08lX:%02X", instance->generic.serial, data_hash);
|
||||
}
|
||||
|
||||
static LevelDuration subghz_protocol_encoder_hormann_bisecur_add_duration_to_upload(
|
||||
ManchesterEncoderResult result) {
|
||||
LevelDuration data = {.duration = 0, .level = 0};
|
||||
|
@@ -109,3 +109,10 @@ SubGhzProtocolStatus subghz_protocol_decoder_hormann_bisecur_deserialize(
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_hormann_bisecur_get_string(void* context, FuriString* output);
|
||||
|
||||
/**
|
||||
* Getting a one-line textual representation of the received data.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderHormannBiSecur instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_hormann_bisecur_get_string_brief(void* context, FuriString* output);
|
||||
|
Reference in New Issue
Block a user