Skip to content

Commit

Permalink
Merge pull request #119 from user890104/subghz-protocol-hormann-bisecur
Browse files Browse the repository at this point in the history
Improve Hormann BiSecur readability in SubGHz history
  • Loading branch information
Willy-JL authored and RogueMaster committed May 15, 2024
1 parent bf26c2d commit 608d2b1
Show file tree
Hide file tree
Showing 71 changed files with 108 additions and 3 deletions.
1 change: 1 addition & 0 deletions applications/external/pocsag_pager/protocols/pocsag.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ const SubGhzProtocolDecoder subghz_protocol_pocsag_decoder = {
.serialize = subghz_protocol_decoder_pocsag_serialize,
.deserialize = subghz_protocol_decoder_pocsag_deserialize,
.get_string = subhz_protocol_decoder_pocsag_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_pocsag_encoder = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/tpms/protocols/schrader_gg4.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const SubGhzProtocolDecoder tpms_protocol_schrader_gg4_decoder = {
.serialize = tpms_protocol_decoder_schrader_gg4_serialize,
.deserialize = tpms_protocol_decoder_schrader_gg4_deserialize,
.get_string = tpms_protocol_decoder_schrader_gg4_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder tpms_protocol_schrader_gg4_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const SubGhzProtocolDecoder ws_protocol_acurite_592txr_decoder = {
.serialize = ws_protocol_decoder_acurite_592txr_serialize,
.deserialize = ws_protocol_decoder_acurite_592txr_deserialize,
.get_string = ws_protocol_decoder_acurite_592txr_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_acurite_592txr_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const SubGhzProtocolDecoder ws_protocol_acurite_606tx_decoder = {
.serialize = ws_protocol_decoder_acurite_606tx_serialize,
.deserialize = ws_protocol_decoder_acurite_606tx_deserialize,
.get_string = ws_protocol_decoder_acurite_606tx_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_acurite_606tx_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const SubGhzProtocolDecoder ws_protocol_acurite_609txc_decoder = {
.serialize = ws_protocol_decoder_acurite_609txc_serialize,
.deserialize = ws_protocol_decoder_acurite_609txc_deserialize,
.get_string = ws_protocol_decoder_acurite_609txc_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_acurite_609txc_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const SubGhzProtocolDecoder ws_protocol_acurite_986_decoder = {
.serialize = ws_protocol_decoder_acurite_986_serialize,
.deserialize = ws_protocol_decoder_acurite_986_deserialize,
.get_string = ws_protocol_decoder_acurite_986_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_acurite_986_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const SubGhzProtocolDecoder ws_protocol_ambient_weather_decoder = {
.serialize = ws_protocol_decoder_ambient_weather_serialize,
.deserialize = ws_protocol_decoder_ambient_weather_deserialize,
.get_string = ws_protocol_decoder_ambient_weather_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_ambient_weather_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const SubGhzProtocolDecoder ws_protocol_auriol_ahfl_decoder = {
.serialize = ws_protocol_decoder_auriol_ahfl_serialize,
.deserialize = ws_protocol_decoder_auriol_ahfl_deserialize,
.get_string = ws_protocol_decoder_auriol_ahfl_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_auriol_ahfl_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const SubGhzProtocolDecoder ws_protocol_auriol_th_decoder = {
.serialize = ws_protocol_decoder_auriol_th_serialize,
.deserialize = ws_protocol_decoder_auriol_th_deserialize,
.get_string = ws_protocol_decoder_auriol_th_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_auriol_th_encoder = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/weather_station/protocols/gt_wt_02.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const SubGhzProtocolDecoder ws_protocol_gt_wt_02_decoder = {
.serialize = ws_protocol_decoder_gt_wt_02_serialize,
.deserialize = ws_protocol_decoder_gt_wt_02_deserialize,
.get_string = ws_protocol_decoder_gt_wt_02_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_gt_wt_02_encoder = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/weather_station/protocols/gt_wt_03.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const SubGhzProtocolDecoder ws_protocol_gt_wt_03_decoder = {
.serialize = ws_protocol_decoder_gt_wt_03_serialize,
.deserialize = ws_protocol_decoder_gt_wt_03_deserialize,
.get_string = ws_protocol_decoder_gt_wt_03_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_gt_wt_03_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const SubGhzProtocolDecoder ws_protocol_infactory_decoder = {
.serialize = ws_protocol_decoder_infactory_serialize,
.deserialize = ws_protocol_decoder_infactory_deserialize,
.get_string = ws_protocol_decoder_infactory_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_infactory_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const SubGhzProtocolDecoder ws_protocol_kedsum_th_decoder = {
.serialize = ws_protocol_decoder_kedsum_th_serialize,
.deserialize = ws_protocol_decoder_kedsum_th_deserialize,
.get_string = ws_protocol_decoder_kedsum_th_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_kedsum_th_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const SubGhzProtocolDecoder ws_protocol_lacrosse_tx_decoder = {
.serialize = ws_protocol_decoder_lacrosse_tx_serialize,
.deserialize = ws_protocol_decoder_lacrosse_tx_deserialize,
.get_string = ws_protocol_decoder_lacrosse_tx_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_lacrosse_tx_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const SubGhzProtocolDecoder ws_protocol_lacrosse_tx141thbv2_decoder = {
.serialize = ws_protocol_decoder_lacrosse_tx141thbv2_serialize,
.deserialize = ws_protocol_decoder_lacrosse_tx141thbv2_deserialize,
.get_string = ws_protocol_decoder_lacrosse_tx141thbv2_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_lacrosse_tx141thbv2_encoder = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/weather_station/protocols/nexus_th.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const SubGhzProtocolDecoder ws_protocol_nexus_th_decoder = {
.serialize = ws_protocol_decoder_nexus_th_serialize,
.deserialize = ws_protocol_decoder_nexus_th_deserialize,
.get_string = ws_protocol_decoder_nexus_th_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_nexus_th_encoder = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/weather_station/protocols/oregon2.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ const SubGhzProtocolDecoder ws_protocol_oregon2_decoder = {
.serialize = ws_protocol_decoder_oregon2_serialize,
.deserialize = ws_protocol_decoder_oregon2_deserialize,
.get_string = ws_protocol_decoder_oregon2_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocol ws_protocol_oregon2 = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/weather_station/protocols/oregon3.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ const SubGhzProtocolDecoder ws_protocol_oregon3_decoder = {
.serialize = ws_protocol_decoder_oregon3_serialize,
.deserialize = ws_protocol_decoder_oregon3_deserialize,
.get_string = ws_protocol_decoder_oregon3_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocol ws_protocol_oregon3 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const SubGhzProtocolDecoder ws_protocol_oregon_v1_decoder = {
.serialize = ws_protocol_decoder_oregon_v1_serialize,
.deserialize = ws_protocol_decoder_oregon_v1_deserialize,
.get_string = ws_protocol_decoder_oregon_v1_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_oregon_v1_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const SubGhzProtocolDecoder ws_protocol_thermopro_tx4_decoder = {
.serialize = ws_protocol_decoder_thermopro_tx4_serialize,
.deserialize = ws_protocol_decoder_thermopro_tx4_deserialize,
.get_string = ws_protocol_decoder_thermopro_tx4_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_thermopro_tx4_encoder = {
Expand Down
1 change: 1 addition & 0 deletions applications/external/weather_station/protocols/tx_8300.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const SubGhzProtocolDecoder ws_protocol_tx_8300_decoder = {
.serialize = ws_protocol_decoder_tx_8300_serialize,
.deserialize = ws_protocol_decoder_tx_8300_deserialize,
.get_string = ws_protocol_decoder_tx_8300_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_tx_8300_encoder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const SubGhzProtocolDecoder ws_protocol_wendox_w6726_decoder = {
.serialize = ws_protocol_decoder_wendox_w6726_serialize,
.deserialize = ws_protocol_decoder_wendox_w6726_deserialize,
.get_string = ws_protocol_decoder_wendox_w6726_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder ws_protocol_wendox_w6726_encoder = {
Expand Down
12 changes: 10 additions & 2 deletions applications/main/subghz/subghz_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ bool subghz_history_add_to_history(
SubGhzProtocolDecoderBase* decoder_base = context;
uint32_t hash_data = subghz_protocol_decoder_base_get_hash_data_long(decoder_base);
if((instance->code_last_hash_data == hash_data) &&
((furi_get_tick() - instance->last_update_timestamp) < 500)) {
((furi_get_tick() - instance->last_update_timestamp) < 600)) {
instance->last_update_timestamp = furi_get_tick();
return false;
}
Expand All @@ -265,7 +265,6 @@ bool subghz_history_add_to_history(
instance->code_last_hash_data = hash_data;
instance->last_update_timestamp = furi_get_tick();

FuriString* text = furi_string_alloc();
SubGhzHistoryItem* item = SubGhzHistoryItemArray_push_raw(instance->history->data);
item->preset = malloc(sizeof(SubGhzRadioPreset));
item->type = decoder_base->protocol->type;
Expand All @@ -285,6 +284,15 @@ bool subghz_history_add_to_history(
item->flipper_string = flipper_format_string_alloc();
subghz_protocol_decoder_base_serialize(decoder_base, item->flipper_string, preset);

if(decoder_base->protocol && decoder_base->protocol->decoder &&
decoder_base->protocol->decoder->get_string_brief) {
decoder_base->protocol->decoder->get_string_brief(decoder_base, item->item_str);
instance->last_index_write++;
return true;
}

FuriString* text = furi_string_alloc();

do {
if(!flipper_format_rewind(item->flipper_string)) {
FURI_LOG_E(TAG, "Rewind error");
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/alutech_at_4n.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const SubGhzProtocolDecoder subghz_protocol_alutech_at_4n_decoder = {
.serialize = subghz_protocol_decoder_alutech_at_4n_serialize,
.deserialize = subghz_protocol_decoder_alutech_at_4n_deserialize,
.get_string = subghz_protocol_decoder_alutech_at_4n_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_alutech_at_4n_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/ansonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const SubGhzProtocolDecoder subghz_protocol_ansonic_decoder = {
.serialize = subghz_protocol_decoder_ansonic_serialize,
.deserialize = subghz_protocol_decoder_ansonic_deserialize,
.get_string = subghz_protocol_decoder_ansonic_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_ansonic_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/bett.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const SubGhzProtocolDecoder subghz_protocol_bett_decoder = {
.serialize = subghz_protocol_decoder_bett_serialize,
.deserialize = subghz_protocol_decoder_bett_deserialize,
.get_string = subghz_protocol_decoder_bett_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_bett_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/bin_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const SubGhzProtocolDecoder subghz_protocol_bin_raw_decoder = {
.serialize = subghz_protocol_decoder_bin_raw_serialize,
.deserialize = subghz_protocol_decoder_bin_raw_deserialize,
.get_string = subghz_protocol_decoder_bin_raw_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_bin_raw_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/came.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const SubGhzProtocolDecoder subghz_protocol_came_decoder = {
.serialize = subghz_protocol_decoder_came_serialize,
.deserialize = subghz_protocol_decoder_came_deserialize,
.get_string = subghz_protocol_decoder_came_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_came_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/came_atomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const SubGhzProtocolDecoder subghz_protocol_came_atomo_decoder = {
.serialize = subghz_protocol_decoder_came_atomo_serialize,
.deserialize = subghz_protocol_decoder_came_atomo_deserialize,
.get_string = subghz_protocol_decoder_came_atomo_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_came_atomo_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/came_twee.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const SubGhzProtocolDecoder subghz_protocol_came_twee_decoder = {
.serialize = subghz_protocol_decoder_came_twee_serialize,
.deserialize = subghz_protocol_decoder_came_twee_deserialize,
.get_string = subghz_protocol_decoder_came_twee_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_came_twee_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/chamberlain_code.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const SubGhzProtocolDecoder subghz_protocol_chamb_code_decoder = {
.serialize = subghz_protocol_decoder_chamb_code_serialize,
.deserialize = subghz_protocol_decoder_chamb_code_deserialize,
.get_string = subghz_protocol_decoder_chamb_code_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_chamb_code_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/clemsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const SubGhzProtocolDecoder subghz_protocol_clemsa_decoder = {
.serialize = subghz_protocol_decoder_clemsa_serialize,
.deserialize = subghz_protocol_decoder_clemsa_deserialize,
.get_string = subghz_protocol_decoder_clemsa_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_clemsa_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/doitrand.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const SubGhzProtocolDecoder subghz_protocol_doitrand_decoder = {
.serialize = subghz_protocol_decoder_doitrand_serialize,
.deserialize = subghz_protocol_decoder_doitrand_deserialize,
.get_string = subghz_protocol_decoder_doitrand_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_doitrand_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/dooya.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const SubGhzProtocolDecoder subghz_protocol_dooya_decoder = {
.serialize = subghz_protocol_decoder_dooya_serialize,
.deserialize = subghz_protocol_decoder_dooya_deserialize,
.get_string = subghz_protocol_decoder_dooya_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_dooya_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/faac_slh.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const SubGhzProtocolDecoder subghz_protocol_faac_slh_decoder = {
.serialize = subghz_protocol_decoder_faac_slh_serialize,
.deserialize = subghz_protocol_decoder_faac_slh_deserialize,
.get_string = subghz_protocol_decoder_faac_slh_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_faac_slh_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/gate_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const SubGhzProtocolDecoder subghz_protocol_gate_tx_decoder = {
.serialize = subghz_protocol_decoder_gate_tx_serialize,
.deserialize = subghz_protocol_decoder_gate_tx_deserialize,
.get_string = subghz_protocol_decoder_gate_tx_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_gate_tx_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/holtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const SubGhzProtocolDecoder subghz_protocol_holtek_decoder = {
.serialize = subghz_protocol_decoder_holtek_serialize,
.deserialize = subghz_protocol_decoder_holtek_deserialize,
.get_string = subghz_protocol_decoder_holtek_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_holtek_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/holtek_ht12x.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const SubGhzProtocolDecoder subghz_protocol_holtek_th12x_decoder = {
.serialize = subghz_protocol_decoder_holtek_th12x_serialize,
.deserialize = subghz_protocol_decoder_holtek_th12x_deserialize,
.get_string = subghz_protocol_decoder_holtek_th12x_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_holtek_th12x_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/honeywell.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ const SubGhzProtocolDecoder subghz_protocol_honeywell_decoder = {
.serialize = subghz_protocol_decoder_honeywell_serialize,
.deserialize = subghz_protocol_decoder_honeywell_deserialize,
.get_string = subghz_protocol_decoder_honeywell_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_honeywell_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/honeywell_wdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const SubGhzProtocolDecoder subghz_protocol_honeywell_wdb_decoder = {
.serialize = subghz_protocol_decoder_honeywell_wdb_serialize,
.deserialize = subghz_protocol_decoder_honeywell_wdb_deserialize,
.get_string = subghz_protocol_decoder_honeywell_wdb_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_honeywell_wdb_encoder = {
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/protocols/hormann.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const SubGhzProtocolDecoder subghz_protocol_hormann_decoder = {
.serialize = subghz_protocol_decoder_hormann_serialize,
.deserialize = subghz_protocol_decoder_hormann_deserialize,
.get_string = subghz_protocol_decoder_hormann_get_string,
.get_string_brief = NULL,
};

const SubGhzProtocolEncoder subghz_protocol_hormann_encoder = {
Expand Down
21 changes: 21 additions & 0 deletions lib/subghz/protocols/hormann_bisecur.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +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 = subghz_protocol_decoder_hormann_bisecur_get_string_brief,
};

const SubGhzProtocolEncoder subghz_protocol_hormann_bisecur_encoder = {
Expand Down Expand Up @@ -572,6 +573,26 @@ 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));
uint8_t data_2_hash = subghz_protocol_blocks_xor_bytes(
(const uint8_t*)&instance->generic.data_2, sizeof(uint64_t));

furi_string_cat_printf(
output, "HBS %08lX:%02X%02X", instance->generic.serial, data_hash, data_2_hash);
}

static LevelDuration subghz_protocol_encoder_hormann_bisecur_add_duration_to_upload(
ManchesterEncoderResult result) {
LevelDuration data = {.duration = 0, .level = 0};
Expand Down
7 changes: 7 additions & 0 deletions lib/subghz/protocols/hormann_bisecur.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Loading

0 comments on commit 608d2b1

Please sign in to comment.