Subghz decoder (#1646)

* Initial commit - wip

* Half part of the transition of baseband processor.

* More SGD

* WIP, Weather refactor, UI improv

* Rename

* Added 4msps, and fixes

* Fixes

* princeton working

* Renamed proc_weather, bc now multifunctional

* Proto: bett

* FPS_CAME = 4,
    FPS_PRASTEL = 5,
    FPS_AIRFORCE = 6,

* Came Atomo, fixes

* Separate weather and sgd, bc of baseband size limit

* Fix display

* Save space

* More protos

* Dooya proto added

* More protos

* add protos

* More protos

* Move weather to ext app

* nw

* Revert "Move weather to ext app"

This reverts commit 8a84aac2f5.

* revert

* Fix merge

* Better naming

* More protos

* More protos

* Add protos

* Fix warning

* Add NeroRadio

* more protos

* more protos

* More protos

* Shrink a bit

* fixes

* More protos

* Nicer code

* Fix naming

* Fix format

* Remove unused

* Fix some protos, that needs a LOOOONG part with the same lo/high

* Modify key calculation
This commit is contained in:
Totoo
2023-12-16 23:37:51 +01:00
committed by GitHub
parent 02810bf527
commit 2ccda5aebd
71 changed files with 4952 additions and 248 deletions

View File

@@ -64,11 +64,7 @@ class FProtoWeatherOregonV1 : public FProtoWeatherBase {
// found all the necessary patterns
decode_data = 0;
decode_count_bit = 1;
manchester_advance(
manchester_saved_state,
ManchesterEventReset,
&manchester_saved_state,
NULL);
FProtoGeneral::manchester_advance(manchester_saved_state, ManchesterEventReset, &manchester_saved_state, NULL);
parser_step = Oregon_V1DecoderStepParse;
if (duration < te_short * 4) {
first_bit = 1;
@@ -114,22 +110,17 @@ class FProtoWeatherOregonV1 : public FProtoWeatherBase {
}
decode_data = 0;
decode_count_bit = 0;
manchester_advance(
manchester_saved_state,
ManchesterEventReset,
&manchester_saved_state,
NULL);
FProtoGeneral::manchester_advance(manchester_saved_state, ManchesterEventReset, &manchester_saved_state, NULL);
} else {
parser_step = Oregon_V1DecoderStepReset;
}
}
if (event != ManchesterEventReset) {
bool data;
bool data_ok = manchester_advance(
manchester_saved_state, event, &manchester_saved_state, &data);
bool bit;
bool data_ok = FProtoGeneral::manchester_advance(manchester_saved_state, event, &manchester_saved_state, &bit);
if (data_ok) {
decode_data = (decode_data << 1) | !data;
decode_data = (decode_data << 1) | !bit;
decode_count_bit++;
}
}
@@ -149,13 +140,13 @@ class FProtoWeatherOregonV1 : public FProtoWeatherBase {
bool ws_protocol_oregon_v1_check() {
if (!decode_data) return false;
uint64_t data = subghz_protocol_blocks_reverse_key(decode_data, 32);
uint64_t data = FProtoGeneral::subghz_protocol_blocks_reverse_key(decode_data, 32);
uint16_t crc = (data & 0xff) + ((data >> 8) & 0xff) + ((data >> 16) & 0xff);
crc = (crc & 0xff) + ((crc >> 8) & 0xff);
return (crc == ((data >> 24) & 0xFF));
}
void ws_protocol_oregon_v1_remote_controller() {
uint64_t data2 = subghz_protocol_blocks_reverse_key(data, 32);
uint64_t data2 = FProtoGeneral::subghz_protocol_blocks_reverse_key(data, 32);
id = data2 & 0xFF;
channel = ((data2 >> 6) & 0x03) + 1;