mirror of
https://github.com/D4C1-Labs/Flipper-ARF.git
synced 2026-03-31 18:26:03 +00:00
Compare commits
2 Commits
dev-937a22
...
dev-d23a89
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d23a892a16 | ||
|
|
16d06d75fe |
@@ -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
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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*
|
||||
|
||||
|
Reference in New Issue
Block a user