[FL-3106] SubGhz: better and more verbose error handling in protocols, stricter CAME validation (#2443)
* SubGhz: add error protocol * WS: add error protocol * SubGhz: error processing * SubGhz: more stringent CAME protocol restrictions * SubGhz: fix header duration CAME protocol * SubGhz: delete comments * SubGhz: sync SubGhzProtocolStatus with FuriStatus * SubGhz: update documentation and bump api_version Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -283,7 +283,7 @@ uint8_t ws_protocol_decoder_oregon_v1_get_hash_data(void* context) {
|
||||
&instance->decoder, (instance->decoder.decode_count_bit / 8) + 1);
|
||||
}
|
||||
|
||||
bool ws_protocol_decoder_oregon_v1_serialize(
|
||||
SubGhzProtocolStatus ws_protocol_decoder_oregon_v1_serialize(
|
||||
void* context,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzRadioPreset* preset) {
|
||||
@@ -292,22 +292,12 @@ bool ws_protocol_decoder_oregon_v1_serialize(
|
||||
return ws_block_generic_serialize(&instance->generic, flipper_format, preset);
|
||||
}
|
||||
|
||||
bool ws_protocol_decoder_oregon_v1_deserialize(void* context, FlipperFormat* flipper_format) {
|
||||
SubGhzProtocolStatus
|
||||
ws_protocol_decoder_oregon_v1_deserialize(void* context, FlipperFormat* flipper_format) {
|
||||
furi_assert(context);
|
||||
WSProtocolDecoderOregon_V1* instance = context;
|
||||
bool ret = false;
|
||||
do {
|
||||
if(!ws_block_generic_deserialize(&instance->generic, flipper_format)) {
|
||||
break;
|
||||
}
|
||||
if(instance->generic.data_count_bit !=
|
||||
ws_protocol_oregon_v1_const.min_count_bit_for_found) {
|
||||
FURI_LOG_E(TAG, "Wrong number of bits in key");
|
||||
break;
|
||||
}
|
||||
ret = true;
|
||||
} while(false);
|
||||
return ret;
|
||||
return ws_block_generic_deserialize_check_count_bit(
|
||||
&instance->generic, flipper_format, ws_protocol_oregon_v1_const.min_count_bit_for_found);
|
||||
}
|
||||
|
||||
void ws_protocol_decoder_oregon_v1_get_string(void* context, FuriString* output) {
|
||||
|
Reference in New Issue
Block a user