Compare commits

...

15 Commits

Author SHA1 Message Date
Andrea
e116abaa9b Revise keyfob emulation details and update To Do list
Updated the README to reflect changes in keyfob emulation and Keeloq Key Manager status.
2026-03-11 21:20:18 +01:00
Andrea Santaniello
fd9564e301 Citations [wip] 2026-03-11 20:47:31 +01:00
Andrea Santaniello
de133ebe09 Merge branch 'main' of https://github.com/D4C1-Labs/Flipper-ARF 2026-03-11 19:39:04 +01:00
Andrea Santaniello
fc03342591 Issue templates 2026-03-11 19:30:14 +01:00
David
bfdf60944f Remove unused fields from Kia V5 protocol 2026-03-11 18:48:03 +01:00
David
0290f601a0 Remove NULL function pointers from Kia V3/V4 protocol
Removed unused function pointers from the Kia V3/V4 protocol structure.
2026-03-11 18:47:07 +01:00
David
2e5648f3f4 Refactor Kia V5 protocol functions and includes 2026-03-11 17:59:35 +01:00
David
cffd268950 Update 2026-03-11 17:59:14 +01:00
David
ddb85d034f Refactor Kia V3/V4 protocol functions and types 2026-03-11 17:58:44 +01:00
David
55f770328c Update 2026-03-11 17:58:20 +01:00
Andrea Santaniello
75a5334a9b Merge branch 'main' of https://github.com/D4C1-Labs/Flipper-ARF 2026-03-11 17:39:27 +01:00
Andrea Santaniello
696041410b Fixes 2026-03-11 17:38:35 +01:00
Andrea
72d3992092 Update Fiat Mystery to Fiat Marelli in README 2026-03-11 15:01:14 +01:00
Andrea Santaniello
c1d145c9cc Updated fiat mistery (magneti marelli BSI) 2026-03-11 14:48:19 +01:00
d4rks1d33
6507bed882 Kia V0/V1/V2 now fully working 2026-03-10 13:36:26 -03:00
18 changed files with 1177 additions and 1082 deletions

View File

@@ -1,45 +1,77 @@
name: Bug report
description: File a bug reports regarding the firmware.
name: Bug Report
description: Report a bug in Flipper-ARF firmware.
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out an issue, this template is meant for any issues related to the Flipper Zero unleashed firmware.
Thanks for reporting a bug in Flipper-ARF. Please fill in as much detail as possible.
- type: input
id: firmware-version
attributes:
label: Firmware version
description: "ARF version or git commit hash."
placeholder: "e.g. ARF 0.1.2 or commit abc1234"
validations:
required: true
- type: dropdown
id: hardware
attributes:
label: Hardware setup
description: "Which hardware configuration are you using?"
options:
- Flipper Zero (stock)
- Flipper Zero (modded antenna)
- Flipper Zero + external CC1101
- Other (describe below)
validations:
required: true
- type: input
id: protocol
attributes:
label: Protocol affected
description: "Which protocol is affected, if applicable?"
placeholder: "e.g. Kia V3/V4, PSA GROUP, Keeloq, Fiat Mystery"
- type: input
id: frequency
attributes:
label: Frequency & modulation
description: "RF frequency and modulation used, if relevant."
placeholder: "e.g. 433.92 MHz AM"
- type: textarea
id: description
attributes:
label: Describe the bug.
description: "A clear and concise description of what the bug is."
label: Bug description
description: "A clear and concise description of the bug."
validations:
required: true
- type: textarea
id: repro
attributes:
label: Reproduction
label: Steps to reproduce
description: "How can this bug be reproduced?"
placeholder: |
1. Switch on...
2. Press button '....'
3. Wait for the moon phase
4. It burns
1. Open SubGhz app
2. Load saved .sub file
3. Press Send
4. Observe error / unexpected behavior
validations:
required: true
- type: input
id: target
- type: textarea
id: expected
attributes:
label: Target
description: Specify the target
# Target seems to be largely ignored by outside sources.
label: Expected vs actual behavior
description: "What did you expect to happen, and what actually happened?"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: Attach your debug logs here
label: Logs / screenshots
description: "Attach debug logs (via serial CLI) or screenshots if available."
render: Text
# Avoid rendering as Markdown here.
- type: textarea
id: anything-else
attributes:
label: Anything else?
description: Let us know if you have anything else to share.
label: Additional context
description: "Any other information that might help (vehicle model, .sub file contents, etc.)."

View File

@@ -1,20 +0,0 @@
name: Enhancements
description: Suggest improvements for any existing functionality within the firmware.
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out an issue. This template is meant for feature requests and improvements to already existing functionality.
- type: textarea
id: proposal
attributes:
label: "Describe the enhancement you're suggesting."
description: |
Feel free to describe in as much detail as you wish.
validations:
required: true
- type: textarea
id: anything-else
attributes:
label: Anything else?
description: Let us know if you have anything else to share.

View File

@@ -1,23 +1,46 @@
name: Feature Request
description: For feature requests regarding the firmware.
description: Suggest a new feature or improvement for Flipper-ARF.
labels: ["feature request"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out an issue, this template is meant for any feature suggestions.
- type: textarea
id: proposal
Thanks for suggesting a feature for Flipper-ARF. Please describe your idea in detail.
- type: dropdown
id: category
attributes:
label: "Description of the feature you're suggesting."
description: |
Please describe your feature request in as many details as possible.
- Describe what it should do.
- Note whetever it is to extend existing functionality or introduce new functionality.
label: Category
description: "What area does this feature fall under?"
options:
- New protocol
- Protocol improvement
- UI / UX
- Build system / tooling
- Other
validations:
required: true
- type: input
id: manufacturer
attributes:
label: Manufacturer / protocol
description: "Which manufacturer or protocol is this related to, if applicable?"
placeholder: "e.g. Toyota, Renault, Keeloq"
- type: textarea
id: description
attributes:
label: Description
description: "Describe the feature you're suggesting."
validations:
required: true
- type: textarea
id: use-case
attributes:
label: Use case
description: "Why is this needed? What problem does it solve?"
validations:
required: true
- type: textarea
id: anything-else
attributes:
label: Anything else?
description: Let us know if you have anything else to share.
label: Additional context
description: "Any references, datasheets, links, or examples that support this request."

View File

@@ -0,0 +1,111 @@
name: Protocol / Algorithm Submission
description: Submit a new protocol decoder, encoder, or cipher implementation.
labels: ["protocol", "contribution"]
body:
- type: markdown
attributes:
value: |
Use this template to submit a new protocol implementation or algorithm for inclusion in Flipper-ARF.
Include as much technical detail as possible — timing, frame structure, cipher type, and test captures.
- type: input
id: protocol-name
attributes:
label: Protocol name
description: "Name for the protocol (as it should appear in the firmware)."
placeholder: "e.g. Renault V2, Opel Corsa, Nissan V0"
validations:
required: true
- type: input
id: manufacturer
attributes:
label: Manufacturer / vehicle
description: "Which manufacturer or vehicles use this protocol?"
placeholder: "e.g. Renault Clio 2010-2018, Opel/Vauxhall Corsa D"
validations:
required: true
- type: input
id: frequency
attributes:
label: Frequency & modulation
description: "RF frequency and modulation type."
placeholder: "e.g. 433.92 MHz FM (FSK)"
validations:
required: true
- type: dropdown
id: encoding
attributes:
label: Encoding
description: "How are bits encoded in the RF signal?"
options:
- PWM (Pulse Width Modulation)
- Manchester
- Differential Manchester
- OOK raw
- Other (describe in frame structure)
validations:
required: true
- type: textarea
id: timing
attributes:
label: Timing parameters
description: "Provide timing values for the protocol."
placeholder: |
te_short: 400 us
te_long: 800 us
te_delta: 150 us
Preamble: 16 pairs of alternating short pulses
Sync: 1200 us HIGH
Gap: 10000 us between bursts
validations:
required: true
- type: textarea
id: frame-structure
attributes:
label: Frame structure
description: "Describe the bit layout — field positions, sizes, fixed vs rolling parts."
placeholder: |
Total bits: 68
Bits 0-31: Encrypted (KeeLoq)
Bits 32-59: Serial (28 bits)
Bits 60-63: Button code (4 bits)
Bits 64-67: CRC (4 bits, XOR of nibbles)
validations:
required: true
- type: dropdown
id: cipher
attributes:
label: Cipher / rolling code type
description: "What cipher or rolling code scheme does this protocol use?"
options:
- None (static code)
- KeeLoq
- AES
- TEA / XTEA
- Hitag2
- Custom / proprietary
- Unknown (needs analysis)
validations:
required: true
- type: dropdown
id: status
attributes:
label: Implementation status
description: "How far along is the implementation?"
options:
- Concept only (analysis / documentation)
- Decoder working
- Encoder working
- Both decoder and encoder working
validations:
required: true
- type: textarea
id: captures
attributes:
label: Test captures
description: "Paste .sub file contents or raw pulse data for validation. Attach files if too large."
render: Text
- type: textarea
id: references
attributes:
label: References
description: "Links to datasheets, research papers, FCC filings, or related projects."

View File

@@ -0,0 +1,99 @@
name: Key Recording Submission
description: Contribute captured keyfob recordings for protocol analysis.
labels: ["recording", "data"]
body:
- type: markdown
attributes:
value: |
Use this template to submit captured keyfob recordings (.sub files or raw data).
These recordings help with protocol reverse engineering, decoder validation, and cipher analysis.
**Tips for useful captures:**
- Record 10+ sequential presses per button without long gaps
- Note the exact button pressed for each capture
- If possible, capture from multiple buttons on the same fob
- Include the vehicle make, model, and year
- type: input
id: vehicle
attributes:
label: Vehicle / device
description: "Make, model, year, and any relevant trim info."
placeholder: "e.g. 2015 Fiat Panda 1.2 Pop"
validations:
required: true
- type: dropdown
id: protocol
attributes:
label: Protocol (if known)
description: "Which protocol was detected, or select Unknown if not yet identified."
options:
- Unknown / new protocol
- VAG GROUP
- Cayenne
- PSA GROUP
- Ford V0
- Fiat SpA
- Fiat Mystery
- Subaru
- Siemens (Mazda)
- Kia V0
- Kia V1
- Kia V2
- Kia V3/V4
- Kia V5
- Kia V6
- Suzuki
- Mitsubishi V0
- Keeloq
- Other (specify below)
validations:
required: true
- type: input
id: frequency
attributes:
label: Frequency & modulation used
description: "The frequency and modulation setting used during capture."
placeholder: "e.g. 433.92 MHz AM650"
validations:
required: true
- type: input
id: buttons
attributes:
label: Button / function
description: "Which buttons were recorded and what they do."
placeholder: "e.g. Lock (Btn A), Unlock (Btn B), Trunk (Btn C)"
validations:
required: true
- type: input
id: num-captures
attributes:
label: Number of captures
description: "How many presses were recorded per button?"
placeholder: "e.g. 10 sequential presses per button"
validations:
required: true
- type: dropdown
id: capture-method
attributes:
label: Capture method
description: "How were the signals captured?"
options:
- SubGhz Read RAW
- SubGhz decoded (saved .sub)
- External SDR (HackRF, RTL-SDR, etc.)
- Other
validations:
required: true
- type: textarea
id: capture-data
attributes:
label: Capture data
description: "Paste .sub file contents here, or attach files. For multiple files, use separate code blocks labeled by button."
render: Text
validations:
required: true
- type: textarea
id: notes
attributes:
label: Notes
description: "Any observations — counter gaps, time between captures, battery changes, multiple fobs, etc."

View File

@@ -1,8 +1 @@
blank_issues_enabled: true
contact_links:
- name: Telegram
url: https://t.me/flipperzero_unofficial
about: Unofficial Telegram chat
- name: Discord
url: https://discord.unleashedflip.com
about: Unofficial Discord Community

View File

@@ -1,13 +1,25 @@
# What's new
## Summary
- [ Describe changes here ]
<!-- What changed and why? Keep it concise. -->
# Verification
## Protocol(s) affected
- [ Describe how to verify changes ]
<!-- Which protocol(s) does this PR touch? e.g. Kia V3/V4, PSA GROUP, none -->
# Checklist (For Reviewer)
## Type of change
- [ ] PR has description of feature/bug
- [ ] Description contains actions to verify feature/bugfix
- [ ] I've built this code, uploaded it to the device and verified feature/bugfix
- [ ] Bug fix
- [ ] New protocol
- [ ] Protocol improvement (encoder/decoder/display)
- [ ] Build system / infrastructure
- [ ] Other
## Testing
<!-- How was this verified? Include hardware used, captures tested, etc. -->
## Checklist
- [ ] Built with `./fbt COMPACT=1 DEBUG=0 updater_package` (no errors)
- [ ] Flashed and tested on Flipper Zero
- [ ] No regressions in other protocols

View File

@@ -34,7 +34,7 @@ This project may incorporate, adapt, or build upon **other open-source projects*
| PSA (Peugeot/Citroën/DS) | PSA GROUP | 433 MHz | AM/FM | Yes | Yes |
| Ford | Ford V0 | 315/433 MHz | AM | Yes | Yes |
| Fiat | Fiat SpA | 433 MHz | AM | Yes | Yes |
| Fiat | Fiat Mystery | 433 MHz | AM | No | Yes |
| Fiat | Fiat Marelli | 433 MHz | AM | No | Yes |
| Subaru | Subaru | 433 MHz | AM | Yes | Yes |
| Mazda | Siemens (5WK49365D) | 315/433 MHz | FM | Yes | Yes |
| Kia/Hyundai | Kia V0 | 433 MHz | FM | Yes | Yes |
@@ -123,14 +123,14 @@ Flipper-ARF aims to achieve:
- [x] D-Pad mapping (Lock / Unlock / Boot / Trunk) during emulation
- [x] VAG MFKey support and updated Keeloq codes
- [x] PSA XTEA brute force for saved → emulation workflow
- [x] Brute force of counter in saved → emulation scene for smoother keyfob emulation
- [x] Brute force of counter in saved → can be accellerated trough the companion app via bluetooth
- [x] RollJam app (Internal CC1101 for RX & TX captured signal; External CC1101 for jamming) — requires more real-world testing
---
## To Do / Planned Features
- [ ] Keeloq Key Manager inside firmware
- [X] Keeloq Key Manager inside firmware
- [ ] Add Scher Khan & Starline protocols
- [ ] Fix and reintegrate RollJam app (future updates)
- [ ] Expand and refine Subaru, Kia, PSA, and other manufacturer protocols
@@ -175,7 +175,54 @@ Contributions are welcome if they:
> Non-automotive features are considered out-of-scope for now.
### This code is a mess!
![Talk is cheap, submit patches](arf_pictures/send_patches.jpeg)
![Talk is cheap, submit patches](arf_pictures/send_patches.jpeg)
---
## Citations & References
The following academic publications have been invaluable to the development and understanding of the protocols implemented in this firmware.
### Automotive RKE Security
- **Lock It and Still Lose It — On the (In)Security of Automotive Remote Keyless Entry Systems**
Flavio D. Garcia, David Oswald, Timo Kasper, Pierre Pavlidès
*USENIX Security 2016*
https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_garcia.pdf
- **Clonable Key Fobs: Analyzing and Breaking RKE Protocols**
Roberto Gesteira-Miñarro, Gregorio López, Rafael Palacios
*International Journal of Information Security, Springer, May 2025, 24(3)*
DOI: [10.1007/s10207-025-01063-7](https://doi.org/10.1007/s10207-025-01063-7)
- **The Role of Cryptographic Techniques in Remote Keyless Entry (RKE) Systems**
Jananga Chiran — Sri Lanka Institute of Information Technology
*November 2023*
DOI: [10.5281/zenodo.14677864](https://doi.org/10.5281/zenodo.14677864)
### Immobiliser & Transponder Systems
- **Dismantling DST80-based Immobiliser Systems**
Lennert Wouters, Jan Van den Herrewegen, Flavio D. Garcia, David Oswald, Benedikt Gierlichs, Bart Preneel
*IACR Transactions on Cryptographic Hardware and Embedded Systems (TCHES), 2020, Vol. 2*
DOI: [10.13154/tches.v2020.i2.99-127](https://doi.org/10.13154/tches.v2020.i2.99-127)
### RFID & Protocol Analysis Tooling
- **A Toolbox for RFID Protocol Analysis**
Flavio D. Garcia
*IEEE International Conference on RFID, 2012*
DOI: [10.1109/rfid.2012.19](https://doi.org/10.1109/rfid.2012.19)
### Relay & Replay Attacks
- **Implementing and Testing RollJam on Software-Defined Radios**
*Università di Bologna (UNIBO), CRIS*
https://cris.unibo.it/handle/11585/999874
- **Enhanced Vehicular Roll-Jam Attack Using a Known Noise Source**
*Inaugural International Symposium on Vehicle Security & Privacy, January 2023*
DOI: [10.14722/vehiclesec.2023.23037](https://doi.org/10.14722/vehiclesec.2023.23037)
---
# Disclaimer

View File

@@ -4,18 +4,26 @@
#define TAG "FiatMystery"
// Fiat Panda "pandarella e tonino":
// te_short ~260us, te_long ~520us (Manchester)
// Suspected Magneti Marelli BSI keyfob protocol
// Found on: Fiat Panda (and possibly other Fiat/Lancia/Alfa ~2003-2012)
//
// RF: 433.92 MHz, Manchester encoding
// te_short ~260us, te_long ~520us
// Preamble: ~191 short-short pairs (alternating 260us HIGH/LOW)
// Gap: ~3126us LOW
// Sync: ~2065us HIGH
// Data: 86 Manchester bits
// Retransmissions: 7-8 per press
// Data: 88 Manchester bits (often decoded as 104 with 16-bit 0xFFFF preamble residue)
// Retransmissions: 7-10 per press
//
// Frame layout (after stripping 16-bit 0xFFFF preamble):
// Bytes 0-3: Fixed ID / Serial (32 bits)
// Byte 4: Button (upper nibble) | Type (lower nibble, always 0x2)
// Bytes 5-10: Rolling/encrypted code (48 bits)
#define FIAT_MYSTERY_PREAMBLE_MIN 200 // Min preamble pulses (100 pairs)
#define FIAT_MYSTERY_GAP_MIN 2500 // Gap detection threshold (us)
#define FIAT_MYSTERY_SYNC_MIN 1500 // Sync pulse minimum (us)
#define FIAT_MYSTERY_SYNC_MAX 2600 // Sync pulse maximum (us)
#define FIAT_MYSTERY_MAX_DATA_BITS 96 // Max data bits to collect
#define FIAT_MYSTERY_MAX_DATA_BITS 104 // Max data bits to collect (13 bytes)
static const SubGhzBlockConst subghz_protocol_fiat_mystery_const = {
.te_short = 260,
@@ -31,7 +39,7 @@ struct SubGhzProtocolDecoderFiatMystery {
ManchesterState manchester_state;
uint8_t decoder_state;
uint16_t preamble_count;
uint8_t raw_data[12]; // Up to 96 bits (12 bytes)
uint8_t raw_data[13]; // Up to 104 bits (13 bytes)
uint8_t bit_count;
uint32_t extra_data; // Bits beyond first 64, right-aligned
uint32_t te_last;
@@ -292,13 +300,20 @@ void subghz_protocol_decoder_fiat_mystery_feed(void* context, bool level, uint32
if(frame_complete) {
instance->generic.data_count_bit = instance->bit_count;
// Frame layout: bytes 0-1 are 0xFFFF preamble residue
// Bytes 2-5: Fixed ID (serial)
// Byte 6: Button (upper nibble) | subtype (lower nibble)
// Bytes 7-12: Rolling/encrypted code (48 bits)
instance->generic.serial =
((uint32_t)instance->raw_data[4] << 24) |
((uint32_t)instance->raw_data[5] << 16) |
((uint32_t)instance->raw_data[6] << 8) |
((uint32_t)instance->raw_data[7]);
instance->generic.cnt = (uint32_t)(instance->generic.data >> 32);
instance->generic.btn = 0;
((uint32_t)instance->raw_data[2] << 24) |
((uint32_t)instance->raw_data[3] << 16) |
((uint32_t)instance->raw_data[4] << 8) |
((uint32_t)instance->raw_data[5]);
instance->generic.btn = (instance->raw_data[6] >> 4) & 0xF;
instance->generic.cnt =
((uint32_t)instance->raw_data[7] << 16) |
((uint32_t)instance->raw_data[8] << 8) |
((uint32_t)instance->raw_data[9]);
FURI_LOG_I(
TAG,
@@ -385,22 +400,41 @@ SubGhzProtocolStatus subghz_protocol_decoder_fiat_mystery_deserialize(
return ret;
}
static const char* fiat_mystery_button_name(uint8_t btn) {
switch(btn) {
case 0x2:
return "Btn A";
case 0x4:
return "Btn B";
default:
return "Unknown";
}
}
void subghz_protocol_decoder_fiat_mystery_get_string(void* context, FuriString* output) {
furi_check(context);
SubGhzProtocolDecoderFiatMystery* instance = context;
uint8_t total_bytes = (instance->bit_count + 7) / 8;
if(total_bytes > 12) total_bytes = 12;
if(total_bytes > 13) total_bytes = 13;
furi_string_cat_printf(
output,
"%s %dbit\r\n"
"Key:%08lX%08lX\r\n"
"Sn:%08lX Btn:%s(0x%X)\r\n"
"Roll:%02X%02X%02X%02X%02X%02X\r\n"
"Data:",
instance->generic.protocol_name,
instance->bit_count,
(uint32_t)(instance->generic.data >> 32),
(uint32_t)(instance->generic.data & 0xFFFFFFFF));
instance->generic.serial,
fiat_mystery_button_name(instance->generic.btn),
instance->generic.btn,
instance->raw_data[7],
instance->raw_data[8],
instance->raw_data[9],
(total_bytes > 10) ? instance->raw_data[10] : 0,
(total_bytes > 11) ? instance->raw_data[11] : 0,
(total_bytes > 12) ? instance->raw_data[12] : 0);
for(uint8_t i = 0; i < total_bytes; i++) {
furi_string_cat_printf(output, "%02X", instance->raw_data[i]);

View File

@@ -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)");

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +1,31 @@
#pragma once
#include "kia_generic.h"
#include "base.h"
#include "../blocks/math.h"
#define SUBGHZ_PROTOCOL_KIA_V3_V4_NAME "KIA/HYU V3/V4"
#define KIA_PROTOCOL_V3_V4_NAME "Kia V3/V4"
typedef struct SubGhzProtocolDecoderKiaV3V4 SubGhzProtocolDecoderKiaV3V4;
typedef struct SubGhzProtocolEncoderKiaV3V4 SubGhzProtocolEncoderKiaV3V4;
extern const SubGhzProtocol subghz_protocol_kia_v3_v4;
// Decoder functions
void* kia_protocol_decoder_v3_v4_alloc(SubGhzEnvironment* environment);
void kia_protocol_decoder_v3_v4_free(void* context);
void kia_protocol_decoder_v3_v4_reset(void* context);
void kia_protocol_decoder_v3_v4_feed(void* context, bool level, uint32_t duration);
uint8_t kia_protocol_decoder_v3_v4_get_hash_data(void* context);
SubGhzProtocolStatus kia_protocol_decoder_v3_v4_serialize(
void* subghz_protocol_decoder_kia_v3_v4_alloc(SubGhzEnvironment* environment);
void subghz_protocol_decoder_kia_v3_v4_free(void* context);
void subghz_protocol_decoder_kia_v3_v4_reset(void* context);
void subghz_protocol_decoder_kia_v3_v4_feed(void* context, bool level, uint32_t duration);
uint8_t subghz_protocol_decoder_kia_v3_v4_get_hash_data(void* context);
SubGhzProtocolStatus subghz_protocol_decoder_kia_v3_v4_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzRadioPreset* preset);
SubGhzProtocolStatus
kia_protocol_decoder_v3_v4_deserialize(void* context, FlipperFormat* flipper_format);
void kia_protocol_decoder_v3_v4_get_string(void* context, FuriString* output);
subghz_protocol_decoder_kia_v3_v4_deserialize(void* context, FlipperFormat* flipper_format);
void subghz_protocol_decoder_kia_v3_v4_get_string(void* context, FuriString* output);
// Encoder functions
void* kia_protocol_encoder_v3_v4_alloc(SubGhzEnvironment* environment);
void kia_protocol_encoder_v3_v4_free(void* context);
void* subghz_protocol_encoder_kia_v3_v4_alloc(SubGhzEnvironment* environment);
void subghz_protocol_encoder_kia_v3_v4_free(void* context);
SubGhzProtocolStatus
kia_protocol_encoder_v3_v4_deserialize(void* context, FlipperFormat* flipper_format);
void kia_protocol_encoder_v3_v4_stop(void* context);
LevelDuration kia_protocol_encoder_v3_v4_yield(void* context);
// Encoder helper functions for UI
void kia_protocol_encoder_v3_v4_set_button(void* context, uint8_t button);
void kia_protocol_encoder_v3_v4_set_counter(void* context, uint16_t counter);
void kia_protocol_encoder_v3_v4_increment_counter(void* context);
uint16_t kia_protocol_encoder_v3_v4_get_counter(void* context);
uint8_t kia_protocol_encoder_v3_v4_get_button(void* context);
subghz_protocol_encoder_kia_v3_v4_deserialize(void* context, FlipperFormat* flipper_format);
void subghz_protocol_encoder_kia_v3_v4_stop(void* context);
LevelDuration subghz_protocol_encoder_kia_v3_v4_yield(void* context);

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,36 @@
#pragma once
#include "kia_generic.h"
#include <lib/toolbox/manchester_decoder.h>
#include "base.h"
#include "../blocks/math.h"
#define KIA_PROTOCOL_V5_NAME "Kia V5"
#define SUBGHZ_PROTOCOL_KIA_V5_NAME "KIA/HYU V5"
typedef struct SubGhzProtocolDecoderKiaV5 SubGhzProtocolDecoderKiaV5;
typedef struct SubGhzProtocolEncoderKiaV5 SubGhzProtocolEncoderKiaV5;
extern const SubGhzProtocolDecoder kia_protocol_v5_decoder;
extern const SubGhzProtocolEncoder kia_protocol_v5_encoder;
extern const SubGhzProtocol subghz_protocol_kia_v5;
// Decoder functions
void* kia_protocol_decoder_v5_alloc(SubGhzEnvironment* environment);
void kia_protocol_decoder_v5_free(void* context);
void kia_protocol_decoder_v5_reset(void* context);
void kia_protocol_decoder_v5_feed(void* context, bool level, uint32_t duration);
uint8_t kia_protocol_decoder_v5_get_hash_data(void* context);
SubGhzProtocolStatus kia_protocol_decoder_v5_serialize(
void* subghz_protocol_decoder_kia_v5_alloc(SubGhzEnvironment* environment);
void subghz_protocol_decoder_kia_v5_free(void* context);
void subghz_protocol_decoder_kia_v5_reset(void* context);
void subghz_protocol_decoder_kia_v5_feed(void* context, bool level, uint32_t duration);
uint8_t subghz_protocol_decoder_kia_v5_get_hash_data(void* context);
SubGhzProtocolStatus subghz_protocol_decoder_kia_v5_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzRadioPreset* preset);
SubGhzProtocolStatus
kia_protocol_decoder_v5_deserialize(void* context, FlipperFormat* flipper_format);
void kia_protocol_decoder_v5_get_string(void* context, FuriString* output);
subghz_protocol_decoder_kia_v5_deserialize(void* context, FlipperFormat* flipper_format);
void subghz_protocol_decoder_kia_v5_get_string(void* context, FuriString* output);
// Encoder functions
void* kia_protocol_encoder_v5_alloc(SubGhzEnvironment* environment);
void kia_protocol_encoder_v5_free(void* context);
void* subghz_protocol_encoder_kia_v5_alloc(SubGhzEnvironment* environment);
void subghz_protocol_encoder_kia_v5_free(void* context);
SubGhzProtocolStatus
kia_protocol_encoder_v5_deserialize(void* context, FlipperFormat* flipper_format);
void kia_protocol_encoder_v5_stop(void* context);
LevelDuration kia_protocol_encoder_v5_yield(void* context);
subghz_protocol_encoder_kia_v5_deserialize(void* context, FlipperFormat* flipper_format);
void subghz_protocol_encoder_kia_v5_stop(void* context);
LevelDuration subghz_protocol_encoder_kia_v5_yield(void* context);
void subghz_protocol_encoder_kia_v5_set_button(void* context, uint8_t button);
void subghz_protocol_encoder_kia_v5_set_counter(void* context, uint16_t counter);
void subghz_protocol_encoder_kia_v5_increment_counter(void* context);
uint16_t subghz_protocol_encoder_kia_v5_get_counter(void* context);
uint8_t subghz_protocol_encoder_kia_v5_get_button(void* context);