mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
subghz: add treadmill37 protocol
This commit is contained in:
@@ -78,6 +78,7 @@ That list is only for default SubGHz app, apps like *Weather Station* have their
|
|||||||
- Princeton (PT2262, PT****) `315MHz, 433.92MHz, Any other frequency` `AM650` (24 bits, Static)
|
- Princeton (PT2262, PT****) `315MHz, 433.92MHz, Any other frequency` `AM650` (24 bits, Static)
|
||||||
- SMC5326 `315MHz, 433.92MHz, Any other frequency` `AM650` (25 bits, Static)
|
- SMC5326 `315MHz, 433.92MHz, Any other frequency` `AM650` (25 bits, Static)
|
||||||
- Hay21 `433.92MHz` `AM650` (21 bits, Dynamic)
|
- Hay21 `433.92MHz` `AM650` (21 bits, Dynamic)
|
||||||
|
- Treadmill37 (QH-433) `433.92MHz` `AM650` (37 bits, Static)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const SubGhzProtocol* const subghz_protocol_registry_items[] = {
|
|||||||
&subghz_protocol_marantec24, &subghz_protocol_hollarm,
|
&subghz_protocol_marantec24, &subghz_protocol_hollarm,
|
||||||
&subghz_protocol_hay21, &subghz_protocol_revers_rb2,
|
&subghz_protocol_hay21, &subghz_protocol_revers_rb2,
|
||||||
&subghz_protocol_feron, &subghz_protocol_roger,
|
&subghz_protocol_feron, &subghz_protocol_roger,
|
||||||
&subghz_protocol_elplast,
|
&subghz_protocol_elplast, &subghz_protocol_treadmill37,
|
||||||
};
|
};
|
||||||
|
|
||||||
const SubGhzProtocolRegistry subghz_protocol_registry = {
|
const SubGhzProtocolRegistry subghz_protocol_registry = {
|
||||||
|
|||||||
@@ -53,3 +53,4 @@
|
|||||||
#include "feron.h"
|
#include "feron.h"
|
||||||
#include "roger.h"
|
#include "roger.h"
|
||||||
#include "elplast.h"
|
#include "elplast.h"
|
||||||
|
#include "treadmill37.h"
|
||||||
|
|||||||
349
lib/subghz/protocols/treadmill37.c
Normal file
349
lib/subghz/protocols/treadmill37.c
Normal file
@@ -0,0 +1,349 @@
|
|||||||
|
#include "treadmill37.h"
|
||||||
|
#include "../blocks/const.h"
|
||||||
|
#include "../blocks/decoder.h"
|
||||||
|
#include "../blocks/encoder.h"
|
||||||
|
#include "../blocks/generic.h"
|
||||||
|
#include "../blocks/math.h"
|
||||||
|
|
||||||
|
#define TAG "SubGhzProtocolTreadmill37"
|
||||||
|
|
||||||
|
static const SubGhzBlockConst subghz_protocol_treadmill37_const = {
|
||||||
|
.te_short = 300,
|
||||||
|
.te_long = 900,
|
||||||
|
.te_delta = 150,
|
||||||
|
.min_count_bit_for_found = 37,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SubGhzProtocolDecoderTreadmill37 {
|
||||||
|
SubGhzProtocolDecoderBase base;
|
||||||
|
|
||||||
|
SubGhzBlockDecoder decoder;
|
||||||
|
SubGhzBlockGeneric generic;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SubGhzProtocolEncoderTreadmill37 {
|
||||||
|
SubGhzProtocolEncoderBase base;
|
||||||
|
|
||||||
|
SubGhzProtocolBlockEncoder encoder;
|
||||||
|
SubGhzBlockGeneric generic;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
Treadmill37DecoderStepReset = 0,
|
||||||
|
Treadmill37DecoderStepSaveDuration,
|
||||||
|
Treadmill37DecoderStepCheckDuration,
|
||||||
|
} Treadmill37DecoderStep;
|
||||||
|
|
||||||
|
const SubGhzProtocolDecoder subghz_protocol_treadmill37_decoder = {
|
||||||
|
.alloc = subghz_protocol_decoder_treadmill37_alloc,
|
||||||
|
.free = subghz_protocol_decoder_treadmill37_free,
|
||||||
|
|
||||||
|
.feed = subghz_protocol_decoder_treadmill37_feed,
|
||||||
|
.reset = subghz_protocol_decoder_treadmill37_reset,
|
||||||
|
|
||||||
|
.get_hash_data = subghz_protocol_decoder_treadmill37_get_hash_data,
|
||||||
|
.serialize = subghz_protocol_decoder_treadmill37_serialize,
|
||||||
|
.deserialize = subghz_protocol_decoder_treadmill37_deserialize,
|
||||||
|
.get_string = subghz_protocol_decoder_treadmill37_get_string,
|
||||||
|
};
|
||||||
|
|
||||||
|
const SubGhzProtocolEncoder subghz_protocol_treadmill37_encoder = {
|
||||||
|
.alloc = subghz_protocol_encoder_treadmill37_alloc,
|
||||||
|
.free = subghz_protocol_encoder_treadmill37_free,
|
||||||
|
|
||||||
|
.deserialize = subghz_protocol_encoder_treadmill37_deserialize,
|
||||||
|
.stop = subghz_protocol_encoder_treadmill37_stop,
|
||||||
|
.yield = subghz_protocol_encoder_treadmill37_yield,
|
||||||
|
};
|
||||||
|
|
||||||
|
const SubGhzProtocol subghz_protocol_treadmill37 = {
|
||||||
|
.name = SUBGHZ_PROTOCOL_TREADMILL37_NAME,
|
||||||
|
.type = SubGhzProtocolTypeStatic,
|
||||||
|
.flag = SubGhzProtocolFlag_433 | SubGhzProtocolFlag_AM | SubGhzProtocolFlag_Decodable |
|
||||||
|
SubGhzProtocolFlag_Load | SubGhzProtocolFlag_Save | SubGhzProtocolFlag_Send,
|
||||||
|
|
||||||
|
.decoder = &subghz_protocol_treadmill37_decoder,
|
||||||
|
.encoder = &subghz_protocol_treadmill37_encoder,
|
||||||
|
};
|
||||||
|
|
||||||
|
void* subghz_protocol_encoder_treadmill37_alloc(SubGhzEnvironment* environment) {
|
||||||
|
UNUSED(environment);
|
||||||
|
SubGhzProtocolEncoderTreadmill37* instance = malloc(sizeof(SubGhzProtocolEncoderTreadmill37));
|
||||||
|
|
||||||
|
instance->base.protocol = &subghz_protocol_treadmill37;
|
||||||
|
instance->generic.protocol_name = instance->base.protocol->name;
|
||||||
|
|
||||||
|
instance->encoder.repeat = 10;
|
||||||
|
instance->encoder.size_upload = 256;
|
||||||
|
instance->encoder.upload = malloc(instance->encoder.size_upload * sizeof(LevelDuration));
|
||||||
|
instance->encoder.is_running = false;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void subghz_protocol_encoder_treadmill37_free(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolEncoderTreadmill37* instance = context;
|
||||||
|
free(instance->encoder.upload);
|
||||||
|
free(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generating an upload from data.
|
||||||
|
* @param instance Pointer to a SubGhzProtocolEncoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
subghz_protocol_encoder_treadmill37_get_upload(SubGhzProtocolEncoderTreadmill37* instance) {
|
||||||
|
furi_assert(instance);
|
||||||
|
size_t index = 0;
|
||||||
|
|
||||||
|
// Send key and GAP
|
||||||
|
for(uint8_t i = instance->generic.data_count_bit; i > 0; i--) {
|
||||||
|
if(bit_read(instance->generic.data, i - 1)) {
|
||||||
|
// Send bit 1
|
||||||
|
instance->encoder.upload[index++] =
|
||||||
|
level_duration_make(true, (uint32_t)subghz_protocol_treadmill37_const.te_long);
|
||||||
|
if(i == 1) {
|
||||||
|
//Send gap if bit was last
|
||||||
|
instance->encoder.upload[index++] = level_duration_make(
|
||||||
|
false, (uint32_t)subghz_protocol_treadmill37_const.te_short * 20);
|
||||||
|
} else {
|
||||||
|
instance->encoder.upload[index++] = level_duration_make(
|
||||||
|
false, (uint32_t)subghz_protocol_treadmill37_const.te_short);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Send bit 0
|
||||||
|
instance->encoder.upload[index++] =
|
||||||
|
level_duration_make(true, (uint32_t)subghz_protocol_treadmill37_const.te_short);
|
||||||
|
if(i == 1) {
|
||||||
|
//Send gap if bit was last
|
||||||
|
instance->encoder.upload[index++] = level_duration_make(
|
||||||
|
false, (uint32_t)subghz_protocol_treadmill37_const.te_short * 20);
|
||||||
|
} else {
|
||||||
|
instance->encoder.upload[index++] = level_duration_make(
|
||||||
|
false, (uint32_t)subghz_protocol_treadmill37_const.te_long);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
instance->encoder.size_upload = index;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Analysis of received data
|
||||||
|
* @param instance Pointer to a SubGhzBlockGeneric* instance
|
||||||
|
*/
|
||||||
|
static void subghz_protocol_treadmill37_check_remote_controller(SubGhzBlockGeneric* instance) {
|
||||||
|
instance->serial = instance->data >> 17;
|
||||||
|
instance->cnt = (instance->data >> 1) & 0xFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
SubGhzProtocolStatus
|
||||||
|
subghz_protocol_encoder_treadmill37_deserialize(void* context, FlipperFormat* flipper_format) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolEncoderTreadmill37* instance = context;
|
||||||
|
SubGhzProtocolStatus ret = SubGhzProtocolStatusError;
|
||||||
|
do {
|
||||||
|
ret = subghz_block_generic_deserialize_check_count_bit(
|
||||||
|
&instance->generic,
|
||||||
|
flipper_format,
|
||||||
|
subghz_protocol_treadmill37_const.min_count_bit_for_found);
|
||||||
|
if(ret != SubGhzProtocolStatusOk) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//optional parameter parameter
|
||||||
|
flipper_format_read_uint32(
|
||||||
|
flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);
|
||||||
|
|
||||||
|
subghz_protocol_treadmill37_check_remote_controller(&instance->generic);
|
||||||
|
subghz_protocol_encoder_treadmill37_get_upload(instance);
|
||||||
|
instance->encoder.is_running = true;
|
||||||
|
} while(false);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void subghz_protocol_encoder_treadmill37_stop(void* context) {
|
||||||
|
SubGhzProtocolEncoderTreadmill37* instance = context;
|
||||||
|
instance->encoder.is_running = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LevelDuration subghz_protocol_encoder_treadmill37_yield(void* context) {
|
||||||
|
SubGhzProtocolEncoderTreadmill37* instance = context;
|
||||||
|
|
||||||
|
if(instance->encoder.repeat == 0 || !instance->encoder.is_running) {
|
||||||
|
instance->encoder.is_running = false;
|
||||||
|
return level_duration_reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
LevelDuration ret = instance->encoder.upload[instance->encoder.front];
|
||||||
|
|
||||||
|
if(++instance->encoder.front == instance->encoder.size_upload) {
|
||||||
|
instance->encoder.repeat--;
|
||||||
|
instance->encoder.front = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* subghz_protocol_decoder_treadmill37_alloc(SubGhzEnvironment* environment) {
|
||||||
|
UNUSED(environment);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = malloc(sizeof(SubGhzProtocolDecoderTreadmill37));
|
||||||
|
instance->base.protocol = &subghz_protocol_treadmill37;
|
||||||
|
instance->generic.protocol_name = instance->base.protocol->name;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void subghz_protocol_decoder_treadmill37_free(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
free(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
void subghz_protocol_decoder_treadmill37_reset(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepReset;
|
||||||
|
}
|
||||||
|
|
||||||
|
void subghz_protocol_decoder_treadmill37_feed(
|
||||||
|
void* context,
|
||||||
|
bool level,
|
||||||
|
volatile uint32_t duration) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
|
||||||
|
// Treadmill37 (QH-433) Decoder
|
||||||
|
// 2026 - @xMasterX (MMX)
|
||||||
|
|
||||||
|
// Key samples
|
||||||
|
// serial button stop
|
||||||
|
// 1800001830 = 00011000000000000000000 0000110000011000 0
|
||||||
|
// 180000061E = 00011000000000000000000 0000001100001111 0
|
||||||
|
// 180000142C = 00011000000000000000000 0000101000010110 0
|
||||||
|
// 1800000C24 = 00011000000000000000000 0000011000010010 0
|
||||||
|
// 180001556C = 00011000000000000000000 1010101010110110 0
|
||||||
|
// 180001334A = 00011000000000000000000 1001100110100101 0
|
||||||
|
|
||||||
|
switch(instance->decoder.parser_step) {
|
||||||
|
case Treadmill37DecoderStepReset:
|
||||||
|
if((!level) && (DURATION_DIFF(duration, subghz_protocol_treadmill37_const.te_short * 20) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta * 4)) {
|
||||||
|
//Found GAP
|
||||||
|
instance->decoder.decode_data = 0;
|
||||||
|
instance->decoder.decode_count_bit = 0;
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepSaveDuration;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Treadmill37DecoderStepSaveDuration:
|
||||||
|
if(level) {
|
||||||
|
instance->decoder.te_last = duration;
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepCheckDuration;
|
||||||
|
} else {
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepReset;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Treadmill37DecoderStepCheckDuration:
|
||||||
|
if(!level) {
|
||||||
|
// Bit 0 is short and long timing = 300us HIGH (te_last) and 900us LOW
|
||||||
|
if((DURATION_DIFF(
|
||||||
|
instance->decoder.te_last, subghz_protocol_treadmill37_const.te_short) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta) &&
|
||||||
|
(DURATION_DIFF(duration, subghz_protocol_treadmill37_const.te_long) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta)) {
|
||||||
|
subghz_protocol_blocks_add_bit(&instance->decoder, 0);
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepSaveDuration;
|
||||||
|
// Bit 1 is long and short timing = 900us HIGH (te_last) and 300us LOW
|
||||||
|
} else if(
|
||||||
|
(DURATION_DIFF(
|
||||||
|
instance->decoder.te_last, subghz_protocol_treadmill37_const.te_long) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta) &&
|
||||||
|
(DURATION_DIFF(duration, subghz_protocol_treadmill37_const.te_short) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta)) {
|
||||||
|
subghz_protocol_blocks_add_bit(&instance->decoder, 1);
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepSaveDuration;
|
||||||
|
} else if(
|
||||||
|
// End of the key
|
||||||
|
DURATION_DIFF(duration, subghz_protocol_treadmill37_const.te_short * 20) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta * 4) {
|
||||||
|
//Found next GAP and add bit 0 or 1 (only bit 0 was found on the remotes)
|
||||||
|
if((DURATION_DIFF(
|
||||||
|
instance->decoder.te_last, subghz_protocol_treadmill37_const.te_short) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta)) {
|
||||||
|
subghz_protocol_blocks_add_bit(&instance->decoder, 0);
|
||||||
|
}
|
||||||
|
if((DURATION_DIFF(
|
||||||
|
instance->decoder.te_last, subghz_protocol_treadmill37_const.te_long) <
|
||||||
|
subghz_protocol_treadmill37_const.te_delta)) {
|
||||||
|
subghz_protocol_blocks_add_bit(&instance->decoder, 1);
|
||||||
|
}
|
||||||
|
// If got 37 bits key reading is finished
|
||||||
|
if(instance->decoder.decode_count_bit ==
|
||||||
|
subghz_protocol_treadmill37_const.min_count_bit_for_found) {
|
||||||
|
instance->generic.data = instance->decoder.decode_data;
|
||||||
|
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
|
||||||
|
if(instance->base.callback)
|
||||||
|
instance->base.callback(&instance->base, instance->base.context);
|
||||||
|
}
|
||||||
|
instance->decoder.decode_data = 0;
|
||||||
|
instance->decoder.decode_count_bit = 0;
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepReset;
|
||||||
|
} else {
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepReset;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
instance->decoder.parser_step = Treadmill37DecoderStepReset;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t subghz_protocol_decoder_treadmill37_get_hash_data(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
return subghz_protocol_blocks_get_hash_data(
|
||||||
|
&instance->decoder, (instance->decoder.decode_count_bit / 8) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
SubGhzProtocolStatus subghz_protocol_decoder_treadmill37_serialize(
|
||||||
|
void* context,
|
||||||
|
FlipperFormat* flipper_format,
|
||||||
|
SubGhzRadioPreset* preset) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
|
||||||
|
}
|
||||||
|
|
||||||
|
SubGhzProtocolStatus
|
||||||
|
subghz_protocol_decoder_treadmill37_deserialize(void* context, FlipperFormat* flipper_format) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
return subghz_block_generic_deserialize_check_count_bit(
|
||||||
|
&instance->generic,
|
||||||
|
flipper_format,
|
||||||
|
subghz_protocol_treadmill37_const.min_count_bit_for_found);
|
||||||
|
}
|
||||||
|
|
||||||
|
void subghz_protocol_decoder_treadmill37_get_string(void* context, FuriString* output) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzProtocolDecoderTreadmill37* instance = context;
|
||||||
|
|
||||||
|
subghz_protocol_treadmill37_check_remote_controller(&instance->generic);
|
||||||
|
|
||||||
|
uint64_t code_found_reverse = subghz_protocol_blocks_reverse_key(
|
||||||
|
instance->generic.data, instance->generic.data_count_bit);
|
||||||
|
|
||||||
|
furi_string_cat_printf(
|
||||||
|
output,
|
||||||
|
"%s %db\r\n"
|
||||||
|
"Key: 0x%08llX\r\n"
|
||||||
|
"Yek: 0x%08llX\r\n"
|
||||||
|
"Serial: 0x%06lX\r\n"
|
||||||
|
"Btn: %04lX",
|
||||||
|
instance->generic.protocol_name,
|
||||||
|
instance->generic.data_count_bit,
|
||||||
|
(uint64_t)(instance->generic.data & 0xFFFFFFFFFF),
|
||||||
|
(code_found_reverse & 0xFFFFFFFFFF),
|
||||||
|
instance->generic.serial,
|
||||||
|
instance->generic.cnt);
|
||||||
|
}
|
||||||
109
lib/subghz/protocols/treadmill37.h
Normal file
109
lib/subghz/protocols/treadmill37.h
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "base.h"
|
||||||
|
|
||||||
|
#define SUBGHZ_PROTOCOL_TREADMILL37_NAME "Treadmill37"
|
||||||
|
|
||||||
|
typedef struct SubGhzProtocolDecoderTreadmill37 SubGhzProtocolDecoderTreadmill37;
|
||||||
|
typedef struct SubGhzProtocolEncoderTreadmill37 SubGhzProtocolEncoderTreadmill37;
|
||||||
|
|
||||||
|
extern const SubGhzProtocolDecoder subghz_protocol_treadmill37_decoder;
|
||||||
|
extern const SubGhzProtocolEncoder subghz_protocol_treadmill37_encoder;
|
||||||
|
extern const SubGhzProtocol subghz_protocol_treadmill37;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate SubGhzProtocolEncoderTreadmill37.
|
||||||
|
* @param environment Pointer to a SubGhzEnvironment instance
|
||||||
|
* @return SubGhzProtocolEncoderTreadmill37* pointer to a SubGhzProtocolEncoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
void* subghz_protocol_encoder_treadmill37_alloc(SubGhzEnvironment* environment);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free SubGhzProtocolEncoderTreadmill37.
|
||||||
|
* @param context Pointer to a SubGhzProtocolEncoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
void subghz_protocol_encoder_treadmill37_free(void* context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserialize and generating an upload to send.
|
||||||
|
* @param context Pointer to a SubGhzProtocolEncoderTreadmill37 instance
|
||||||
|
* @param flipper_format Pointer to a FlipperFormat instance
|
||||||
|
* @return status
|
||||||
|
*/
|
||||||
|
SubGhzProtocolStatus
|
||||||
|
subghz_protocol_encoder_treadmill37_deserialize(void* context, FlipperFormat* flipper_format);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forced transmission stop.
|
||||||
|
* @param context Pointer to a SubGhzProtocolEncoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
void subghz_protocol_encoder_treadmill37_stop(void* context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getting the level and duration of the upload to be loaded into DMA.
|
||||||
|
* @param context Pointer to a SubGhzProtocolEncoderTreadmill37 instance
|
||||||
|
* @return LevelDuration
|
||||||
|
*/
|
||||||
|
LevelDuration subghz_protocol_encoder_treadmill37_yield(void* context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate SubGhzProtocolDecoderTreadmill37.
|
||||||
|
* @param environment Pointer to a SubGhzEnvironment instance
|
||||||
|
* @return SubGhzProtocolDecoderTreadmill37* pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
void* subghz_protocol_decoder_treadmill37_alloc(SubGhzEnvironment* environment);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free SubGhzProtocolDecoderTreadmill37.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
void subghz_protocol_decoder_treadmill37_free(void* context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset decoder SubGhzProtocolDecoderTreadmill37.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
*/
|
||||||
|
void subghz_protocol_decoder_treadmill37_reset(void* context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a raw sequence of levels and durations received from the air.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
* @param level Signal level true-high false-low
|
||||||
|
* @param duration Duration of this level in, us
|
||||||
|
*/
|
||||||
|
void subghz_protocol_decoder_treadmill37_feed(void* context, bool level, uint32_t duration);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getting the hash sum of the last randomly received parcel.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
* @return hash Hash sum
|
||||||
|
*/
|
||||||
|
uint8_t subghz_protocol_decoder_treadmill37_get_hash_data(void* context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize data SubGhzProtocolDecoderTreadmill37.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
* @param flipper_format Pointer to a FlipperFormat instance
|
||||||
|
* @param preset The modulation on which the signal was received, SubGhzRadioPreset
|
||||||
|
* @return status
|
||||||
|
*/
|
||||||
|
SubGhzProtocolStatus subghz_protocol_decoder_treadmill37_serialize(
|
||||||
|
void* context,
|
||||||
|
FlipperFormat* flipper_format,
|
||||||
|
SubGhzRadioPreset* preset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserialize data SubGhzProtocolDecoderTreadmill37.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
* @param flipper_format Pointer to a FlipperFormat instance
|
||||||
|
* @return status
|
||||||
|
*/
|
||||||
|
SubGhzProtocolStatus
|
||||||
|
subghz_protocol_decoder_treadmill37_deserialize(void* context, FlipperFormat* flipper_format);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getting a textual representation of the received data.
|
||||||
|
* @param context Pointer to a SubGhzProtocolDecoderTreadmill37 instance
|
||||||
|
* @param output Resulting text
|
||||||
|
*/
|
||||||
|
void subghz_protocol_decoder_treadmill37_get_string(void* context, FuriString* output);
|
||||||
Reference in New Issue
Block a user