SubGhz: refactoring add descriptions (#1012)

* SubGhz: add descriptions
* SubGhz: fix syntax

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2022-03-16 13:18:48 +04:00
committed by GitHub
parent 28888b0a22
commit 94ba7d104c
54 changed files with 1732 additions and 185 deletions
+30
View File
@@ -19,25 +19,55 @@ struct SubGhzProtocolDecoderBase {
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,
string_t output);
/**
* Serialize data SubGhzProtocolDecoderBase.
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_base_serialize(
SubGhzProtocolDecoderBase* decoder_base,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset 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
+5
View File
@@ -95,6 +95,11 @@ void subghz_protocol_encoder_came_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderCame instance
* @return true On success
*/
static bool subghz_protocol_encoder_came_get_upload(SubGhzProtocolEncoderCame* instance) {
furi_assert(instance);
size_t index = 0;
+62 -16
View File
@@ -11,46 +11,81 @@ extern const SubGhzProtocolDecoder subghz_protocol_came_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_came_encoder;
extern const SubGhzProtocol subghz_protocol_came;
/**
* Allocate SubGhzProtocolEncoderCame.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderCame* pointer to a SubGhzProtocolEncoderCame instance
*/
void* subghz_protocol_encoder_came_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderCame.
* @param context Pointer to a SubGhzProtocolEncoderCame instance
*/
void subghz_protocol_encoder_came_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderCame instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_came_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderCame instance
*/
void subghz_protocol_encoder_came_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderCame instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_came_yield(void* context);
/** Allocate SubGhzProtocolCame
*
* @return SubGhzProtocolCame*
/**
* Allocate SubGhzProtocolDecoderCame.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderCame* pointer to a SubGhzProtocolDecoderCame instance
*/
void* subghz_protocol_decoder_came_alloc(SubGhzEnvironment* environment);
/** Free SubGhzProtocolCame
*
* @param instance
/**
* Free SubGhzProtocolDecoderCame.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
*/
void subghz_protocol_decoder_came_free(void* context);
/** Reset internal state
* @param instance - SubGhzProtocolCame instance
/**
* Reset decoder SubGhzProtocolDecoderCame.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
*/
void subghz_protocol_decoder_came_reset(void* context);
/** Parse accepted duration
*
* @param instance - SubGhzProtocolCame instance
* @param data - LevelDuration level_duration
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_came_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_came_get_hash_data(void* context);
/** Outputting information from the parser
*
* @param instance - SubGhzProtocolCame* instance
* @param output - output string
/**
* Serialize data SubGhzProtocolDecoderCame.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_came_serialize(
void* context,
@@ -58,6 +93,17 @@ bool subghz_protocol_decoder_came_serialize(
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderCame.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_came_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
* @param output Resulting text
*/
void subghz_protocol_decoder_came_get_string(void* context, string_t output);
+8 -7
View File
@@ -186,10 +186,10 @@ void subghz_protocol_decoder_came_atomo_feed(void* context, bool level, uint32_t
}
}
/** Read bytes from rainbow table
*
* @param file_name - file name rainbow table
* @param number_atomo_magic_xor
/**
* Read bytes from rainbow table
* @param file_name Full path to rainbow table the file
* @param number_atomo_magic_xor Сell number in the array
* @return atomo_magic_xor
*/
static uint64_t subghz_protocol_came_atomo_get_magic_xor_in_file(
@@ -211,9 +211,10 @@ static uint64_t subghz_protocol_came_atomo_get_magic_xor_in_file(
return atomo_magic_xor;
}
/** Analysis of received data
*
* @param instance SubGhzBlockGeneric instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param file_name Full path to rainbow table the file
*/
static void subghz_protocol_came_atomo_remote_controller(
SubGhzBlockGeneric* instance,
+50
View File
@@ -10,15 +10,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_came_atomo_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_came_atomo_encoder;
extern const SubGhzProtocol subghz_protocol_came_atomo;
/**
* Allocate SubGhzProtocolDecoderCameAtomo.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderCameAtomo* pointer to a SubGhzProtocolDecoderCameAtomo instance
*/
void* subghz_protocol_decoder_came_atomo_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderCameAtomo.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
*/
void subghz_protocol_decoder_came_atomo_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderCameAtomo.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
*/
void subghz_protocol_decoder_came_atomo_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_came_atomo_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_came_atomo_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderCameAtomo.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_came_atomo_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderCameAtomo.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_came_atomo_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
* @param output Resulting text
*/
void subghz_protocol_decoder_came_atomo_get_string(void* context, string_t output);
+10 -3
View File
@@ -22,6 +22,9 @@
(dip & 0x0008 ? '1' : '0'), (dip & 0x0004 ? '1' : '0'), (dip & 0x0002 ? '1' : '0'), \
(dip & 0x0001 ? '1' : '0')
/**
* Rainbow table Came Twee.
*/
static const uint32_t came_twee_magic_numbers_xor[15] = {
0x0E0E0E00,
0x1D1D1D11,
@@ -148,6 +151,10 @@ static LevelDuration
return level_duration_make(data.level, data.duration);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderCameTwee instance
*/
static void subghz_protocol_encoder_came_twee_get_upload(SubGhzProtocolEncoderCameTwee* instance) {
furi_assert(instance);
size_t index = 0;
@@ -182,9 +189,9 @@ static void subghz_protocol_encoder_came_twee_get_upload(SubGhzProtocolEncoderCa
instance->encoder.size_upload = index;
}
/** Analysis of received data
*
* @param instance SubGhzProtocolCameTwee instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_came_twee_remote_controller(SubGhzBlockGeneric* instance) {
/* Came Twee 54 bit, rolling code 15 parcels with
+79
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_came_twee_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_came_twee_encoder;
extern const SubGhzProtocol subghz_protocol_came_twee;
/**
* Allocate SubGhzProtocolEncoderCameTwee.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderCameTwee* pointer to a SubGhzProtocolEncoderCameTwee instance
*/
void* subghz_protocol_encoder_came_twee_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderCameTwee.
* @param context Pointer to a SubGhzProtocolEncoderCameTwee instance
*/
void subghz_protocol_encoder_came_twee_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderCameTwee instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_came_twee_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderCameTwee instance
*/
void subghz_protocol_encoder_came_twee_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderCameTwee instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_came_twee_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderCameTwee.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderCameTwee* pointer to a SubGhzProtocolDecoderCameTwee instance
*/
void* subghz_protocol_decoder_came_twee_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderCameTwee.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
*/
void subghz_protocol_decoder_came_twee_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderCameTwee.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
*/
void subghz_protocol_decoder_came_twee_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_came_twee_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_came_twee_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderCameTwee.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_came_twee_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderCameTwee.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_came_twee_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
* @param output Resulting text
*/
void subghz_protocol_decoder_came_twee_get_string(void* context, string_t output);
+4
View File
@@ -159,6 +159,10 @@ void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t d
}
}
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_faac_slh_check_remote_controller(SubGhzBlockGeneric* instance) {
uint64_t code_found_reverse =
subghz_protocol_blocks_reverse_key(instance->data, instance->data_count_bit);
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_faac_slh_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_faac_slh_encoder;
extern const SubGhzProtocol subghz_protocol_faac_slh;
/**
* Allocate SubGhzProtocolDecoderFaacSLH.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderFaacSLH* pointer to a SubGhzProtocolDecoderFaacSLH instance
*/
void* subghz_protocol_decoder_faac_slh_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderFaacSLH.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
*/
void subghz_protocol_decoder_faac_slh_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderFaacSLH.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
*/
void subghz_protocol_decoder_faac_slh_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_faac_slh_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderFaacSLH.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_faac_slh_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderFaacSLH.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
* @param output Resulting text
*/
void subghz_protocol_decoder_faac_slh_get_string(void* context, string_t output);
+9
View File
@@ -88,6 +88,11 @@ void subghz_protocol_encoder_gate_tx_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderGateTx instance
* @return true On success
*/
static bool subghz_protocol_encoder_gate_tx_get_upload(SubGhzProtocolEncoderGateTx* instance) {
furi_assert(instance);
size_t index = 0;
@@ -258,6 +263,10 @@ void subghz_protocol_decoder_gate_tx_feed(void* context, bool level, uint32_t du
}
}
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_gate_tx_check_remote_controller(SubGhzBlockGeneric* instance) {
uint32_t code_found_reverse =
subghz_protocol_blocks_reverse_key(instance->data, instance->data_count_bit);
+79
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_gate_tx_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_gate_tx_encoder;
extern const SubGhzProtocol subghz_protocol_gate_tx;
/**
* Allocate SubGhzProtocolEncoderGateTx.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderGateTx* pointer to a SubGhzProtocolEncoderGateTx instance
*/
void* subghz_protocol_encoder_gate_tx_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderGateTx.
* @param context Pointer to a SubGhzProtocolEncoderGateTx instance
*/
void subghz_protocol_encoder_gate_tx_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderGateTx instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_gate_tx_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderGateTx instance
*/
void subghz_protocol_encoder_gate_tx_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderGateTx instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_gate_tx_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderGateTx.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderGateTx* pointer to a SubGhzProtocolDecoderGateTx instance
*/
void* subghz_protocol_decoder_gate_tx_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderGateTx.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
*/
void subghz_protocol_decoder_gate_tx_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderGateTx.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
*/
void subghz_protocol_decoder_gate_tx_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_gate_tx_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_gate_tx_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderGateTx.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_gate_tx_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderGateTx.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_gate_tx_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
* @param output Resulting text
*/
void subghz_protocol_decoder_gate_tx_get_string(void* context, string_t output);
+9
View File
@@ -91,6 +91,11 @@ void subghz_protocol_encoder_hormann_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderHormann instance
* @return true On success
*/
static bool subghz_protocol_encoder_hormann_get_upload(SubGhzProtocolEncoderHormann* instance) {
furi_assert(instance);
@@ -285,6 +290,10 @@ void subghz_protocol_decoder_hormann_feed(void* context, bool level, uint32_t du
}
}
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_hormann_check_remote_controller(SubGhzBlockGeneric* instance) {
instance->btn = (instance->data >> 4) & 0xF;
}
+79
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_hormann_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_hormann_encoder;
extern const SubGhzProtocol subghz_protocol_hormann;
/**
* Allocate SubGhzProtocolEncoderHormann.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderHormann* pointer to a SubGhzProtocolEncoderHormann instance
*/
void* subghz_protocol_encoder_hormann_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderHormann.
* @param context Pointer to a SubGhzProtocolEncoderHormann instance
*/
void subghz_protocol_encoder_hormann_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderHormann instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_hormann_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderHormann instance
*/
void subghz_protocol_encoder_hormann_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderHormann instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_hormann_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderHormann.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderHormann* pointer to a SubGhzProtocolDecoderHormann instance
*/
void* subghz_protocol_decoder_hormann_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderHormann.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
*/
void subghz_protocol_decoder_hormann_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderHormann.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
*/
void subghz_protocol_decoder_hormann_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_hormann_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_hormann_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderHormann.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_hormann_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderHormann.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_hormann_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
* @param output Resulting text
*/
void subghz_protocol_decoder_hormann_get_string(void* context, string_t output);
+4
View File
@@ -158,6 +158,10 @@ void subghz_protocol_decoder_ido_feed(void* context, bool level, uint32_t durati
}
}
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_ido_check_remote_controller(SubGhzBlockGeneric* instance) {
uint64_t code_found_reverse =
subghz_protocol_blocks_reverse_key(instance->data, instance->data_count_bit);
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_ido_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_ido_encoder;
extern const SubGhzProtocol subghz_protocol_ido;
/**
* Allocate SubGhzProtocolDecoderIDo.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderIDo* pointer to a SubGhzProtocolDecoderIDo instance
*/
void* subghz_protocol_decoder_ido_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderIDo.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
*/
void subghz_protocol_decoder_ido_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderIDo.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
*/
void subghz_protocol_decoder_ido_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_ido_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_ido_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderIDo.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_ido_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderIDo.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_ido_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
* @param output Resulting text
*/
void subghz_protocol_decoder_ido_get_string(void* context, string_t output);
+32 -12
View File
@@ -81,6 +81,12 @@ const SubGhzProtocol subghz_protocol_keeloq = {
.encoder = &subghz_protocol_keeloq_encoder,
};
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param keystore Pointer to a SubGhzKeystore* instance
* @param manufacture_name
*/
static void subghz_protocol_keeloq_check_remote_controller(
SubGhzBlockGeneric* instance,
SubGhzKeystore* keystore,
@@ -107,6 +113,11 @@ void subghz_protocol_encoder_keeloq_free(void* context) {
free(instance);
}
/**
* Key generation from simple data
* @param instance Pointer to a SubGhzProtocolEncoderKeeloq* instance
* @param btn Button number, 4 bit
*/
static bool subghz_protocol_keeloq_gen_data(SubGhzProtocolEncoderKeeloq* instance, uint8_t btn) {
instance->generic.cnt++;
uint32_t fix = btn << 28 | instance->generic.serial;
@@ -179,15 +190,18 @@ bool subghz_protocol_keeloq_create_data(
return res;
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderKeeloq instance
* @return true On success
*/
static bool
subghz_protocol_encoder_keeloq_get_upload(SubGhzProtocolEncoderKeeloq* instance, uint8_t btn) {
furi_assert(instance);
//gen new key
if(subghz_protocol_keeloq_gen_data(instance, btn)) {
//ToDo Update display data
// if(instance->common.callback)
// instance->common.callback((SubGhzProtocolCommon*)instance, instance->common.context);
//ToDo if you need to add a callback to automatically update the data on the display
} else {
return false;
}
@@ -419,6 +433,14 @@ void subghz_protocol_decoder_keeloq_feed(void* context, bool level, uint32_t dur
}
}
/**
* Validation of decrypt data.
* @param instance Pointer to a SubGhzBlockGeneric instance
* @param decrypt Decrypd data
* @param btn Button number, 4 bit
* @param end_serial decrement the last 10 bits of the serial number
* @return true On success
*/
static inline bool subghz_protocol_keeloq_check_decrypt(
SubGhzBlockGeneric* instance,
uint32_t decrypt,
@@ -433,11 +455,13 @@ static inline bool subghz_protocol_keeloq_check_decrypt(
return false;
}
/** Checking the accepted code against the database manafacture key
*
* @param instance SubGhzProtocolKeeloq instance
* @param fix fix part of the parcel
* @param hop hop encrypted part of the parcel
/**
* Checking the accepted code against the database manafacture key
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param fix Fix part of the parcel
* @param hop Hop encrypted part of the parcel
* @param keystore Pointer to a SubGhzKeystore* instance
* @param manufacture_name
* @return true on successful search
*/
static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
@@ -575,10 +599,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
return 0;
}
/** Analysis of received data
*
* @param instance SubGhzProtocolKeeloq instance
*/
static void subghz_protocol_keeloq_check_remote_controller(
SubGhzBlockGeneric* instance,
SubGhzKeystore* keystore,
+92
View File
@@ -11,8 +11,31 @@ extern const SubGhzProtocolDecoder subghz_protocol_keeloq_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_keeloq_encoder;
extern const SubGhzProtocol subghz_protocol_keeloq;
/**
* Allocate SubGhzProtocolEncoderKeeloq.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderKeeloq* pointer to a SubGhzProtocolEncoderKeeloq instance
*/
void* subghz_protocol_encoder_keeloq_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderKeeloq.
* @param context Pointer to a SubGhzProtocolEncoderKeeloq instance
*/
void subghz_protocol_encoder_keeloq_free(void* context);
/**
* Key generation from simple data.
* @param context Pointer to a SubGhzProtocolEncoderKeeloq instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param serial Serial number, 28 bit
* @param btn Button number, 4 bit
* @param cnt Container value, 16 bit
* @param manufacture_name Name of manufacturer's key
* @param frequency Transmission frequency, Hz
* @param preset Modulation, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_keeloq_create_data(
void* context,
FlipperFormat* flipper_format,
@@ -22,18 +45,87 @@ bool subghz_protocol_keeloq_create_data(
const char* manufacture_name,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderKeeloq instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_keeloq_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderKeeloq instance
*/
void subghz_protocol_encoder_keeloq_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderKeeloq instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_keeloq_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderKeeloq.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderKeeloq* pointer to a SubGhzProtocolDecoderKeeloq instance
*/
void* subghz_protocol_decoder_keeloq_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderKeeloq.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
*/
void subghz_protocol_decoder_keeloq_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderKeeloq.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
*/
void subghz_protocol_decoder_keeloq_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_keeloq_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_keeloq_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderKeeloq.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_keeloq_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderKeeloq.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_keeloq_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
* @param output Resulting text
*/
void subghz_protocol_decoder_keeloq_get_string(void* context, string_t output);
+10 -8
View File
@@ -10,7 +10,6 @@
* https://phreakerclub.com/forum/showthread.php?t=1094
*
*/
#define KEELOQ_NLF 0x3A5C742E
#define bit(x, n) (((x) >> (n)) & 1)
#define g5(x, a, b, c, d, e) \
@@ -26,41 +25,44 @@
#define KEELOQ_LEARNING_SECURE 3u
#define KEELOQ_LEARNING_MAGIC_XOR_TYPE_1 4u
/** Simple Learning Encrypt
/**
* Simple Learning Encrypt
* @param data - 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter
* @param key - manufacture (64bit)
* @return keeloq encrypt data
*/
uint32_t subghz_protocol_keeloq_common_encrypt(const uint32_t data, const uint64_t key);
/** Simple Learning Decrypt
/**
* Simple Learning Decrypt
* @param data - keeloq encrypt data
* @param key - manufacture (64bit)
* @return 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter
*/
uint32_t subghz_protocol_keeloq_common_decrypt(const uint32_t data, const uint64_t key);
/** Normal Learning
/**
* Normal Learning
* @param data - serial number (28bit)
* @param key - manufacture (64bit)
* @return manufacture for this serial number (64bit)
*/
uint64_t subghz_protocol_keeloq_common_normal_learning(uint32_t data, const uint64_t key);
/** Secure Learning
/**
* Secure Learning
* @param data - serial number (28bit)
* @param seed - seed number (32bit)
* @param key - manufacture (64bit)
* @return manufacture for this serial number (64bit)
*/
uint64_t
subghz_protocol_keeloq_common_secure_learning(uint32_t data, uint32_t seed, const uint64_t key);
/** Magic_xor_type1 Learning
/**
* Magic_xor_type1 Learning
* @param data - serial number (28bit)
* @param xor - magic xor (64bit)
* @return manufacture for this serial number (64bit)
*/
uint64_t subghz_protocol_keeloq_common_magic_xor_type1_learning(uint32_t data, uint64_t xor);
+3 -3
View File
@@ -203,9 +203,9 @@ uint8_t subghz_protocol_kia_crc8(uint8_t* data, size_t len) {
return crc;
}
/** Analysis of received data
*
* @param instance SubGhzProtocolKIA instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_kia_check_remote_controller(SubGhzBlockGeneric* instance) {
/*
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_kia_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_kia_encoder;
extern const SubGhzProtocol subghz_protocol_kia;
/**
* Allocate SubGhzProtocolDecoderKIA.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderKIA* pointer to a SubGhzProtocolDecoderKIA instance
*/
void* subghz_protocol_decoder_kia_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderKIA.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
*/
void subghz_protocol_decoder_kia_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderKIA.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
*/
void subghz_protocol_decoder_kia_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_kia_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_kia_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderKIA.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_kia_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderKIA.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_kia_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
* @param output Resulting text
*/
void subghz_protocol_decoder_kia_get_string(void* context, string_t output);
+5
View File
@@ -90,6 +90,11 @@ void subghz_protocol_encoder_nero_radio_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderNeroRadio instance
* @return true On success
*/
static bool
subghz_protocol_encoder_nero_radio_get_upload(SubGhzProtocolEncoderNeroRadio* instance) {
furi_assert(instance);
+79
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_nero_radio_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_nero_radio_encoder;
extern const SubGhzProtocol subghz_protocol_nero_radio;
/**
* Allocate SubGhzProtocolEncoderNeroRadio.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderNeroRadio* pointer to a SubGhzProtocolEncoderNeroRadio instance
*/
void* subghz_protocol_encoder_nero_radio_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderNeroRadio.
* @param context Pointer to a SubGhzProtocolEncoderNeroRadio instance
*/
void subghz_protocol_encoder_nero_radio_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderNeroRadio instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_nero_radio_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderNeroRadio instance
*/
void subghz_protocol_encoder_nero_radio_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderNeroRadio instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_nero_radio_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderNeroRadio.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderNeroRadio* pointer to a SubGhzProtocolDecoderNeroRadio instance
*/
void* subghz_protocol_decoder_nero_radio_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderNeroRadio.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
*/
void subghz_protocol_decoder_nero_radio_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderNeroRadio.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
*/
void subghz_protocol_decoder_nero_radio_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_nero_radio_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_nero_radio_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderNeroRadio.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_nero_radio_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderNeroRadio.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_nero_radio_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
* @param output Resulting text
*/
void subghz_protocol_decoder_nero_radio_get_string(void* context, string_t output);
+5
View File
@@ -95,6 +95,11 @@ void subghz_protocol_encoder_nero_sketch_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderNeroSketch instance
* @return true On success
*/
static bool
subghz_protocol_encoder_nero_sketch_get_upload(SubGhzProtocolEncoderNeroSketch* instance) {
furi_assert(instance);
+79
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_nero_sketch_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_nero_sketch_encoder;
extern const SubGhzProtocol subghz_protocol_nero_sketch;
/**
* Allocate SubGhzProtocolEncoderNeroSketch.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderNeroSketch* pointer to a SubGhzProtocolEncoderNeroSketch instance
*/
void* subghz_protocol_encoder_nero_sketch_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderNeroSketch.
* @param context Pointer to a SubGhzProtocolEncoderNeroSketch instance
*/
void subghz_protocol_encoder_nero_sketch_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderNeroSketch instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_nero_sketch_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderNeroSketch instance
*/
void subghz_protocol_encoder_nero_sketch_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderNeroSketch instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_nero_sketch_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderNeroSketch.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderNeroSketch* pointer to a SubGhzProtocolDecoderNeroSketch instance
*/
void* subghz_protocol_decoder_nero_sketch_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderNeroSketch.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
*/
void subghz_protocol_decoder_nero_sketch_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderNeroSketch.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
*/
void subghz_protocol_decoder_nero_sketch_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_nero_sketch_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_nero_sketch_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderNeroSketch.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_nero_sketch_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderNeroSketch.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_nero_sketch_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
* @param output Resulting text
*/
void subghz_protocol_decoder_nero_sketch_get_string(void* context, string_t output);
+5
View File
@@ -94,6 +94,11 @@ void subghz_protocol_encoder_nice_flo_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderNiceFlo instance
* @return true On success
*/
static bool subghz_protocol_encoder_nice_flo_get_upload(SubGhzProtocolEncoderNiceFlo* instance) {
furi_assert(instance);
size_t index = 0;
+80 -1
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_nice_flo_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_nice_flo_encoder;
extern const SubGhzProtocol subghz_protocol_nice_flo;
/**
* Allocate SubGhzProtocolEncoderNiceFlo.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderNiceFlo* pointer to a SubGhzProtocolEncoderNiceFlo instance
*/
void* subghz_protocol_encoder_nice_flo_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderNiceFlo.
* @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
*/
void subghz_protocol_encoder_nice_flo_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_nice_flo_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
*/
void subghz_protocol_encoder_nice_flo_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_nice_flo_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderNiceFlo.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderNiceFlo* pointer to a SubGhzProtocolDecoderNiceFlo instance
*/
void* subghz_protocol_decoder_nice_flo_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderNiceFlo.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
*/
void subghz_protocol_decoder_nice_flo_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderNiceFlo.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
*/
void subghz_protocol_decoder_nice_flo_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_nice_flo_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_nice_flo_get_hash_data(void* context);
void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output);
/**
* Serialize data SubGhzProtocolDecoderNiceFlo.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_nice_flo_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderNiceFlo.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_nice_flo_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
* @param output Resulting text
*/
void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output);
+9 -8
View File
@@ -76,11 +76,11 @@ const SubGhzProtocol subghz_protocol_nice_flor_s = {
.encoder = &subghz_protocol_nice_flor_s_encoder,
};
/** Read bytes from rainbow table
*
* @param instance - SubGhzProtocolNiceFlorS* instance
* @param address - address byte
* @return byte data
/**
* Read bytes from rainbow table
* @param file_name Full path to rainbow table the file
* @param address Byte address in file
* @return data
*/
static uint8_t
subghz_protocol_nice_flor_s_get_byte_in_file(const char* file_name, uint32_t address) {
@@ -277,9 +277,10 @@ void subghz_protocol_decoder_nice_flor_s_feed(void* context, bool level, uint32_
}
}
/** Decrypt protocol Nice Flor S
*
* @param instance - SubGhzProtocolNiceFlorS* instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param file_name Full path to rainbow table the file
*/
static void subghz_protocol_nice_flor_s_remote_controller(
SubGhzBlockGeneric* instance,
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_nice_flor_s_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_nice_flor_s_encoder;
extern const SubGhzProtocol subghz_protocol_nice_flor_s;
/**
* Allocate SubGhzProtocolDecoderNiceFlorS.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderNiceFlorS* pointer to a SubGhzProtocolDecoderNiceFlorS instance
*/
void* subghz_protocol_decoder_nice_flor_s_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderNiceFlorS.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
*/
void subghz_protocol_decoder_nice_flor_s_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderNiceFlorS.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
*/
void subghz_protocol_decoder_nice_flor_s_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_nice_flor_s_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_nice_flor_s_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderNiceFlorS.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_nice_flor_s_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderNiceFlorS.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_nice_flor_s_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
* @param output Resulting text
*/
void subghz_protocol_decoder_nice_flor_s_get_string(void* context, string_t output);
+5
View File
@@ -98,6 +98,11 @@ void subghz_protocol_encoder_princeton_free(void* context) {
free(instance);
}
/**
* Generating an upload from data.
* @param instance Pointer to a SubGhzProtocolEncoderPrinceton instance
* @return true On success
*/
static bool
subghz_protocol_encoder_princeton_get_upload(SubGhzProtocolEncoderPrinceton* instance) {
furi_assert(instance);
+79
View File
@@ -11,20 +11,99 @@ extern const SubGhzProtocolDecoder subghz_protocol_princeton_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_princeton_encoder;
extern const SubGhzProtocol subghz_protocol_princeton;
/**
* Allocate SubGhzProtocolEncoderPrinceton.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderPrinceton* pointer to a SubGhzProtocolEncoderPrinceton instance
*/
void* subghz_protocol_encoder_princeton_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderPrinceton.
* @param context Pointer to a SubGhzProtocolEncoderPrinceton instance
*/
void subghz_protocol_encoder_princeton_free(void* context);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderPrinceton instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_princeton_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderPrinceton instance
*/
void subghz_protocol_encoder_princeton_stop(void* context);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderPrinceton instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_princeton_yield(void* context);
/**
* Allocate SubGhzProtocolDecoderPrinceton.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderPrinceton* pointer to a SubGhzProtocolDecoderPrinceton instance
*/
void* subghz_protocol_decoder_princeton_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderPrinceton.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
*/
void subghz_protocol_decoder_princeton_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderPrinceton.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
*/
void subghz_protocol_decoder_princeton_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_princeton_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderPrinceton.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_princeton_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderPrinceton.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_princeton_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
* @param output Resulting text
*/
void subghz_protocol_decoder_princeton_get_string(void* context, string_t output);
+25 -13
View File
@@ -9,21 +9,29 @@ typedef struct SubGhzEncoderPrinceton SubGhzEncoderPrinceton;
typedef void (*SubGhzDecoderPrincetonCallback)(SubGhzDecoderPrinceton* parser, void* context);
/** Allocate SubGhzEncoderPrinceton
/**
* Allocate SubGhzEncoderPrinceton
* @return pointer to SubGhzEncoderPrinceton instance
*/
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc();
/** Free SubGhzEncoderPrinceton instance
/**
* Free SubGhzEncoderPrinceton instance
* @param instance - SubGhzEncoderPrinceton instance
*/
void subghz_encoder_princeton_for_testing_free(SubGhzEncoderPrinceton* instance);
/**
* Forced transmission stop.
* @param instance Pointer to a SubGhzEncoderPrinceton instance
* @param time_stop Transmission stop time, ms
*/
void subghz_encoder_princeton_for_testing_stop(
SubGhzEncoderPrinceton* instance,
uint32_t time_stop);
/** Set new encoder params
/**
* Set new encoder params
* @param instance - SubGhzEncoderPrinceton instance
* @param key - 24bit key
* @param repeat - how many times to repeat
@@ -35,31 +43,34 @@ void subghz_encoder_princeton_for_testing_set(
size_t repeat,
uint32_t frequency);
/** Get repeat count left
/**
* Get repeat count left
* @param instance - SubGhzEncoderPrinceton instance
* @return repeat count left
*/
size_t subghz_encoder_princeton_for_testing_get_repeat_left(SubGhzEncoderPrinceton* instance);
/** Print encoder log
/**
* Print encoder log
* @param instance - SubGhzEncoderPrinceton instance
*/
void subghz_encoder_princeton_for_testing_print_log(void* context);
/** Get level duration
/**
* Get level duration
* @param instance - SubGhzEncoderPrinceton instance
* @return level duration
*/
LevelDuration subghz_encoder_princeton_for_testing_yield(void* context);
/** Allocate SubGhzDecoderPrinceton
*
/**
* Allocate SubGhzDecoderPrinceton
* @return SubGhzDecoderPrinceton*
*/
SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc();
/** Free SubGhzDecoderPrinceton
*
/**
* Free SubGhzDecoderPrinceton
* @param instance
*/
void subghz_decoder_princeton_for_testing_free(SubGhzDecoderPrinceton* instance);
@@ -69,13 +80,14 @@ void subghz_decoder_princeton_for_testing_set_callback(
SubGhzDecoderPrincetonCallback callback,
void* context);
/** Reset internal state
/**
* Reset internal state
* @param instance - SubGhzDecoderPrinceton instance
*/
void subghz_decoder_princeton_for_testing_reset(SubGhzDecoderPrinceton* instance);
/** Parse accepted duration
*
/**
* Parse accepted duration
* @param instance - SubGhzDecoderPrinceton instance
* @param data - LevelDuration level_duration
*/
+93
View File
@@ -13,28 +13,121 @@ extern const SubGhzProtocolDecoder subghz_protocol_raw_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_raw_encoder;
extern const SubGhzProtocol subghz_protocol_raw;
/**
* Open file for writing
* @param instance Pointer to a SubGhzProtocolDecoderRAW instance
* @param dev_name File name
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_raw_save_to_file_init(
SubGhzProtocolDecoderRAW* instance,
const char* dev_name,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Stop writing file to flash
* @param instance Pointer to a SubGhzProtocolDecoderRAW instance
*/
void subghz_protocol_raw_save_to_file_stop(SubGhzProtocolDecoderRAW* instance);
/**
* Get the number of samples received SubGhzProtocolDecoderRAW.
* @param instance Pointer to a SubGhzProtocolDecoderRAW instance
* @return count of samples
*/
size_t subghz_protocol_raw_get_sample_write(SubGhzProtocolDecoderRAW* instance);
/**
* Allocate SubGhzProtocolDecoderRAW.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderRAW* pointer to a SubGhzProtocolDecoderRAW instance
*/
void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderRAW.
* @param context Pointer to a SubGhzProtocolDecoderRAW instance
*/
void subghz_protocol_decoder_raw_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderRAW.
* @param context Pointer to a SubGhzProtocolDecoderRAW instance
*/
void subghz_protocol_decoder_raw_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderRAW instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_raw_feed(void* context, bool level, uint32_t duration);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderRAW instance
* @param output Resulting text
*/
void subghz_protocol_decoder_raw_get_string(void* context, string_t output);
/**
* Allocate SubGhzProtocolEncoderRAW.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolEncoderRAW* pointer to a SubGhzProtocolEncoderRAW instance
*/
void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolEncoderRAW.
* @param context Pointer to a SubGhzProtocolEncoderRAW instance
*/
void subghz_protocol_encoder_raw_free(void* context);
/**
* Forced transmission stop.
* @param context Pointer to a SubGhzProtocolEncoderRAW instance
*/
void subghz_protocol_encoder_raw_stop(void* context);
/**
* Сallback on completion of file transfer.
* @param context Pointer to a SubGhzProtocolEncoderRAW instance
*/
void subghz_protocol_raw_file_encoder_worker_callback_end(void* context);
/**
* Set callback on completion of file transfer.
* @param instance Pointer to a SubGhzProtocolEncoderRAW instance
* @param callback_end Callback, SubGhzProtocolEncoderRAWCallbackEnd
* @param context_end Context
*/
void subghz_protocol_raw_file_encoder_worker_set_callback_end(
SubGhzProtocolEncoderRAW* instance,
SubGhzProtocolEncoderRAWCallbackEnd callback_end,
void* context_end);
/**
* File generation for RAW work.
* @param flipper_format Pointer to a FlipperFormat instance
* @param file_name File name
*/
void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char* file_name);
/**
* Deserialize and generating an upload to send.
* @param context Pointer to a SubGhzProtocolEncoderRAW instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_encoder_raw_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting the level and duration of the upload to be loaded into DMA.
* @param context Pointer to a SubGhzProtocolEncoderRAW instance
* @return LevelDuration
*/
LevelDuration subghz_protocol_encoder_raw_yield(void* context);
+14
View File
@@ -2,8 +2,22 @@
#include "../types.h"
/**
* Registration by name SubGhzProtocol.
* @param name Protocol name
* @return SubGhzProtocol* pointer to a SubGhzProtocol instance
*/
const SubGhzProtocol* subghz_protocol_registry_get_by_name(const char* name);
/**
* Registration protocol by index in array SubGhzProtocol.
* @param index Protocol by index in array
* @return SubGhzProtocol* pointer to a SubGhzProtocol instance
*/
const SubGhzProtocol* subghz_protocol_registry_get_by_index(size_t index);
/**
* Getting the number of registered protocols.
* @return Number of protocols
*/
size_t subghz_protocol_registry_count();
+4 -3
View File
@@ -200,9 +200,10 @@ void subghz_protocol_decoder_scher_khan_feed(void* context, bool level, uint32_t
}
}
/** Analysis of received data
*
* @param instance SubGhzProtocolScherKhan instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param protocol_name
*/
static void subghz_protocol_scher_khan_check_remote_controller(
SubGhzBlockGeneric* instance,
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_scher_khan_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_scher_khan_encoder;
extern const SubGhzProtocol subghz_protocol_scher_khan;
/**
* Allocate SubGhzProtocolDecoderScherKhan.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderScherKhan* pointer to a SubGhzProtocolDecoderScherKhan instance
*/
void* subghz_protocol_decoder_scher_khan_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderScherKhan.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
*/
void subghz_protocol_decoder_scher_khan_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderScherKhan.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
*/
void subghz_protocol_decoder_scher_khan_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_scher_khan_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_scher_khan_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderScherKhan.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_scher_khan_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderScherKhan.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_scher_khan_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
* @param output Resulting text
*/
void subghz_protocol_decoder_scher_khan_get_string(void* context, string_t output);
+12 -3
View File
@@ -99,6 +99,11 @@ void subghz_protocol_decoder_somfy_keytis_reset(void* context) {
NULL);
}
/**
* Сhecksum calculation.
* @param data Вata for checksum calculation
* @return CRC
*/
static uint8_t subghz_protocol_somfy_keytis_crc(uint64_t data) {
uint8_t crc = 0;
data &= 0xFFF0FFFFFFFFFF;
@@ -231,9 +236,9 @@ void subghz_protocol_decoder_somfy_keytis_feed(void* context, bool level, uint32
}
}
/** Analysis of received data
*
* @param instance SubGhzProtocolSomfyKeytis instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_somfy_keytis_check_remote_controller(SubGhzBlockGeneric* instance) {
//https://pushstack.wordpress.com/somfy-rts-protocol/
@@ -341,6 +346,10 @@ static void subghz_protocol_somfy_keytis_check_remote_controller(SubGhzBlockGene
instance->serial = data & 0xFFFFFF;
}
/**
* Get button name.
* @param btn Button number, 4 bit
*/
static const char* subghz_protocol_somfy_keytis_get_name_button(uint8_t btn) {
const char* name_btn[0x10] = {
"Unknown",
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_somfy_keytis_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_somfy_keytis_encoder;
extern const SubGhzProtocol subghz_protocol_somfy_keytis;
/**
* Allocate SubGhzProtocolDecoderSomfyKeytis.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderSomfyKeytis* pointer to a SubGhzProtocolDecoderSomfyKeytis instance
*/
void* subghz_protocol_decoder_somfy_keytis_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderSomfyKeytis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
*/
void subghz_protocol_decoder_somfy_keytis_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderSomfyKeytis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
*/
void subghz_protocol_decoder_somfy_keytis_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_somfy_keytis_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_somfy_keytis_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderSomfyKeytis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_somfy_keytis_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderSomfyKeytis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_somfy_keytis_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
* @param output Resulting text
*/
void subghz_protocol_decoder_somfy_keytis_get_string(void* context, string_t output);
+12 -3
View File
@@ -98,6 +98,11 @@ void subghz_protocol_decoder_somfy_telis_reset(void* context) {
NULL);
}
/**
* Сhecksum calculation.
* @param data Вata for checksum calculation
* @return CRC
*/
static uint8_t subghz_protocol_somfy_telis_crc(uint64_t data) {
uint8_t crc = 0;
data &= 0xFFF0FFFFFFFFFF;
@@ -225,9 +230,9 @@ void subghz_protocol_decoder_somfy_telis_feed(void* context, bool level, uint32_
}
}
/** Analysis of received data
*
* @param instance SubGhzProtocolSomfyTelis instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
*/
static void subghz_protocol_somfy_telis_check_remote_controller(SubGhzBlockGeneric* instance) {
//https://pushstack.wordpress.com/somfy-rts-protocol/
@@ -298,6 +303,10 @@ static void subghz_protocol_somfy_telis_check_remote_controller(SubGhzBlockGener
instance->serial = data & 0xFFFFFF;
}
/**
* Get button name.
* @param btn Button number, 4 bit
*/
static const char* subghz_protocol_somfy_telis_get_name_button(uint8_t btn) {
const char* name_btn[0x10] = {
"Unknown",
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_somfy_telis_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_somfy_telis_encoder;
extern const SubGhzProtocol subghz_protocol_somfy_telis;
/**
* Allocate SubGhzProtocolDecoderSomfyTelis.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderSomfyTelis* pointer to a SubGhzProtocolDecoderSomfyTelis instance
*/
void* subghz_protocol_decoder_somfy_telis_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderSomfyTelis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
*/
void subghz_protocol_decoder_somfy_telis_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderSomfyTelis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
*/
void subghz_protocol_decoder_somfy_telis_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_somfy_telis_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_somfy_telis_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderSomfyTelis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_somfy_telis_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderSomfyTelis.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_somfy_telis_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
* @param output Resulting text
*/
void subghz_protocol_decoder_somfy_telis_get_string(void* context, string_t output);
+20 -8
View File
@@ -181,6 +181,14 @@ void subghz_protocol_decoder_star_line_feed(void* context, bool level, uint32_t
}
}
/**
* Validation of decrypt data.
* @param instance Pointer to a SubGhzBlockGeneric instance
* @param decrypt Decrypd data
* @param btn Button number, 4 bit
* @param end_serial decrement the last 10 bits of the serial number
* @return true On success
*/
static inline bool subghz_protocol_star_line_check_decrypt(
SubGhzBlockGeneric* instance,
uint32_t decrypt,
@@ -194,11 +202,13 @@ static inline bool subghz_protocol_star_line_check_decrypt(
return false;
}
/** Checking the accepted code against the database manafacture key
*
* @param instance SubGhzProtocolStarLine instance
* @param fix fix part of the parcel
* @param hop hop encrypted part of the parcel
/**
* Checking the accepted code against the database manafacture key
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param fix Fix part of the parcel
* @param hop Hop encrypted part of the parcel
* @param keystore Pointer to a SubGhzKeystore* instance
* @param manufacture_name
* @return true on successful search
*/
static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
@@ -279,9 +289,11 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
return 0;
}
/** Analysis of received data
*
* @param instance SubGhzProtocolStarLine instance
/**
* Analysis of received data
* @param instance Pointer to a SubGhzBlockGeneric* instance
* @param keystore Pointer to a SubGhzKeystore* instance
* @param manufacture_name
*/
static void subghz_protocol_star_line_check_remote_controller(
SubGhzBlockGeneric* instance,
+50
View File
@@ -11,15 +11,65 @@ extern const SubGhzProtocolDecoder subghz_protocol_star_line_decoder;
extern const SubGhzProtocolEncoder subghz_protocol_star_line_encoder;
extern const SubGhzProtocol subghz_protocol_star_line;
/**
* Allocate SubGhzProtocolDecoderStarLine.
* @param environment Pointer to a SubGhzEnvironment instance
* @return SubGhzProtocolDecoderStarLine* pointer to a SubGhzProtocolDecoderStarLine instance
*/
void* subghz_protocol_decoder_star_line_alloc(SubGhzEnvironment* environment);
/**
* Free SubGhzProtocolDecoderStarLine.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
*/
void subghz_protocol_decoder_star_line_free(void* context);
/**
* Reset decoder SubGhzProtocolDecoderStarLine.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
*/
void subghz_protocol_decoder_star_line_reset(void* context);
/**
* Parse a raw sequence of levels and durations received from the air.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
* @param level Signal level true-high false-low
* @param duration Duration of this level in, us
*/
void subghz_protocol_decoder_star_line_feed(void* context, bool level, uint32_t duration);
/**
* Getting the hash sum of the last randomly received parcel.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
* @return hash Hash sum
*/
uint8_t subghz_protocol_decoder_star_line_get_hash_data(void* context);
/**
* Serialize data SubGhzProtocolDecoderStarLine.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param frequency The frequency at which the signal was received, Hz
* @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
* @return true On success
*/
bool subghz_protocol_decoder_star_line_serialize(
void* context,
FlipperFormat* flipper_format,
uint32_t frequency,
FuriHalSubGhzPreset preset);
/**
* Deserialize data SubGhzProtocolDecoderStarLine.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
* @param flipper_format Pointer to a FlipperFormat instance
* @return true On success
*/
bool subghz_protocol_decoder_star_line_deserialize(void* context, FlipperFormat* flipper_format);
/**
* Getting a textual representation of the received data.
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
* @param output Resulting text
*/
void subghz_protocol_decoder_star_line_get_string(void* context, string_t output);