mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Better add manually advanced
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_txrx_create_protocol_key.h"
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#define TAG "SubGhzSetCounter"
|
||||
|
||||
void subghz_scene_set_counter_byte_input_callback(void* context) {
|
||||
@@ -63,6 +65,12 @@ void subghz_scene_set_counter_on_enter(void* context) {
|
||||
furi_assert(byte_ptr);
|
||||
furi_assert(byte_count > 0);
|
||||
|
||||
if(byte_count == 2) {
|
||||
*((uint16_t*)byte_ptr) = __bswap16(*((uint16_t*)byte_ptr)); // Convert
|
||||
} else if(byte_count == 4) {
|
||||
*((uint32_t*)byte_ptr) = __bswap32(*((uint32_t*)byte_ptr)); // Convert
|
||||
}
|
||||
|
||||
// Setup view
|
||||
ByteInput* byte_input = subghz->byte_input;
|
||||
byte_input_set_header_text(byte_input, "Enter COUNTER in hex");
|
||||
@@ -96,7 +104,7 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.keeloq.serial,
|
||||
__bswap32(gen_info.keeloq.serial),
|
||||
gen_info.keeloq.btn,
|
||||
gen_info.keeloq.cnt,
|
||||
gen_info.keeloq.manuf);
|
||||
@@ -106,7 +114,7 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.came_atomo.serial,
|
||||
__bswap32(gen_info.came_atomo.serial),
|
||||
gen_info.came_atomo.cnt);
|
||||
break;
|
||||
case GenAlutechAt4n:
|
||||
@@ -114,7 +122,7 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.alutech_at_4n.serial,
|
||||
__bswap32(gen_info.alutech_at_4n.serial),
|
||||
gen_info.alutech_at_4n.btn,
|
||||
gen_info.alutech_at_4n.cnt);
|
||||
break;
|
||||
@@ -123,7 +131,7 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.somfy_telis.serial,
|
||||
__bswap32(gen_info.somfy_telis.serial),
|
||||
gen_info.somfy_telis.btn,
|
||||
gen_info.somfy_telis.cnt);
|
||||
break;
|
||||
@@ -132,7 +140,7 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.nice_flor_s.serial,
|
||||
__bswap32(gen_info.nice_flor_s.serial),
|
||||
gen_info.nice_flor_s.btn,
|
||||
gen_info.nice_flor_s.cnt,
|
||||
gen_info.nice_flor_s.nice_one);
|
||||
@@ -142,17 +150,17 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.sec_plus_2.serial,
|
||||
__bswap32(gen_info.sec_plus_2.serial),
|
||||
gen_info.sec_plus_2.btn,
|
||||
gen_info.sec_plus_2.cnt);
|
||||
__bswap32(gen_info.sec_plus_2.cnt));
|
||||
break;
|
||||
case GenPhoenixV2:
|
||||
generated_protocol = subghz_txrx_gen_phoenix_v2_protocol(
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.phoenix_v2.serial,
|
||||
gen_info.phoenix_v2.cnt);
|
||||
__bswap32(gen_info.phoenix_v2.serial),
|
||||
__bswap16(gen_info.phoenix_v2.cnt));
|
||||
break;
|
||||
// Not needed for these types
|
||||
case GenData:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_txrx_create_protocol_key.h"
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#define TAG "SubGhzSetKey"
|
||||
|
||||
void subghz_scene_set_key_byte_input_callback(void* context) {
|
||||
@@ -25,6 +27,8 @@ void subghz_scene_set_key_on_enter(void* context) {
|
||||
furi_assert(byte_ptr);
|
||||
furi_assert(byte_count > 0);
|
||||
|
||||
*((uint64_t*)byte_ptr) = __bswap64(*((uint64_t*)byte_ptr)); // Convert
|
||||
|
||||
// Setup view
|
||||
ByteInput* byte_input = subghz->byte_input;
|
||||
byte_input_set_header_text(byte_input, "Enter KEY in hex");
|
||||
@@ -49,7 +53,7 @@ bool subghz_scene_set_key_on_event(void* context, SceneManagerEvent event) {
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.data.name,
|
||||
gen_info.data.key,
|
||||
__bswap64(gen_info.data.key),
|
||||
gen_info.data.bits,
|
||||
gen_info.data.te);
|
||||
} else {
|
||||
@@ -58,7 +62,7 @@ bool subghz_scene_set_key_on_event(void* context, SceneManagerEvent event) {
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.data.name,
|
||||
gen_info.data.key,
|
||||
__bswap64(gen_info.data.key),
|
||||
gen_info.data.bits);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_txrx_create_protocol_key.h"
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#define TAG "SubGhzSetSeed"
|
||||
|
||||
void subghz_scene_set_seed_byte_input_callback(void* context) {
|
||||
@@ -42,6 +44,8 @@ void subghz_scene_set_seed_on_enter(void* context) {
|
||||
furi_assert(byte_ptr);
|
||||
furi_assert(byte_count > 0);
|
||||
|
||||
*((uint32_t*)byte_ptr) = __bswap32(*((uint32_t*)byte_ptr)); // Convert
|
||||
|
||||
// Setup view
|
||||
ByteInput* byte_input = subghz->byte_input;
|
||||
byte_input_set_header_text(byte_input, "Enter SEED in hex");
|
||||
@@ -64,10 +68,10 @@ bool subghz_scene_set_seed_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.faac_slh.serial,
|
||||
__bswap32(gen_info.faac_slh.serial),
|
||||
gen_info.faac_slh.btn,
|
||||
gen_info.faac_slh.cnt,
|
||||
gen_info.faac_slh.seed,
|
||||
__bswap32(gen_info.faac_slh.seed),
|
||||
gen_info.faac_slh.manuf);
|
||||
break;
|
||||
case GenKeeloqBFT:
|
||||
@@ -75,10 +79,10 @@ bool subghz_scene_set_seed_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->txrx,
|
||||
gen_info.mod,
|
||||
gen_info.freq,
|
||||
gen_info.keeloq_bft.serial,
|
||||
__bswap32(gen_info.keeloq_bft.serial),
|
||||
gen_info.keeloq_bft.btn,
|
||||
gen_info.keeloq_bft.cnt,
|
||||
gen_info.keeloq_bft.seed,
|
||||
__bswap32(gen_info.keeloq_bft.seed),
|
||||
gen_info.keeloq_bft.manuf);
|
||||
break;
|
||||
// Not needed for these types
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_txrx_create_protocol_key.h"
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#define TAG "SubGhzSetSerial"
|
||||
|
||||
void subghz_scene_set_serial_byte_input_callback(void* context) {
|
||||
@@ -63,6 +65,8 @@ void subghz_scene_set_serial_on_enter(void* context) {
|
||||
furi_assert(byte_ptr);
|
||||
furi_assert(byte_count > 0);
|
||||
|
||||
*((uint32_t*)byte_ptr) = __bswap32(*((uint32_t*)byte_ptr)); // Convert
|
||||
|
||||
// Setup view
|
||||
ByteInput* byte_input = subghz->byte_input;
|
||||
byte_input_set_header_text(byte_input, "Enter SERIAL in hex");
|
||||
|
||||
@@ -254,8 +254,8 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSetKey);
|
||||
break;
|
||||
case GenSecPlus1: // None
|
||||
return subghz_txrx_gen_secplus_v1_protocol(
|
||||
subghz->txrx, subghz->gen_info->mod, subghz->gen_info->freq);
|
||||
generated_protocol = subghz_scene_set_type_generate_protocol_from_infos(subghz);
|
||||
break;
|
||||
case GenFaacSLH: // Serial (u32), Button (u8), Counter (u8), Seed (u32)
|
||||
case GenKeeloq: // Serial (u32), Button (u8), Counter (u8)
|
||||
case GenCameAtomo: // Serial (u32), Counter (u8)
|
||||
|
||||
Reference in New Issue
Block a user