mirror of
https://github.com/D4C1-Labs/Flipper-ARF.git
synced 2026-03-30 14:25:40 +00:00
Compare commits
1 Commits
dev-2d8f35
...
dev-6507be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6507bed882 |
@@ -1,6 +1,13 @@
|
||||
#include "kia_v0.h"
|
||||
#include "../blocks/custom_btn_i.h"
|
||||
|
||||
static const char* kia_v0_btn_name(uint8_t btn) {
|
||||
if(btn == 0x01) return "Lock";
|
||||
if(btn == 0x02) return "Unlock";
|
||||
if(btn == 0x03) return "Boot";
|
||||
return "?";
|
||||
}
|
||||
|
||||
static uint8_t kia_v0_get_btn_code() {
|
||||
uint8_t custom_btn = subghz_custom_btn_get();
|
||||
uint8_t original_btn = subghz_custom_btn_get_original();
|
||||
@@ -259,6 +266,7 @@ SubGhzProtocolStatus
|
||||
furi_check(context);
|
||||
SubGhzProtocolEncoderKIA* instance = context;
|
||||
|
||||
flipper_format_rewind(flipper_format);
|
||||
instance->encoder.is_running = false;
|
||||
instance->encoder.front = 0;
|
||||
instance->encoder.repeat = 10;
|
||||
@@ -370,8 +378,7 @@ SubGhzProtocolStatus
|
||||
} else {
|
||||
instance->button = (key >> 8) & 0x0F;
|
||||
}
|
||||
if(subghz_custom_btn_get_original() == 0)
|
||||
subghz_custom_btn_set_original(instance->button);
|
||||
subghz_custom_btn_set_original(instance->button);
|
||||
subghz_custom_btn_set_max(4);
|
||||
instance->button = kia_v0_get_btn_code();
|
||||
|
||||
@@ -726,8 +733,7 @@ void subghz_protocol_decoder_kia_get_string(void* context, FuriString* output) {
|
||||
SubGhzProtocolDecoderKIA* instance = context;
|
||||
|
||||
subghz_protocol_kia_check_remote_controller(&instance->generic);
|
||||
if(subghz_custom_btn_get_original() == 0)
|
||||
subghz_custom_btn_set_original(instance->generic.btn);
|
||||
subghz_custom_btn_set_original(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;
|
||||
@@ -740,14 +746,14 @@ void subghz_protocol_decoder_kia_get_string(void* context, FuriString* output) {
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%08lX%08lX\r\n"
|
||||
"Sn:%07lX Btn:%X Cnt:%04lX\r\n"
|
||||
"Sn:%07lX Btn:[%s] Cnt:%04lX\r\n"
|
||||
"CRC:%02X %s\r\n",
|
||||
instance->generic.protocol_name,
|
||||
instance->generic.data_count_bit,
|
||||
code_found_hi,
|
||||
code_found_lo,
|
||||
instance->generic.serial,
|
||||
kia_v0_get_btn_code(),
|
||||
kia_v0_btn_name(kia_v0_get_btn_code()),
|
||||
instance->generic.cnt,
|
||||
received_crc,
|
||||
crc_valid ? "(OK)" : "(FAIL)");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "kia_generic.h"
|
||||
|
||||
|
||||
#define KIA_PROTOCOL_V0_NAME "Kia V0"
|
||||
#define KIA_PROTOCOL_V0_NAME "KIA/HYU V0"
|
||||
|
||||
typedef struct SubGhzProtocolDecoderKIA SubGhzProtocolDecoderKIA;
|
||||
typedef struct SubGhzProtocolEncoderKIA SubGhzProtocolEncoderKIA;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "kia_generic.h"
|
||||
|
||||
|
||||
#define KIA_PROTOCOL_V1_NAME "Kia V1"
|
||||
#define KIA_PROTOCOL_V1_NAME "KIA/HYU V1"
|
||||
|
||||
typedef struct SubGhzProtocolDecoderKiaV1 SubGhzProtocolDecoderKiaV1;
|
||||
typedef struct SubGhzProtocolEncoderKiaV1 SubGhzProtocolEncoderKiaV1;
|
||||
|
||||
@@ -265,8 +265,7 @@ SubGhzProtocolStatus
|
||||
} else {
|
||||
instance->generic.btn = (uint8_t)((instance->generic.data >> 16) & 0x0F);
|
||||
}
|
||||
if(subghz_custom_btn_get_original() == 0)
|
||||
subghz_custom_btn_set_original(instance->generic.btn);
|
||||
subghz_custom_btn_set_original(instance->generic.btn);
|
||||
subghz_custom_btn_set_max(4);
|
||||
instance->generic.btn = kia_v2_get_btn_code();
|
||||
|
||||
@@ -538,8 +537,7 @@ SubGhzProtocolStatus
|
||||
void kia_protocol_decoder_v2_get_string(void* context, FuriString* output) {
|
||||
furi_check(context);
|
||||
SubGhzProtocolDecoderKiaV2* instance = context;
|
||||
if(subghz_custom_btn_get_original() == 0)
|
||||
subghz_custom_btn_set_original(instance->generic.btn);
|
||||
subghz_custom_btn_set_original(instance->generic.btn);
|
||||
subghz_custom_btn_set_max(4);
|
||||
|
||||
uint8_t crc = instance->generic.data & 0x0F;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <lib/toolbox/manchester_decoder.h>
|
||||
|
||||
|
||||
#define KIA_PROTOCOL_V2_NAME "Kia V2"
|
||||
#define KIA_PROTOCOL_V2_NAME "KIA/HYU V2"
|
||||
|
||||
typedef struct SubGhzProtocolDecoderKiaV2 SubGhzProtocolDecoderKiaV2;
|
||||
typedef struct SubGhzProtocolEncoderKiaV2 SubGhzProtocolEncoderKiaV2;
|
||||
|
||||
Reference in New Issue
Block a user