From a18cd53bb1c88040fccdfbb5cf0390b10748134d Mon Sep 17 00:00:00 2001 From: r3df0xx Date: Wed, 16 Mar 2022 17:28:09 +0300 Subject: [PATCH] Unblock all freqs. Allow Keeloq save&send "custom_save_and_send" of r3df0xx contributor was moved here and updated to latest dev refactoring. --- firmware/targets/f7/furi_hal/furi_hal_subghz.c | 18 ++++++++++-------- lib/subghz/protocols/keeloq.c | 6 +----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/firmware/targets/f7/furi_hal/furi_hal_subghz.c b/firmware/targets/f7/furi_hal/furi_hal_subghz.c index 8dacd3f0a..69c2b42d7 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_subghz.c +++ b/firmware/targets/f7/furi_hal/furi_hal_subghz.c @@ -285,7 +285,7 @@ static const uint8_t furi_hal_subghz_preset_ook_async_patable[8] = { 0x00}; static const uint8_t furi_hal_subghz_preset_ook_async_patable_au[8] = { 0x00, - 0x37, // 12dBm 0xC0, 10dBm 0xC5, 7dBm 0xCD, 5dBm 0x86, 0dBm 0x50, -6dBm 0x37, -10dBm 0x26, -15dBm 0x1D, -20dBm 0x17, -30dBm 0x03 + 0xC0, // 12dBm 0xC0, 10dBm 0xC5, 7dBm 0xCD, 5dBm 0x86, 0dBm 0x50, -6dBm 0x37, -10dBm 0x26, -15dBm 0x1D, -20dBm 0x17, -30dBm 0x03 0x00, 0x00, 0x00, @@ -573,17 +573,18 @@ bool furi_hal_subghz_is_tx_allowed(uint32_t value) { switch(furi_hal_version_get_hw_region()) { case FuriHalVersionRegionEuRu: //433,05..434,79; 868,15..868,55 - if(!(value >= 433050000 && value <= 434790000) && - !(value >= 868150000 && value <= 868550000)) { + if(!(value >= 299999755 && value <= 348000335) && + !(value >= 386999938 && value <= 464000000) && + !(value >= 778999847 && value <= 928000000)) { } else { is_allowed = true; } break; case FuriHalVersionRegionUsCaAu: //304,10..321,95; 433,05..434,79; 915,00..928,00 - if(!(value >= 304100000 && value <= 321950000) && - !(value >= 433050000 && value <= 434790000) && - !(value >= 915000000 && value <= 928000000)) { + if(!(value >= 299999755 && value <= 348000335) && + !(value >= 386999938 && value <= 464000000) && + !(value >= 778999847 && value <= 928000000)) { } else { if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) { if((value >= 304100000 && value <= 321950000) && @@ -597,8 +598,9 @@ bool furi_hal_subghz_is_tx_allowed(uint32_t value) { break; case FuriHalVersionRegionJp: //312,00..315,25; 920,50..923,50 - if(!(value >= 312000000 && value <= 315250000) && - !(value >= 920500000 && value <= 923500000)) { + if(!(value >= 299999755 && value <= 348000335) && + !(value >= 386999938 && value <= 464000000) && + !(value >= 778999847 && value <= 928000000)) { } else { is_allowed = true; } diff --git a/lib/subghz/protocols/keeloq.c b/lib/subghz/protocols/keeloq.c index 975cd29c8..18c4732a2 100644 --- a/lib/subghz/protocols/keeloq.c +++ b/lib/subghz/protocols/keeloq.c @@ -74,7 +74,7 @@ const SubGhzProtocol subghz_protocol_keeloq = { .name = SUBGHZ_PROTOCOL_KEELOQ_NAME, .type = SubGhzProtocolTypeDynamic, .flag = SubGhzProtocolFlag_433 | SubGhzProtocolFlag_868 | SubGhzProtocolFlag_315 | - SubGhzProtocolFlag_AM | SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_Load | + SubGhzProtocolFlag_AM | SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_Load | SubGhzProtocolFlag_Save | SubGhzProtocolFlag_Send, .decoder = &subghz_protocol_keeloq_decoder, @@ -270,10 +270,6 @@ bool subghz_protocol_encoder_keeloq_deserialize(void* context, FlipperFormat* fl subghz_protocol_keeloq_check_remote_controller( &instance->generic, instance->keystore, &instance->manufacture_name); - if(strcmp(instance->manufacture_name, "DoorHan")) { - break; - } - //optional parameter parameter flipper_format_read_uint32( flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);