Proto: bett

This commit is contained in:
HTotoo
2023-12-09 19:34:00 +01:00
parent 39fabab022
commit db4083f684
7 changed files with 115 additions and 9 deletions
+6 -1
View File
@@ -37,6 +37,9 @@ void SubGhzDRecentEntryDetailView::update_data() {
text_id.set("0x" + to_string_hex(entry_.serial));
if (entry_.bits > 0) console.writeln("Bits: " + to_string_dec_uint(entry_.bits));
if (entry_.btn != SD_NO_BTN) console.writeln("Btn: " + to_string_dec_uint(entry_.btn));
if (entry_.data != 0) console.writeln("Data: " + to_string_dec_uint(entry_.data));
if (entry_.data_2 != 0) console.writeln("Data2: " + to_string_dec_uint(entry_.data_2));
}
SubGhzDRecentEntryDetailView::SubGhzDRecentEntryDetailView(NavigationView& nav, const SubGhzDRecentEntry& entry)
@@ -101,7 +104,7 @@ void SubGhzDView::on_tick_second() {
}
void SubGhzDView::on_data(const SubGhzDDataMessage* data) {
SubGhzDRecentEntry key{data->sensorType, data->serial, data->bits, data->btn};
SubGhzDRecentEntry key{data->sensorType, data->serial, data->bits, data->data, data->data_2, data->btn};
auto matching_recent = find(recent, key.key());
if (matching_recent != std::end(recent)) {
// Found within. Move to front of list, increment counter.
@@ -127,6 +130,8 @@ const char* SubGhzDView::getSensorTypeName(FPROTO_SUBGHZD_SENSOR type) {
return "Ansonic";
case FPS_PRINCETON:
return "Princeton";
case FPS_BETT:
return "Bett";
case FPS_Invalid:
default:
return "Unknown";
+7 -2
View File
@@ -46,17 +46,22 @@ struct SubGhzDRecentEntry {
uint16_t bits = 0;
uint8_t btn = SD_NO_BTN;
uint16_t age = 0; // updated on each seconds, show how long the signal was last seen
uint32_t data = 0;
uint32_t data_2 = 0;
SubGhzDRecentEntry() {}
SubGhzDRecentEntry(
uint8_t sensorType,
uint32_t serial,
uint16_t bits = 0,
uint32_t data = 0,
uint32_t data_2 = 0,
uint8_t btn = SD_NO_BTN)
: sensorType{sensorType},
serial{serial},
bits{bits},
btn{btn} {
btn{btn},
data{data},
data_2{data_2} {
}
Key key() const {
return (static_cast<uint64_t>(serial) << 32) |