Skip to content

Commit

Permalink
Merge pull request #152 from perspecdev/auto-detect-raw-new
Browse files Browse the repository at this point in the history
re-implemented auto-detect raw
  • Loading branch information
RogueMaster authored Aug 2, 2022
2 parents 2a78380 + 006d898 commit 6ba0731
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions lib/subghz/protocols/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,11 @@ void subghz_protocol_decoder_raw_feed(void* context, bool level, uint32_t durati
}
}

bool subghz_protocol_decoder_raw_deserialize(void* context, FlipperFormat* flipper_format) {
uint8_t subghz_protocol_decoder_raw_get_hash_data(void* context) {
furi_assert(context);
UNUSED(context);
UNUSED(flipper_format);
//ToDo stub, for backwards compatibility
return true;
SubGhzProtocolDecoderRAW* instance = context;
return subghz_protocol_blocks_get_hash_data(
&instance->decoder, (instance->decoder.decode_count_bit / 8) + 1);
}

uint8_t subghz_protocol_decoder_raw_get_hash_data(void* context) {
Expand Down
7 changes: 3 additions & 4 deletions lib/subghz/protocols/raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ bool subghz_protocol_decoder_raw_write_data(void* context, bool level, uint32_t
void subghz_protocol_decoder_raw_feed(void* context, bool level, uint32_t duration);

/**
* Deserialize data SubGhzProtocolDecoderRAW.
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderRAW instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
* @return hash Hash sum
*/
bool subghz_protocol_decoder_raw_deserialize(void* context, FlipperFormat* flipper_format);
uint8_t subghz_protocol_decoder_raw_get_hash_data(void* context);

/**
* Getting the hash sum of the last randomly received parcel.
Expand Down

0 comments on commit 6ba0731

Please sign in to comment.