mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 04:53:08 +00:00
ffa3996a5e
* clang-format: AllowShortEnumsOnASingleLine: false * clang-format: InsertNewlineAtEOF: true * clang-format: Standard: c++20 * clang-format: AlignConsecutiveBitFields * clang-format: AlignConsecutiveMacros * clang-format: RemoveParentheses: ReturnStatement * clang-format: RemoveSemicolon: true * Restored RemoveParentheses: Leave, retained general changes for it * formatting: fixed logging TAGs * Formatting update for dev Co-authored-by: あく <alleteam@gmail.com>
69 lines
1.8 KiB
C
69 lines
1.8 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"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct SubGhzBlockGeneric SubGhzBlockGeneric;
|
|
|
|
struct SubGhzBlockGeneric {
|
|
const char* protocol_name;
|
|
uint64_t data;
|
|
uint32_t serial;
|
|
uint16_t data_count_bit;
|
|
uint8_t btn;
|
|
uint32_t cnt;
|
|
};
|
|
|
|
/**
|
|
* 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, FuriString* 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, SubGhzRadioPreset
|
|
* @return Status Error
|
|
*/
|
|
SubGhzProtocolStatus subghz_block_generic_serialize(
|
|
SubGhzBlockGeneric* instance,
|
|
FlipperFormat* flipper_format,
|
|
SubGhzRadioPreset* preset);
|
|
|
|
/**
|
|
* Deserialize data SubGhzBlockGeneric.
|
|
* @param instance Pointer to a SubGhzBlockGeneric instance
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
* @return Status Error
|
|
*/
|
|
SubGhzProtocolStatus
|
|
subghz_block_generic_deserialize(SubGhzBlockGeneric* instance, FlipperFormat* flipper_format);
|
|
|
|
/**
|
|
* Deserialize data SubGhzBlockGeneric.
|
|
* @param instance Pointer to a SubGhzBlockGeneric instance
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
* @param count_bit Count bit protocol
|
|
* @return Status Error
|
|
*/
|
|
SubGhzProtocolStatus subghz_block_generic_deserialize_check_count_bit(
|
|
SubGhzBlockGeneric* instance,
|
|
FlipperFormat* flipper_format,
|
|
uint16_t count_bit);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|