mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-15 08:43:37 +03:00
seed transfer to decoder
This commit is contained in:
parent
8b984b363d
commit
77a1a58d67
@ -53,12 +53,15 @@ bool subghz_scene_set_seed_on_event(void* context, SceneManagerEvent event) {
|
||||
"FAAC_SLH",
|
||||
868350000,
|
||||
FuriHalSubGhzPresetOok650Async);
|
||||
|
||||
subghz_protocol_faac_slh_set_seed_to_decoder(subghz->txrx->transmitter->protocol_instance, seed);
|
||||
|
||||
uint8_t seed_data[sizeof(uint32_t)] = {0};
|
||||
for(size_t i = 0; i < sizeof(uint32_t); i++) {
|
||||
seed_data[sizeof(uint32_t) - i - 1] = (seed >> i * 8) & 0xFF;
|
||||
}
|
||||
flipper_format_write_hex(subghz->txrx->fff_data, "Seed", seed_data, sizeof(uint32_t));
|
||||
FURI_LOG_I(TAG, "SEED (set_seed_on_event): %8X\n", seed);
|
||||
FURI_LOG_I(TAG, "SEED: %8X\n", seed);
|
||||
generated_protocol = true;
|
||||
} else {
|
||||
generated_protocol = false;
|
||||
@ -85,9 +88,6 @@ bool subghz_scene_set_seed_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
void subghz_scene_set_seed_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
uint32_t seed = subghz->txrx->secure_data->seed[0] << 24 | subghz->txrx->secure_data->seed[1] << 16 |
|
||||
subghz->txrx->secure_data->seed[2] << 8 | subghz->txrx->secure_data->seed[3];
|
||||
FURI_LOG_I(TAG, "SEED (set_seed_on_exit): %8X\n", seed);
|
||||
// Clear view
|
||||
byte_input_set_result_callback(subghz->byte_input, NULL, NULL, NULL, NULL, 0);
|
||||
byte_input_set_header_text(subghz->byte_input, "");
|
||||
|
@ -393,6 +393,15 @@ void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t d
|
||||
}
|
||||
}
|
||||
|
||||
void subghz_protocol_faac_slh_set_seed_to_decoder(void* context, uint32_t seed) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderFaacSLH* instance = context;
|
||||
instance->generic.seed = seed;
|
||||
subghz_protocol_faac_slh_check_remote_controller(
|
||||
&instance->generic, instance->keystore, &instance->manufacture_name);
|
||||
FURI_LOG_I(TAG, "SEED (to_decoder): %8X\n", instance->generic.seed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Analysis of received data
|
||||
* @param instance Pointer to a SubGhzBlockGeneric* instance
|
||||
|
@ -48,6 +48,13 @@ bool subghz_protocol_faac_slh_create_data(
|
||||
uint32_t frequency,
|
||||
FuriHalSubGhzPreset preset);
|
||||
|
||||
/**
|
||||
* Transfering seed value from Encoder to Decoder
|
||||
* @param context - Pointer to a SubGhzProtocolDecoderFaacSLH instance
|
||||
* @param seed Seed value, 32 bit
|
||||
*/
|
||||
void subghz_protocol_faac_slh_set_seed_to_decoder(void* context, uint32_t seed);
|
||||
|
||||
/**
|
||||
* Deserialize and generating an upload to send.
|
||||
* @param context Pointer to a SubGhzProtocolEncoderFaacSLH instance
|
||||
|
Loading…
Reference in New Issue
Block a user