mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-21 04:11:48 +03:00
9a9abd59e9
* WeatherStation: start * SubGhz: rename protocol magellen -> magellan * WeatherStation: err Unresolved symbols: {'subghz_protocol_decoder_base_get_string'} * WeatherStation: fix Unresolved symbols: {'subghz_protocol_decoder_base_get_string'} * Subghz: add set protocol_items * WeatherStation: adding your protocols * WS: add Infactory protocol * WS: add history * WS: add setting * WS: add lock * WS: add hopper frequency * WS: fix history * WS fix string_t -> FuriString* * WS: add images * WS: history record update when receiving data from the sensor again * WS: add receiver info, delete extra code * WS: add protocol ThermoPRO_TX4 * [FL-2900] SubGhz: Move icons in Sub-GHz * WS: add Notification * [FL-2890] SubGhz: Rename *_user files in resources to _user.example * WS: add about scene * WS: removing redundant code * WS: add protocol Nexus-TH * WS: add protocol GT_WT03 * WS: fix notification and rename "Weather Station" -> "Read Weather Station" * SubGhz: partial unit tests fix * SubGhz: fix unit_test * SubGhz: remove dead code * SubGhz: rename SubGhzPresetDefinition into SubGhzRadioPreset, cleanup subghz types. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
89 lines
2.5 KiB
C
89 lines
2.5 KiB
C
#pragma once
|
|
|
|
#include "../types.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct SubGhzProtocolDecoderBase SubGhzProtocolDecoderBase;
|
|
|
|
typedef void (
|
|
*SubGhzProtocolDecoderBaseRxCallback)(SubGhzProtocolDecoderBase* instance, void* context);
|
|
|
|
typedef void (*SubGhzProtocolDecoderBaseSerialize)(
|
|
SubGhzProtocolDecoderBase* decoder_base,
|
|
FuriString* output);
|
|
|
|
struct SubGhzProtocolDecoderBase {
|
|
// Decoder general section
|
|
const SubGhzProtocol* protocol;
|
|
|
|
// Callback section
|
|
SubGhzProtocolDecoderBaseRxCallback callback;
|
|
void* context;
|
|
};
|
|
|
|
/**
|
|
* Set a callback upon completion of successful decoding of one of the protocols.
|
|
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
|
|
* @param callback Callback, SubGhzProtocolDecoderBaseRxCallback
|
|
* @param context Context
|
|
*/
|
|
void subghz_protocol_decoder_base_set_decoder_callback(
|
|
SubGhzProtocolDecoderBase* decoder_base,
|
|
SubGhzProtocolDecoderBaseRxCallback callback,
|
|
void* context);
|
|
|
|
/**
|
|
* Getting a textual representation of the received data.
|
|
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
|
|
* @param output Resulting text
|
|
*/
|
|
bool subghz_protocol_decoder_base_get_string(
|
|
SubGhzProtocolDecoderBase* decoder_base,
|
|
FuriString* output);
|
|
|
|
/**
|
|
* Serialize data SubGhzProtocolDecoderBase.
|
|
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
* @param preset The modulation on which the signal was received, SubGhzRadioPreset
|
|
* @return true On success
|
|
*/
|
|
bool subghz_protocol_decoder_base_serialize(
|
|
SubGhzProtocolDecoderBase* decoder_base,
|
|
FlipperFormat* flipper_format,
|
|
SubGhzRadioPreset* preset);
|
|
|
|
/**
|
|
* Deserialize data SubGhzProtocolDecoderBase.
|
|
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
* @return true On success
|
|
*/
|
|
bool subghz_protocol_decoder_base_deserialize(
|
|
SubGhzProtocolDecoderBase* decoder_base,
|
|
FlipperFormat* flipper_format);
|
|
|
|
/**
|
|
* Getting the hash sum of the last randomly received parcel.
|
|
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
|
|
* @return hash Hash sum
|
|
*/
|
|
uint8_t subghz_protocol_decoder_base_get_hash_data(SubGhzProtocolDecoderBase* decoder_base);
|
|
|
|
// Encoder Base
|
|
typedef struct SubGhzProtocolEncoderBase SubGhzProtocolEncoderBase;
|
|
|
|
struct SubGhzProtocolEncoderBase {
|
|
// Decoder general section
|
|
const SubGhzProtocol* protocol;
|
|
|
|
// Callback section
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|