mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 05:48:08 +03:00
712a48b5db
* fix typo across subghz Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
52 lines
1.3 KiB
C
52 lines
1.3 KiB
C
#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"
|
|
#include "../types.h"
|
|
|
|
typedef struct SubGhzBlockGeneric SubGhzBlockGeneric;
|
|
|
|
struct SubGhzBlockGeneric {
|
|
const char* protocol_name;
|
|
uint64_t data;
|
|
uint64_t data_2;
|
|
uint32_t serial;
|
|
uint8_t data_count_bit;
|
|
uint8_t btn;
|
|
uint32_t cnt;
|
|
uint8_t cnt_2;
|
|
uint32_t seed;
|
|
};
|
|
|
|
/**
|
|
* Get name preset.
|
|
* @param preset_name name preset
|
|
* @param preset_str Output name preset
|
|
*/
|
|
void subghz_block_generic_get_preset_name(const char* preset_name, string_t preset_str);
|
|
|
|
/**
|
|
* Serialize data SubGhzBlockGeneric.
|
|
* @param instance Pointer to a SubGhzBlockGeneric instance
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
|
|
* @return true On success
|
|
*/
|
|
bool subghz_block_generic_serialize(
|
|
SubGhzBlockGeneric* instance,
|
|
FlipperFormat* flipper_format,
|
|
SubGhzPresetDefinition* preset);
|
|
|
|
/**
|
|
* Deserialize data SubGhzBlockGeneric.
|
|
* @param instance Pointer to a SubGhzBlockGeneric instance
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
* @return true On success
|
|
*/
|
|
bool subghz_block_generic_deserialize(SubGhzBlockGeneric* instance, FlipperFormat* flipper_format);
|