Skip to content

Commit

Permalink
Latest Release RM0210-1603-0.97.2-2707a31 on PATREON - SUBG OVERHAUL PT1
Browse files Browse the repository at this point in the history
Protocols By htotoo, Sil333033, Willy-JL & others as mentioned on protocol comments
  • Loading branch information
RogueMaster committed Feb 12, 2024
1 parent 3e5e187 commit d6a7bb6
Show file tree
Hide file tree
Showing 152 changed files with 9,579 additions and 176 deletions.
1 change: 1 addition & 0 deletions applications/main/application.fam
Expand Up @@ -29,6 +29,7 @@ App(
"ibutton_start",
"onewire_start",
"subghz_start",
"subghz_load_extended_settings",
"infrared_start",
"lfrfid_start",
"nfc_start",
Expand Down
12 changes: 12 additions & 0 deletions lib/subghz/blocks/decoder.c
Expand Up @@ -25,3 +25,15 @@ uint8_t subghz_protocol_blocks_get_hash_data(SubGhzBlockDecoder* decoder, size_t
}
return hash;
}

uint32_t subghz_protocol_blocks_get_hash_data_long(SubGhzBlockDecoder* decoder, size_t len) {
union {
uint32_t full;
uint8_t split[4];
} hash = {0};
uint8_t* p = (uint8_t*)&decoder->decode_data;
for(size_t i = 0; i < len; i++) {
hash.split[i % sizeof(hash)] ^= p[i];
}
return hash.full;
}
7 changes: 7 additions & 0 deletions lib/subghz/blocks/decoder.h
Expand Up @@ -42,6 +42,13 @@ void subghz_protocol_blocks_add_to_128_bit(
*/
uint8_t subghz_protocol_blocks_get_hash_data(SubGhzBlockDecoder* decoder, size_t len);

/**
* Getting the long hash sum of the last randomly received parcel.
* @param decoder Pointer to a SubGhzBlockDecoder instance
* @return hash Hash sum
*/
uint32_t subghz_protocol_blocks_get_hash_data_long(SubGhzBlockDecoder* decoder, size_t len);

#ifdef __cplusplus
}
#endif
10 changes: 10 additions & 0 deletions lib/subghz/blocks/generic.c
Expand Up @@ -66,6 +66,16 @@ SubGhzProtocolStatus subghz_block_generic_serialize(
break;
}
}
if(!flipper_format_write_float(flipper_format, "Latitute", &preset->latitude, 1)) {
FURI_LOG_E(TAG, "Unable to add Latitute");
res = SubGhzProtocolStatusErrorParserLatitude;
break;
}
if(!flipper_format_write_float(flipper_format, "Longitude", &preset->longitude, 1)) {
FURI_LOG_E(TAG, "Unable to add Longitude");
res = SubGhzProtocolStatusErrorParserLongitude;
break;
}
if(!flipper_format_write_string_cstr(flipper_format, "Protocol", instance->protocol_name)) {
FURI_LOG_E(TAG, "Unable to add Protocol");
res = SubGhzProtocolStatusErrorParserProtocolName;
Expand Down
2 changes: 2 additions & 0 deletions lib/subghz/blocks/generic.h
Expand Up @@ -17,6 +17,8 @@ typedef struct SubGhzBlockGeneric SubGhzBlockGeneric;

struct SubGhzBlockGeneric {
const char* protocol_name;
float latitude;
float longitude;
uint64_t data;
uint64_t data_2;
uint32_t serial;
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/devices/types.h
Expand Up @@ -95,4 +95,4 @@ struct SubGhzDeviceConf {
uint8_t ver;
bool extended_range;
bool power_amp;
};
};

0 comments on commit d6a7bb6

Please sign in to comment.