2022-03-03 09:48:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
#include <lib/flipper_format/flipper_format.h>
|
|
|
|
#include "furi.h"
|
|
|
|
#include "furi_hal.h"
|
2022-07-26 14:16:59 +00:00
|
|
|
#include "../types.h"
|
2022-03-03 09:48:56 +00:00
|
|
|
|
|
|
|
typedef struct SubGhzBlockGeneric SubGhzBlockGeneric;
|
|
|
|
|
|
|
|
struct SubGhzBlockGeneric {
|
|
|
|
const char* protocol_name;
|
|
|
|
uint64_t data;
|
|
|
|
uint32_t serial;
|
|
|
|
uint8_t data_count_bit;
|
|
|
|
uint8_t btn;
|
2022-05-04 22:44:15 +00:00
|
|
|
uint32_t cnt;
|
2022-03-03 09:48:56 +00:00
|
|
|
};
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
2022-07-26 14:16:59 +00:00
|
|
|
* Get name preset.
|
|
|
|
* @param preset_name name preset
|
|
|
|
* @param preset_str Output name preset
|
2022-03-16 09:18:48 +00:00
|
|
|
*/
|
2022-07-26 14:16:59 +00:00
|
|
|
void subghz_block_generic_get_preset_name(const char* preset_name, string_t preset_str);
|
2022-03-03 09:48:56 +00:00
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Serialize data SubGhzBlockGeneric.
|
|
|
|
* @param instance Pointer to a SubGhzBlockGeneric instance
|
|
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
2022-07-26 14:16:59 +00:00
|
|
|
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
|
2022-03-16 09:18:48 +00:00
|
|
|
* @return true On success
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
bool subghz_block_generic_serialize(
|
|
|
|
SubGhzBlockGeneric* instance,
|
|
|
|
FlipperFormat* flipper_format,
|
2022-07-26 14:16:59 +00:00
|
|
|
SubGhzPesetDefinition* preset);
|
2022-03-03 09:48:56 +00:00
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Deserialize data SubGhzBlockGeneric.
|
|
|
|
* @param instance Pointer to a SubGhzBlockGeneric instance
|
|
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
|
|
* @return true On success
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
bool subghz_block_generic_deserialize(SubGhzBlockGeneric* instance, FlipperFormat* flipper_format);
|