Compare commits

..

2 Commits

Author SHA1 Message Date
d4rks1d33
d23a892a16 Small changes
All checks were successful
Build Dev Firmware / build (push) Successful in 6m46s
2026-03-24 13:39:45 -03:00
d4rks1d33
16d06d75fe Fix Starline d-pad mapping
All checks were successful
Build Dev Firmware / build (push) Successful in 10m44s
2026-03-23 21:35:59 -03:00
6 changed files with 177 additions and 32 deletions

View File

@@ -60,6 +60,8 @@ This project may incorporate, adapt, or build upon **other open-source projects*
| Subaru | Subaru | 433 MHz | AM | Yes | Yes | No |
| Suzuki | Suzuki | 433 MHz | FM | Yes | Yes | Yes |
| Mitsubishi | Mitsubishi V0 | 868 MHz | FM | Yes | Yes | No |
| Starline | Star Line | 433 MHz | AM | Yes | Yes | No |
| Scher-Khan | Scher-Khan | 433 MHz | FM | Yes | Yes | No |
### Gate / Access Protocols

View File

@@ -155,6 +155,22 @@ bool subghz_view_transmitter_input(InputEvent* event, void* context) {
true);
if(can_be_sent) {
if(event->type == InputTypeLong) {
if(event->key == InputKeyUp) {
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_UP);
subghz_custom_btn_set_long(true);
} else if(event->key == InputKeyDown) {
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_DOWN);
subghz_custom_btn_set_long(true);
} else if(event->key == InputKeyLeft) {
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_LEFT);
subghz_custom_btn_set_long(true);
} else if(event->key == InputKeyRight) {
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_RIGHT);
subghz_custom_btn_set_long(true);
}
}
if(event->key == InputKeyOk && event->type == InputTypePress) {
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_OK);
with_view_model(

View File

@@ -5,6 +5,8 @@ static uint8_t custom_btn_original = 0;
static uint8_t custom_btn_max_btns = 0;
static uint8_t controller_programming_mode = PROG_MODE_OFF;
static bool subghz_custom_btn_long = false;
bool subghz_custom_btn_set(uint8_t btn_id) {
if(btn_id > custom_btn_max_btns) {
custom_btn_id = SUBGHZ_CUSTOM_BTN_OK;
@@ -36,6 +38,7 @@ void subghz_custom_btns_reset(void) {
custom_btn_max_btns = 0;
controller_programming_mode = PROG_MODE_OFF;
custom_btn_id = SUBGHZ_CUSTOM_BTN_OK;
subghz_custom_btn_long = false;
}
bool subghz_custom_btn_is_allowed(void) {
@@ -49,3 +52,11 @@ void subghz_custom_btn_set_prog_mode(ProgMode prog_mode) {
ProgMode subghz_custom_btn_get_prog_mode(void) {
return controller_programming_mode;
}
void subghz_custom_btn_set_long(bool v) {
subghz_custom_btn_long = v;
}
bool subghz_custom_btn_get_long(void) {
return subghz_custom_btn_long;
}

View File

@@ -25,6 +25,9 @@ void subghz_custom_btns_reset(void);
bool subghz_custom_btn_is_allowed(void);
void subghz_custom_btn_set_long(bool v);
bool subghz_custom_btn_get_long(void);
#ifdef __cplusplus
}
#endif

View File

@@ -10,33 +10,69 @@ static const char* star_line_btn_name(uint8_t btn) {
switch(btn) {
case 0x01: return "Lock";
case 0x02: return "Unlock";
case 0x04: return "Trunk";
case 0x08: return "Aux";
default: return "?";
case 0x03: return "Trunk";
case 0x04: return "Panic";
case 0x21: return "Lock";
case 0x22: return "Unlock";
case 0x23: return "Trunk";
case 0x24: return "Start";
case 0x25: return "Stop";
case 0x26: return "Extra";
default: return "Unknown";
}
}
static uint8_t star_line_btn_to_custom(uint8_t btn) {
switch(btn) {
case 0x01: return SUBGHZ_CUSTOM_BTN_UP;
case 0x02: return SUBGHZ_CUSTOM_BTN_DOWN;
case 0x04: return SUBGHZ_CUSTOM_BTN_LEFT;
case 0x08: return SUBGHZ_CUSTOM_BTN_RIGHT;
case 0x01:
case 0x21: return SUBGHZ_CUSTOM_BTN_UP; // 1 = Lock
case 0x02:
case 0x22: return SUBGHZ_CUSTOM_BTN_DOWN; // 2 = Unlock
case 0x03:
case 0x23: return SUBGHZ_CUSTOM_BTN_LEFT; // 3 = Trunk
case 0x04:
case 0x24: return SUBGHZ_CUSTOM_BTN_RIGHT; // 4 = Start/Panic
default: return SUBGHZ_CUSTOM_BTN_OK;
}
}
static uint8_t star_line_custom_to_btn(uint8_t custom, uint8_t original_btn) {
if(custom == SUBGHZ_CUSTOM_BTN_OK) return original_btn;
if(custom == SUBGHZ_CUSTOM_BTN_UP) return 0x01;
if(custom == SUBGHZ_CUSTOM_BTN_DOWN) return 0x02;
if(custom == SUBGHZ_CUSTOM_BTN_LEFT) return 0x04;
if(custom == SUBGHZ_CUSTOM_BTN_RIGHT) return 0x08;
return original_btn;
if(custom == SUBGHZ_CUSTOM_BTN_OK) return original_btn;
bool is_twage = (original_btn & 0x20) != 0;
switch(custom) {
case SUBGHZ_CUSTOM_BTN_UP: return is_twage ? 0x21 : 0x01; // Lock
case SUBGHZ_CUSTOM_BTN_DOWN: return is_twage ? 0x22 : 0x02; // Unlock
case SUBGHZ_CUSTOM_BTN_LEFT: return is_twage ? 0x23 : 0x03; // Trunk
case SUBGHZ_CUSTOM_BTN_RIGHT: return is_twage ? 0x24 : 0x04; // Start/Panic
default: return original_btn;
}
}
//static uint8_t star_line_get_btn_code(uint8_t original_btn) {
// uint8_t custom = subghz_custom_btn_get();
// if(custom == SUBGHZ_CUSTOM_BTN_OK) return original_btn;
// return star_line_custom_to_btn(custom, original_btn);
//}
static uint8_t star_line_get_btn_code(uint8_t original_btn) {
uint8_t custom = subghz_custom_btn_get();
bool is_twage = (original_btn & 0x20) != 0;
if(subghz_custom_btn_get_long()) {
subghz_custom_btn_set_long(false);
switch(custom) {
case SUBGHZ_CUSTOM_BTN_UP: return is_twage ? 0x25 : 0x01; // Stop / Lock
case SUBGHZ_CUSTOM_BTN_DOWN: return is_twage ? 0x26 : 0x02; // Extra / Unlock
case SUBGHZ_CUSTOM_BTN_LEFT: return is_twage ? 0x21 : 0x03; // Lock / Trunk
case SUBGHZ_CUSTOM_BTN_RIGHT: return is_twage ? 0x22 : 0x04; // Unlock / Panic
default: return original_btn;
}
}
if(custom == SUBGHZ_CUSTOM_BTN_OK) return original_btn;
return star_line_custom_to_btn(custom, original_btn);
}
@@ -958,6 +994,53 @@ SubGhzProtocolStatus
return ret;
}
//void subghz_protocol_decoder_star_line_get_string(void* context, FuriString* output) {
// furi_check(context);
// SubGhzProtocolDecoderStarLine* instance = context;
// subghz_protocol_star_line_check_remote_controller(
// &instance->generic, instance->keystore, &instance->manufacture_name);
// subghz_custom_btn_set_original(star_line_btn_to_custom(instance->generic.btn));
// subghz_custom_btn_set_max(4);
// uint32_t code_found_hi = instance->generic.data >> 32;
// uint32_t code_found_lo = instance->generic.data & 0x00000000ffffffff;
// uint64_t code_found_reverse = subghz_protocol_blocks_reverse_key(
// instance->generic.data, instance->generic.data_count_bit);
// uint32_t code_found_reverse_hi = code_found_reverse >> 32;
// uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
// uint8_t display_btn;
// uint8_t custom = subghz_custom_btn_get();
// if(custom == SUBGHZ_CUSTOM_BTN_OK) {
// display_btn = instance->generic.btn;
// } else {
// display_btn = star_line_custom_to_btn(custom, instance->generic.btn);
// }
// furi_string_cat_printf(
// output,
// "%s %dbit\r\n"
// "Key:%08lX%08lX\r\n"
// "Fix:0x%08lX\r\n"
// "Hop:0x%08lX\r\n"
// "Btn:[%s] Cnt:%04lX\r\n",
//"MF:%s\r\n",
// instance->generic.protocol_name,
// instance->generic.data_count_bit,
// code_found_hi,
// code_found_lo,
// code_found_reverse_hi,
// code_found_reverse_lo,
// star_line_btn_name(display_btn),
// instance->generic.cnt);
//instance->manufacture_name);
//}
void subghz_protocol_decoder_star_line_get_string(void* context, FuriString* output) {
furi_check(context);
SubGhzProtocolDecoderStarLine* instance = context;
@@ -976,20 +1059,48 @@ void subghz_protocol_decoder_star_line_get_string(void* context, FuriString* out
uint32_t code_found_reverse_hi = code_found_reverse >> 32;
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
furi_string_cat_printf(
output,
"%s %dbit\r\n"
"Key:%08lX%08lX\r\n"
"Fix:0x%08lX Cnt:%04lX\r\n"
"Hop:0x%08lX Btn:[%s]\r\n"
"MF:%s\r\n",
instance->generic.protocol_name,
instance->generic.data_count_bit,
code_found_hi,
code_found_lo,
code_found_reverse_hi,
instance->generic.cnt,
code_found_reverse_lo,
star_line_btn_name(star_line_get_btn_code(instance->generic.btn)),
instance->manufacture_name);
uint8_t display_btn;
uint8_t custom = subghz_custom_btn_get();
if(custom == SUBGHZ_CUSTOM_BTN_OK) {
display_btn = instance->generic.btn;
} else {
display_btn = star_line_custom_to_btn(custom, instance->generic.btn);
}
bool is_twage = (instance->generic.btn & 0x20) != 0;
if(is_twage) {
furi_string_cat_printf(
output,
"%s %dbit\r\n"
"Key:%08lX%08lX\r\n"
"Fix:0x%08lX\r\n"
"Hop:0x%08lX\r\n"
"Btn:[%s] Cnt:%04lX\r\n",
instance->generic.protocol_name,
instance->generic.data_count_bit,
code_found_hi,
code_found_lo,
code_found_reverse_hi,
code_found_reverse_lo,
star_line_btn_name(display_btn),
instance->generic.cnt);
} else {
// Classic: only 4 buttons
furi_string_cat_printf(
output,
"%s %dbit\r\n"
"Key:%08lX%08lX\r\n"
"Fix:0x%08lX\r\n"
"Hop:0x%08lX\r\n"
"Btn:[%s] Cnt:%04lX\r\n",
instance->generic.protocol_name,
instance->generic.data_count_bit,
code_found_hi,
code_found_lo,
code_found_reverse_hi,
code_found_reverse_lo,
star_line_btn_name(display_btn),
instance->generic.cnt);
}
}

View File

@@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,88.0,,
Version,+,89.0,,
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
Header,+,applications/services/applications.h,,
Header,+,applications/services/bt/bt_service/bt.h,,
@@ -1447,6 +1447,8 @@ Function,+,furi_hal_cortex_instructions_per_microsecond,uint32_t,
Function,+,furi_hal_cortex_timer_get,FuriHalCortexTimer,uint32_t
Function,+,furi_hal_cortex_timer_is_expired,_Bool,FuriHalCortexTimer
Function,+,furi_hal_cortex_timer_wait,void,FuriHalCortexTimer
Function,+,furi_hal_crypto_aes128_ecb_decrypt,_Bool,"const uint8_t*, const uint8_t*, uint8_t*"
Function,+,furi_hal_crypto_aes128_ecb_encrypt,_Bool,"const uint8_t*, const uint8_t*, uint8_t*"
Function,+,furi_hal_crypto_ctr,_Bool,"const uint8_t*, const uint8_t*, const uint8_t*, uint8_t*, size_t"
Function,+,furi_hal_crypto_decrypt,_Bool,"const uint8_t*, uint8_t*, size_t"
Function,+,furi_hal_crypto_enclave_ensure_key,_Bool,uint8_t
@@ -1454,8 +1456,6 @@ Function,+,furi_hal_crypto_enclave_load_key,_Bool,"uint8_t, const uint8_t*"
Function,+,furi_hal_crypto_enclave_store_key,_Bool,"FuriHalCryptoKey*, uint8_t*"
Function,+,furi_hal_crypto_enclave_unload_key,_Bool,uint8_t
Function,+,furi_hal_crypto_enclave_verify,_Bool,"uint8_t*, uint8_t*"
Function,+,furi_hal_crypto_aes128_ecb_decrypt,_Bool,"const uint8_t*, const uint8_t*, uint8_t*"
Function,+,furi_hal_crypto_aes128_ecb_encrypt,_Bool,"const uint8_t*, const uint8_t*, uint8_t*"
Function,+,furi_hal_crypto_encrypt,_Bool,"const uint8_t*, uint8_t*, size_t"
Function,+,furi_hal_crypto_gcm,_Bool,"const uint8_t*, const uint8_t*, const uint8_t*, size_t, const uint8_t*, uint8_t*, size_t, uint8_t*, _Bool"
Function,+,furi_hal_crypto_gcm_decrypt_and_verify,FuriHalCryptoGCMState,"const uint8_t*, const uint8_t*, const uint8_t*, size_t, const uint8_t*, uint8_t*, size_t, const uint8_t*"
@@ -3461,9 +3461,11 @@ Function,+,subghz_block_generic_global_counter_override_set,void,uint32_t
Function,+,subghz_block_generic_global_reset,void,void*
Function,+,subghz_block_generic_serialize,SubGhzProtocolStatus,"SubGhzBlockGeneric*, FlipperFormat*, SubGhzRadioPreset*"
Function,+,subghz_custom_btn_get,uint8_t,
Function,-,subghz_custom_btn_get_long,_Bool,
Function,+,subghz_custom_btn_get_original,uint8_t,
Function,+,subghz_custom_btn_is_allowed,_Bool,
Function,+,subghz_custom_btn_set,_Bool,uint8_t
Function,-,subghz_custom_btn_set_long,void,_Bool
Function,+,subghz_custom_btns_reset,void,
Function,-,subghz_device_cc1101_ext_ep,const FlipperAppPluginDescriptor*,
Function,+,subghz_devices_begin,_Bool,const SubGhzDevice*
1 entry status name type params
2 Version + 88.0 89.0
3 Header + applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h
4 Header + applications/services/applications.h
5 Header + applications/services/bt/bt_service/bt.h
1447 Function + furi_hal_cortex_timer_get FuriHalCortexTimer uint32_t
1448 Function + furi_hal_cortex_timer_is_expired _Bool FuriHalCortexTimer
1449 Function + furi_hal_cortex_timer_wait void FuriHalCortexTimer
1450 Function + furi_hal_crypto_aes128_ecb_decrypt _Bool const uint8_t*, const uint8_t*, uint8_t*
1451 Function + furi_hal_crypto_aes128_ecb_encrypt _Bool const uint8_t*, const uint8_t*, uint8_t*
1452 Function + furi_hal_crypto_ctr _Bool const uint8_t*, const uint8_t*, const uint8_t*, uint8_t*, size_t
1453 Function + furi_hal_crypto_decrypt _Bool const uint8_t*, uint8_t*, size_t
1454 Function + furi_hal_crypto_enclave_ensure_key _Bool uint8_t
1456 Function + furi_hal_crypto_enclave_store_key _Bool FuriHalCryptoKey*, uint8_t*
1457 Function + furi_hal_crypto_enclave_unload_key _Bool uint8_t
1458 Function + furi_hal_crypto_enclave_verify _Bool uint8_t*, uint8_t*
Function + furi_hal_crypto_aes128_ecb_decrypt _Bool const uint8_t*, const uint8_t*, uint8_t*
Function + furi_hal_crypto_aes128_ecb_encrypt _Bool const uint8_t*, const uint8_t*, uint8_t*
1459 Function + furi_hal_crypto_encrypt _Bool const uint8_t*, uint8_t*, size_t
1460 Function + furi_hal_crypto_gcm _Bool const uint8_t*, const uint8_t*, const uint8_t*, size_t, const uint8_t*, uint8_t*, size_t, uint8_t*, _Bool
1461 Function + furi_hal_crypto_gcm_decrypt_and_verify FuriHalCryptoGCMState const uint8_t*, const uint8_t*, const uint8_t*, size_t, const uint8_t*, uint8_t*, size_t, const uint8_t*
3461 Function + subghz_block_generic_global_reset void void*
3462 Function + subghz_block_generic_serialize SubGhzProtocolStatus SubGhzBlockGeneric*, FlipperFormat*, SubGhzRadioPreset*
3463 Function + subghz_custom_btn_get uint8_t
3464 Function - subghz_custom_btn_get_long _Bool
3465 Function + subghz_custom_btn_get_original uint8_t
3466 Function + subghz_custom_btn_is_allowed _Bool
3467 Function + subghz_custom_btn_set _Bool uint8_t
3468 Function - subghz_custom_btn_set_long void _Bool
3469 Function + subghz_custom_btns_reset void
3470 Function - subghz_device_cc1101_ext_ep const FlipperAppPluginDescriptor*
3471 Function + subghz_devices_begin _Bool const SubGhzDevice*