seed transmition

This commit is contained in:
r3df0xx 2022-04-25 22:22:09 +03:00
parent 5c4cfd3fd4
commit e49f6a1d76
2 changed files with 9 additions and 6 deletions

View File

@ -53,7 +53,7 @@ bool subghz_scene_set_seed_on_event(void* context, SceneManagerEvent event) {
"FAAC_SLH", "FAAC_SLH",
868350000, 868350000,
FuriHalSubGhzPresetOok650Async); FuriHalSubGhzPresetOok650Async);
FURI_LOG_I(TAG, "SEED (set_type): %8X\n", seed); FURI_LOG_I(TAG, "SEED (set_seed_on_event): %8X\n", seed);
generated_protocol = true; generated_protocol = true;
} else { } else {
generated_protocol = false; generated_protocol = false;
@ -82,7 +82,7 @@ void subghz_scene_set_seed_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
uint32_t seed = subghz->txrx->secure_data->seed[0] << 24 | subghz->txrx->secure_data->seed[1] << 16 | 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]; subghz->txrx->secure_data->seed[2] << 8 | subghz->txrx->secure_data->seed[3];
FURI_LOG_I(TAG, "seed: %8X\n", seed); FURI_LOG_I(TAG, "SEED (set_seed_on_exit): %8X\n", seed);
// Clear view // Clear view
byte_input_set_result_callback(subghz->byte_input, NULL, NULL, NULL, NULL, 0); byte_input_set_result_callback(subghz->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(subghz->byte_input, ""); byte_input_set_header_text(subghz->byte_input, "");

View File

@ -87,7 +87,8 @@ const SubGhzProtocol subghz_protocol_faac_slh = {
static void subghz_protocol_faac_slh_check_remote_controller static void subghz_protocol_faac_slh_check_remote_controller
(SubGhzBlockGeneric* instance, (SubGhzBlockGeneric* instance,
SubGhzKeystore* keystore, SubGhzKeystore* keystore,
const char** manufacture_name); const char** manufacture_name,
uint32_t seed);
void* subghz_protocol_encoder_faac_slh_alloc(SubGhzEnvironment* environment) { void* subghz_protocol_encoder_faac_slh_alloc(SubGhzEnvironment* environment) {
SubGhzProtocolEncoderFaacSLH* instance = malloc(sizeof(SubGhzProtocolEncoderFaacSLH)); SubGhzProtocolEncoderFaacSLH* instance = malloc(sizeof(SubGhzProtocolEncoderFaacSLH));
@ -247,7 +248,7 @@ bool subghz_protocol_encoder_faac_slh_deserialize(void* context, FlipperFormat*
} }
subghz_protocol_faac_slh_check_remote_controller( subghz_protocol_faac_slh_check_remote_controller(
&instance->generic, instance->keystore, &instance->manufacture_name); &instance->generic, instance->keystore, &instance->manufacture_name, instance->generic.seed);
//optional parameter parameter //optional parameter parameter
flipper_format_read_uint32( flipper_format_read_uint32(
@ -398,9 +399,11 @@ void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t d
static void subghz_protocol_faac_slh_check_remote_controller static void subghz_protocol_faac_slh_check_remote_controller
(SubGhzBlockGeneric* instance, (SubGhzBlockGeneric* instance,
SubGhzKeystore* keystore, SubGhzKeystore* keystore,
const char** manufacture_name) { const char** manufacture_name,
uint32_t seed) {
//uint64_t code_found_reverse = //uint64_t code_found_reverse =
//subghz_protocol_blocks_reverse_key(instance->data, instance->data_count_bit); //subghz_protocol_blocks_reverse_key(instance->data, instance->data_count_bit);
instance->seed = seed;
uint32_t code_fix = instance->data >> 32; uint32_t code_fix = instance->data >> 32;
uint32_t code_hop = instance->data & 0xFFFFFFFF; uint32_t code_hop = instance->data & 0xFFFFFFFF;
instance->serial = code_fix >> 4; instance->serial = code_fix >> 4;
@ -462,7 +465,7 @@ bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat*
void subghz_protocol_decoder_faac_slh_get_string(void* context, string_t output) { void subghz_protocol_decoder_faac_slh_get_string(void* context, string_t output) {
furi_assert(context); furi_assert(context);
SubGhzProtocolDecoderFaacSLH* instance = context; SubGhzProtocolDecoderFaacSLH* instance = context;
subghz_protocol_faac_slh_check_remote_controller(&instance->generic, instance->keystore, &instance->manufacture_name); subghz_protocol_faac_slh_check_remote_controller(&instance->generic, instance->keystore, &instance->manufacture_name, instance->generic.seed);
//uint64_t code_found_reverse = subghz_protocol_blocks_reverse_key( //uint64_t code_found_reverse = subghz_protocol_blocks_reverse_key(
//instance->generic.data, instance->generic.data_count_bit); //instance->generic.data, instance->generic.data_count_bit);
uint32_t code_fix = instance->generic.data >> 32; uint32_t code_fix = instance->generic.data >> 32;