mirror of
https://protopirate.net/ProtoPirate/ProtoPirate.git
synced 2026-08-28 03:14:09 +00:00
Vag Encoder WIP
This commit is contained in:
@@ -147,6 +147,17 @@ static bool protopirate_storage_write_capture_data(
|
||||
if(flipper_format_read_uint32(flipper_format, "Type", &uint32_value, 1))
|
||||
flipper_format_write_uint32(save_file, "Type", &uint32_value, 1);
|
||||
|
||||
// VAG Key2 field
|
||||
flipper_format_rewind(flipper_format);
|
||||
uint8_t key2_buf[8];
|
||||
if(flipper_format_read_hex(flipper_format, "Key2", key2_buf, 8))
|
||||
flipper_format_write_hex(save_file, "Key2", key2_buf, 8);
|
||||
|
||||
// VAG KeyIdx field (which key was used)
|
||||
flipper_format_rewind(flipper_format);
|
||||
if(flipper_format_read_uint32(flipper_format, "KeyIdx", &uint32_value, 1))
|
||||
flipper_format_write_uint32(save_file, "KeyIdx", &uint32_value, 1);
|
||||
|
||||
flipper_format_rewind(flipper_format);
|
||||
if(flipper_format_read_uint32(flipper_format, "Seed", &uint32_value, 1))
|
||||
flipper_format_write_uint32(save_file, "Seed", &uint32_value, 1);
|
||||
|
||||
+926
-5
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,7 @@
|
||||
|
||||
extern const SubGhzProtocol vag_protocol;
|
||||
|
||||
// Decoder functions
|
||||
void* subghz_protocol_decoder_vag_alloc(SubGhzEnvironment* environment);
|
||||
void subghz_protocol_decoder_vag_free(void* context);
|
||||
void subghz_protocol_decoder_vag_reset(void* context);
|
||||
@@ -27,3 +28,11 @@ SubGhzProtocolStatus subghz_protocol_decoder_vag_serialize(
|
||||
SubGhzProtocolStatus
|
||||
subghz_protocol_decoder_vag_deserialize(void* context, FlipperFormat* flipper_format);
|
||||
void subghz_protocol_decoder_vag_get_string(void* context, FuriString* output);
|
||||
|
||||
// Encoder functions
|
||||
void* subghz_protocol_encoder_vag_alloc(SubGhzEnvironment* environment);
|
||||
void subghz_protocol_encoder_vag_free(void* context);
|
||||
SubGhzProtocolStatus
|
||||
subghz_protocol_encoder_vag_deserialize(void* context, FlipperFormat* flipper_format);
|
||||
void subghz_protocol_encoder_vag_stop(void* context);
|
||||
LevelDuration subghz_protocol_encoder_vag_yield(void* context);
|
||||
|
||||
@@ -107,9 +107,7 @@ void protopirate_scene_saved_info_on_enter(void* context) {
|
||||
if(flipper_format_read_string(ff, "Protocol", temp_str)) {
|
||||
furi_string_cat_printf(info_str, "Protocol: %s\n", furi_string_get_cstr(temp_str));
|
||||
}
|
||||
if(furi_string_cmp_str(temp_str, "VAG") == 0) {
|
||||
is_emu_off = true;
|
||||
} else if(furi_string_cmp_str(temp_str, "Scher-Khan") == 0) {
|
||||
if(furi_string_cmp_str(temp_str, "Scher-Khan") == 0) {
|
||||
is_emu_off = true;
|
||||
} else if(furi_string_cmp_str(temp_str, "Kia V5") == 0) {
|
||||
is_emu_off = true;
|
||||
@@ -163,6 +161,11 @@ void protopirate_scene_saved_info_on_enter(void* context) {
|
||||
furi_string_cat_printf(info_str, "Type: %02X\n", (uint8_t)temp_data);
|
||||
}
|
||||
|
||||
flipper_format_rewind(ff);
|
||||
if(flipper_format_read_uint32(ff, "KeyIdx", &temp_data, 1)) {
|
||||
furi_string_cat_printf(info_str, "KeyIdx: %d\n", (uint8_t)temp_data);
|
||||
}
|
||||
|
||||
flipper_format_rewind(ff);
|
||||
if(flipper_format_read_string(ff, "Key", temp_str)) {
|
||||
furi_string_cat_printf(info_str, "Key1: %s\n", furi_string_get_cstr(temp_str));
|
||||
|
||||
Reference in New Issue
Block a user