[FL-2279] IR doxygen, rename irda -> infrared (#1010)
* IR: Doxygen docs, some rename * Rename irda -> infrared * Rollback collateral renames Co-authored-by: あく <alleteam@gmail.com>
2
.github/CODEOWNERS
vendored
|
@ -14,7 +14,7 @@ applications/gui/** @skotopes @DrZlo13
|
|||
applications/gui-test/** @skotopes @DrZlo13
|
||||
applications/ibutton/** @skotopes @DrZlo13
|
||||
applications/input/** @skotopes @DrZlo13
|
||||
applications/irda/** @skotopes @DrZlo13 @albkharisov
|
||||
applications/infrared/** @skotopes @DrZlo13
|
||||
applications/lf-rfid/** @skotopes @DrZlo13
|
||||
applications/menu/** @skotopes @DrZlo13
|
||||
applications/music-player/** @skotopes @DrZlo13
|
||||
|
|
2
Makefile
|
@ -13,7 +13,7 @@ PROJECT_SOURCE_DIRECTORIES := \
|
|||
$(PROJECT_ROOT)/lib/cyfral \
|
||||
$(PROJECT_ROOT)/lib/drivers \
|
||||
$(PROJECT_ROOT)/lib/flipper_file \
|
||||
$(PROJECT_ROOT)/lib/irda \
|
||||
$(PROJECT_ROOT)/lib/infrared \
|
||||
$(PROJECT_ROOT)/lib/nfc_protocols \
|
||||
$(PROJECT_ROOT)/lib/ST25RFAL002 \
|
||||
$(PROJECT_ROOT)/lib/onewire \
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
- `gui` - GUI service and API
|
||||
- `ibutton` - iButton application, onewire keys and more
|
||||
- `input` - Input service
|
||||
- `irda` - Irda application, controls your IR devices
|
||||
- `irda_monitor` - Irda debug tool
|
||||
- `infrared` - Infrared application, controls your IR devices
|
||||
- `infrared_monitor` - Infrared debug tool
|
||||
- `lfrfid` - LF RFID application
|
||||
- `lfrfid_debug` - LF RFID debug tool
|
||||
- `loader` - Application loader service
|
||||
|
|
|
@ -27,8 +27,8 @@ extern int32_t delay_test_app(void* p);
|
|||
extern int32_t display_test_app(void* p);
|
||||
extern int32_t gpio_app(void* p);
|
||||
extern int32_t ibutton_app(void* p);
|
||||
extern int32_t irda_app(void* p);
|
||||
extern int32_t irda_monitor_app(void* p);
|
||||
extern int32_t infrared_app(void* p);
|
||||
extern int32_t infrared_monitor_app(void* p);
|
||||
extern int32_t keypad_test_app(void* p);
|
||||
extern int32_t lfrfid_app(void* p);
|
||||
extern int32_t lfrfid_debug_app(void* p);
|
||||
|
@ -51,7 +51,7 @@ extern int32_t snake_game_app(void* p);
|
|||
extern void bt_on_system_start();
|
||||
extern void crypto_on_system_start();
|
||||
extern void ibutton_on_system_start();
|
||||
extern void irda_on_system_start();
|
||||
extern void infrared_on_system_start();
|
||||
extern void lfrfid_on_system_start();
|
||||
extern void nfc_on_system_start();
|
||||
extern void storage_on_system_start();
|
||||
|
@ -136,8 +136,8 @@ const FlipperApplication FLIPPER_APPS[] = {
|
|||
{.app = nfc_app, .name = "NFC", .stack_size = 4096, .icon = &A_NFC_14},
|
||||
#endif
|
||||
|
||||
#ifdef APP_IRDA
|
||||
{.app = irda_app, .name = "Infrared", .stack_size = 1024 * 3, .icon = &A_Infrared_14},
|
||||
#ifdef APP_INFRARED
|
||||
{.app = infrared_app, .name = "Infrared", .stack_size = 1024 * 3, .icon = &A_Infrared_14},
|
||||
#endif
|
||||
|
||||
#ifdef APP_GPIO
|
||||
|
@ -164,8 +164,8 @@ const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplicati
|
|||
const FlipperOnStartHook FLIPPER_ON_SYSTEM_START[] = {
|
||||
crypto_on_system_start,
|
||||
|
||||
#ifdef APP_IRDA
|
||||
irda_on_system_start,
|
||||
#ifdef APP_INFRARED
|
||||
infrared_on_system_start,
|
||||
#endif
|
||||
|
||||
#ifdef APP_NFC
|
||||
|
@ -251,8 +251,8 @@ const FlipperApplication FLIPPER_DEBUG_APPS[] = {
|
|||
{.app = uart_echo_app, .name = "Uart Echo", .stack_size = 2048, .icon = NULL},
|
||||
#endif
|
||||
|
||||
#ifdef APP_IRDA_MONITOR
|
||||
{.app = irda_monitor_app, .name = "Irda Monitor", .stack_size = 1024, .icon = NULL},
|
||||
#ifdef APP_INFRARED_MONITOR
|
||||
{.app = infrared_monitor_app, .name = "Infrared Monitor", .stack_size = 1024, .icon = NULL},
|
||||
#endif
|
||||
|
||||
#ifdef APP_SCENED
|
||||
|
|
|
@ -26,7 +26,7 @@ SRV_DESKTOP = 1
|
|||
APP_ARCHIVE = 1
|
||||
APP_GPIO = 1
|
||||
APP_IBUTTON = 1
|
||||
APP_IRDA = 1
|
||||
APP_INFRARED = 1
|
||||
APP_LF_RFID = 1
|
||||
APP_NFC = 1
|
||||
APP_SUBGHZ = 1
|
||||
|
@ -40,7 +40,7 @@ APP_SNAKE_GAME = 1
|
|||
# Debug
|
||||
APP_ACCESSOR = 1
|
||||
APP_BLINK = 1
|
||||
APP_IRDA_MONITOR = 1
|
||||
APP_INFRARED_MONITOR = 1
|
||||
APP_KEYPAD_TEST = 1
|
||||
APP_SD_TEST = 1
|
||||
APP_VIBRO_TEST = 1
|
||||
|
@ -59,9 +59,9 @@ endif
|
|||
# Prefix with APP_*
|
||||
|
||||
|
||||
APP_IRDA_MONITOR ?= 0
|
||||
ifeq ($(APP_IRDA_MONITOR), 1)
|
||||
CFLAGS += -DAPP_IRDA_MONITOR
|
||||
APP_INFRARED_MONITOR ?= 0
|
||||
ifeq ($(APP_INFRARED_MONITOR), 1)
|
||||
CFLAGS += -DAPP_INFRARED_MONITOR
|
||||
SRV_GUI = 1
|
||||
endif
|
||||
|
||||
|
@ -122,9 +122,9 @@ SRV_GUI = 1
|
|||
endif
|
||||
|
||||
|
||||
APP_IRDA ?= 0
|
||||
ifeq ($(APP_IRDA), 1)
|
||||
CFLAGS += -DAPP_IRDA
|
||||
APP_INFRARED ?= 0
|
||||
ifeq ($(APP_INFRARED), 1)
|
||||
CFLAGS += -DAPP_INFRARED
|
||||
SRV_GUI = 1
|
||||
endif
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ static const char* tab_default_paths[] = {
|
|||
[ArchiveTabNFC] = "/any/nfc",
|
||||
[ArchiveTabSubGhz] = "/any/subghz",
|
||||
[ArchiveTabLFRFID] = "/any/lfrfid",
|
||||
[ArchiveTabIrda] = "/any/irda",
|
||||
[ArchiveTabInfrared] = "/any/infrared",
|
||||
[ArchiveTabBadUsb] = "/any/badusb",
|
||||
[ArchiveTabU2f] = "/app:u2f",
|
||||
[ArchiveTabBrowser] = "/any",
|
||||
|
@ -21,7 +21,7 @@ static const char* known_ext[] = {
|
|||
[ArchiveFileTypeNFC] = ".nfc",
|
||||
[ArchiveFileTypeSubGhz] = ".sub",
|
||||
[ArchiveFileTypeLFRFID] = ".rfid",
|
||||
[ArchiveFileTypeIrda] = ".ir",
|
||||
[ArchiveFileTypeInfrared] = ".ir",
|
||||
[ArchiveFileTypeBadUsb] = ".txt",
|
||||
[ArchiveFileTypeU2f] = "?",
|
||||
[ArchiveFileTypeFolder] = "?",
|
||||
|
@ -34,7 +34,7 @@ static const ArchiveFileTypeEnum known_type[] = {
|
|||
[ArchiveTabNFC] = ArchiveFileTypeNFC,
|
||||
[ArchiveTabSubGhz] = ArchiveFileTypeSubGhz,
|
||||
[ArchiveTabLFRFID] = ArchiveFileTypeLFRFID,
|
||||
[ArchiveTabIrda] = ArchiveFileTypeIrda,
|
||||
[ArchiveTabInfrared] = ArchiveFileTypeInfrared,
|
||||
[ArchiveTabBadUsb] = ArchiveFileTypeBadUsb,
|
||||
[ArchiveTabU2f] = ArchiveFileTypeU2f,
|
||||
[ArchiveTabBrowser] = ArchiveFileTypeUnknown,
|
||||
|
|
|
@ -8,7 +8,7 @@ typedef enum {
|
|||
ArchiveFileTypeNFC,
|
||||
ArchiveFileTypeSubGhz,
|
||||
ArchiveFileTypeLFRFID,
|
||||
ArchiveFileTypeIrda,
|
||||
ArchiveFileTypeInfrared,
|
||||
ArchiveFileTypeBadUsb,
|
||||
ArchiveFileTypeU2f,
|
||||
ArchiveFileTypeFolder,
|
||||
|
|
|
@ -12,7 +12,7 @@ static const char* flipper_app_name[] = {
|
|||
[ArchiveFileTypeNFC] = "NFC",
|
||||
[ArchiveFileTypeSubGhz] = "Sub-GHz",
|
||||
[ArchiveFileTypeLFRFID] = "125 kHz RFID",
|
||||
[ArchiveFileTypeIrda] = "Infrared",
|
||||
[ArchiveFileTypeInfrared] = "Infrared",
|
||||
[ArchiveFileTypeBadUsb] = "Bad USB",
|
||||
[ArchiveFileTypeU2f] = "U2F",
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ static const char* ArchiveTabNames[] = {
|
|||
[ArchiveTabNFC] = "NFC",
|
||||
[ArchiveTabSubGhz] = "Sub-GHz",
|
||||
[ArchiveTabLFRFID] = "RFID LF",
|
||||
[ArchiveTabIrda] = "Infrared",
|
||||
[ArchiveTabInfrared] = "Infrared",
|
||||
[ArchiveTabBadUsb] = "Bad USB",
|
||||
[ArchiveTabU2f] = "U2F",
|
||||
[ArchiveTabBrowser] = "Browser"};
|
||||
|
@ -19,7 +19,7 @@ static const Icon* ArchiveItemIcons[] = {
|
|||
[ArchiveFileTypeNFC] = &I_Nfc_10px,
|
||||
[ArchiveFileTypeSubGhz] = &I_sub1_10px,
|
||||
[ArchiveFileTypeLFRFID] = &I_125_10px,
|
||||
[ArchiveFileTypeIrda] = &I_ir_10px,
|
||||
[ArchiveFileTypeInfrared] = &I_ir_10px,
|
||||
[ArchiveFileTypeBadUsb] = &I_badusb_10px,
|
||||
[ArchiveFileTypeU2f] = &I_u2f_10px,
|
||||
[ArchiveFileTypeFolder] = &I_dir_10px,
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef enum {
|
|||
ArchiveTabSubGhz,
|
||||
ArchiveTabLFRFID,
|
||||
ArchiveTabNFC,
|
||||
ArchiveTabIrda,
|
||||
ArchiveTabInfrared,
|
||||
ArchiveTabIButton,
|
||||
ArchiveTabBadUsb,
|
||||
ArchiveTabU2f,
|
||||
|
|
|
@ -108,11 +108,11 @@ static void button_menu_view_draw_callback(Canvas* canvas, void* _model) {
|
|||
ButtonMenuItemArray_it_t it;
|
||||
|
||||
if(active_screen > 0) {
|
||||
canvas_draw_icon(canvas, 28, 1, &I_IrdaArrowUp_4x8);
|
||||
canvas_draw_icon(canvas, 28, 1, &I_InfraredArrowUp_4x8);
|
||||
}
|
||||
|
||||
if(max_screen > active_screen) {
|
||||
canvas_draw_icon(canvas, 28, 123, &I_IrdaArrowDown_4x8);
|
||||
canvas_draw_icon(canvas, 28, 123, &I_InfraredArrowDown_4x8);
|
||||
}
|
||||
|
||||
if(model->header) {
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
#include <furi_hal_delay.h>
|
||||
#include <irda.h>
|
||||
#include <infrared.h>
|
||||
#include <app_template.h>
|
||||
#include <cli/cli.h>
|
||||
#include <cmsis_os2.h>
|
||||
#include <irda_worker.h>
|
||||
#include <infrared_worker.h>
|
||||
#include <furi.h>
|
||||
#include <furi_hal_irda.h>
|
||||
#include <furi_hal_infrared.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <m-string.h>
|
||||
#include <irda_transmit.h>
|
||||
#include <infrared_transmit.h>
|
||||
#include <sys/types.h>
|
||||
#include "../helpers/irda_parser.h"
|
||||
#include "../helpers/infrared_parser.h"
|
||||
|
||||
static void irda_cli_start_ir_rx(Cli* cli, string_t args);
|
||||
static void irda_cli_start_ir_tx(Cli* cli, string_t args);
|
||||
static void infrared_cli_start_ir_rx(Cli* cli, string_t args);
|
||||
static void infrared_cli_start_ir_tx(Cli* cli, string_t args);
|
||||
|
||||
static const struct {
|
||||
const char* cmd;
|
||||
void (*process_function)(Cli* cli, string_t args);
|
||||
} irda_cli_commands[] = {
|
||||
{.cmd = "rx", .process_function = irda_cli_start_ir_rx},
|
||||
{.cmd = "tx", .process_function = irda_cli_start_ir_tx},
|
||||
} infrared_cli_commands[] = {
|
||||
{.cmd = "rx", .process_function = infrared_cli_start_ir_rx},
|
||||
{.cmd = "tx", .process_function = infrared_cli_start_ir_tx},
|
||||
};
|
||||
|
||||
static void signal_received_callback(void* context, IrdaWorkerSignal* received_signal) {
|
||||
static void signal_received_callback(void* context, InfraredWorkerSignal* received_signal) {
|
||||
furi_assert(received_signal);
|
||||
char buf[100];
|
||||
size_t buf_cnt;
|
||||
Cli* cli = (Cli*)context;
|
||||
|
||||
if(irda_worker_signal_is_decoded(received_signal)) {
|
||||
const IrdaMessage* message = irda_worker_get_decoded_signal(received_signal);
|
||||
if(infrared_worker_signal_is_decoded(received_signal)) {
|
||||
const InfraredMessage* message = infrared_worker_get_decoded_signal(received_signal);
|
||||
buf_cnt = sniprintf(
|
||||
buf,
|
||||
sizeof(buf),
|
||||
"%s, A:0x%0*lX, C:0x%0*lX%s\r\n",
|
||||
irda_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(irda_get_protocol_address_length(message->protocol), 4),
|
||||
infrared_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(infrared_get_protocol_address_length(message->protocol), 4),
|
||||
message->address,
|
||||
ROUND_UP_TO(irda_get_protocol_command_length(message->protocol), 4),
|
||||
ROUND_UP_TO(infrared_get_protocol_command_length(message->protocol), 4),
|
||||
message->command,
|
||||
message->repeat ? " R" : "");
|
||||
cli_write(cli, (uint8_t*)buf, buf_cnt);
|
||||
} else {
|
||||
const uint32_t* timings;
|
||||
size_t timings_cnt;
|
||||
irda_worker_get_raw_signal(received_signal, &timings, &timings_cnt);
|
||||
infrared_worker_get_raw_signal(received_signal, &timings, &timings_cnt);
|
||||
|
||||
buf_cnt = sniprintf(buf, sizeof(buf), "RAW, %d samples:\r\n", timings_cnt);
|
||||
cli_write(cli, (uint8_t*)buf, buf_cnt);
|
||||
|
@ -59,39 +59,39 @@ static void signal_received_callback(void* context, IrdaWorkerSignal* received_s
|
|||
}
|
||||
}
|
||||
|
||||
static void irda_cli_start_ir_rx(Cli* cli, string_t args) {
|
||||
IrdaWorker* worker = irda_worker_alloc();
|
||||
irda_worker_rx_start(worker);
|
||||
irda_worker_rx_set_received_signal_callback(worker, signal_received_callback, cli);
|
||||
static void infrared_cli_start_ir_rx(Cli* cli, string_t args) {
|
||||
InfraredWorker* worker = infrared_worker_alloc();
|
||||
infrared_worker_rx_start(worker);
|
||||
infrared_worker_rx_set_received_signal_callback(worker, signal_received_callback, cli);
|
||||
|
||||
printf("Receiving IRDA...\r\nPress Ctrl+C to abort\r\n");
|
||||
printf("Receiving INFRARED...\r\nPress Ctrl+C to abort\r\n");
|
||||
while(!cli_cmd_interrupt_received(cli)) {
|
||||
delay(50);
|
||||
}
|
||||
|
||||
irda_worker_rx_stop(worker);
|
||||
irda_worker_free(worker);
|
||||
infrared_worker_rx_stop(worker);
|
||||
infrared_worker_free(worker);
|
||||
}
|
||||
|
||||
static void irda_cli_print_usage(void) {
|
||||
static void infrared_cli_print_usage(void) {
|
||||
printf("Usage:\r\n");
|
||||
printf("\tir rx\r\n");
|
||||
printf("\tir tx <protocol> <address> <command>\r\n");
|
||||
printf("\t<command> and <address> are hex-formatted\r\n");
|
||||
printf("\tAvailable protocols:");
|
||||
for(int i = 0; irda_is_protocol_valid((IrdaProtocol)i); ++i) {
|
||||
printf(" %s", irda_get_protocol_name((IrdaProtocol)i));
|
||||
for(int i = 0; infrared_is_protocol_valid((InfraredProtocol)i); ++i) {
|
||||
printf(" %s", infrared_get_protocol_name((InfraredProtocol)i));
|
||||
}
|
||||
printf("\r\n");
|
||||
printf("\tRaw format:\r\n");
|
||||
printf("\tir_tx RAW F:<frequency> DC:<duty_cycle> <sample0> <sample1>...\r\n");
|
||||
printf(
|
||||
"\tFrequency (%d - %d), Duty cycle (0 - 100), max 512 samples\r\n",
|
||||
IRDA_MIN_FREQUENCY,
|
||||
IRDA_MAX_FREQUENCY);
|
||||
INFRARED_MIN_FREQUENCY,
|
||||
INFRARED_MAX_FREQUENCY);
|
||||
}
|
||||
|
||||
static bool parse_message(const char* str, IrdaMessage* message) {
|
||||
static bool parse_message(const char* str, InfraredMessage* message) {
|
||||
char protocol_name[32];
|
||||
int parsed = sscanf(str, "%31s %lX %lX", protocol_name, &message->address, &message->command);
|
||||
|
||||
|
@ -99,10 +99,10 @@ static bool parse_message(const char* str, IrdaMessage* message) {
|
|||
return false;
|
||||
}
|
||||
|
||||
message->protocol = irda_get_protocol_by_name(protocol_name);
|
||||
message->protocol = infrared_get_protocol_by_name(protocol_name);
|
||||
message->repeat = false;
|
||||
|
||||
return irda_parser_is_parsed_signal_valid(message);
|
||||
return infrared_parser_is_parsed_signal_valid(message);
|
||||
}
|
||||
|
||||
static bool parse_signal_raw(
|
||||
|
@ -136,11 +136,11 @@ static bool parse_signal_raw(
|
|||
++*timings_cnt;
|
||||
}
|
||||
|
||||
return irda_parser_is_raw_signal_valid(*frequency, *duty_cycle, *timings_cnt);
|
||||
return infrared_parser_is_raw_signal_valid(*frequency, *duty_cycle, *timings_cnt);
|
||||
}
|
||||
|
||||
static void irda_cli_start_ir_tx(Cli* cli, string_t args) {
|
||||
IrdaMessage message;
|
||||
static void infrared_cli_start_ir_tx(Cli* cli, string_t args) {
|
||||
InfraredMessage message;
|
||||
const char* str = string_get_cstr(args);
|
||||
uint32_t frequency;
|
||||
float duty_cycle;
|
||||
|
@ -148,27 +148,27 @@ static void irda_cli_start_ir_tx(Cli* cli, string_t args) {
|
|||
uint32_t* timings = (uint32_t*)malloc(sizeof(uint32_t) * timings_cnt);
|
||||
|
||||
if(parse_message(str, &message)) {
|
||||
irda_send(&message, 1);
|
||||
infrared_send(&message, 1);
|
||||
} else if(parse_signal_raw(str, timings, &timings_cnt, &duty_cycle, &frequency)) {
|
||||
irda_send_raw_ext(timings, timings_cnt, true, frequency, duty_cycle);
|
||||
infrared_send_raw_ext(timings, timings_cnt, true, frequency, duty_cycle);
|
||||
} else {
|
||||
printf("Wrong arguments.\r\n");
|
||||
irda_cli_print_usage();
|
||||
infrared_cli_print_usage();
|
||||
}
|
||||
|
||||
free(timings);
|
||||
}
|
||||
|
||||
static void irda_cli_start_ir(Cli* cli, string_t args, void* context) {
|
||||
if(furi_hal_irda_is_busy()) {
|
||||
printf("IRDA is busy. Exit.");
|
||||
static void infrared_cli_start_ir(Cli* cli, string_t args, void* context) {
|
||||
if(furi_hal_infrared_is_busy()) {
|
||||
printf("INFRARED is busy. Exit.");
|
||||
return;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
for(; i < COUNT_OF(irda_cli_commands); ++i) {
|
||||
size_t size = strlen(irda_cli_commands[i].cmd);
|
||||
bool cmd_found = !strncmp(string_get_cstr(args), irda_cli_commands[i].cmd, size);
|
||||
for(; i < COUNT_OF(infrared_cli_commands); ++i) {
|
||||
size_t size = strlen(infrared_cli_commands[i].cmd);
|
||||
bool cmd_found = !strncmp(string_get_cstr(args), infrared_cli_commands[i].cmd, size);
|
||||
if(cmd_found) {
|
||||
if(string_size(args) == size) {
|
||||
break;
|
||||
|
@ -180,17 +180,17 @@ static void irda_cli_start_ir(Cli* cli, string_t args, void* context) {
|
|||
}
|
||||
}
|
||||
|
||||
if(i < COUNT_OF(irda_cli_commands)) {
|
||||
irda_cli_commands[i].process_function(cli, args);
|
||||
if(i < COUNT_OF(infrared_cli_commands)) {
|
||||
infrared_cli_commands[i].process_function(cli, args);
|
||||
} else {
|
||||
irda_cli_print_usage();
|
||||
infrared_cli_print_usage();
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void irda_on_system_start() {
|
||||
extern "C" void infrared_on_system_start() {
|
||||
#ifdef SRV_CLI
|
||||
Cli* cli = (Cli*)furi_record_open("cli");
|
||||
cli_add_command(cli, "ir", CliCommandFlagDefault, irda_cli_start_ir, NULL);
|
||||
cli_add_command(cli, "ir", CliCommandFlagDefault, infrared_cli_start_ir, NULL);
|
||||
furi_record_close("cli");
|
||||
#endif
|
||||
}
|
|
@ -1,19 +1,19 @@
|
|||
|
||||
#include "../irda_app_signal.h"
|
||||
#include "irda.h"
|
||||
#include "irda/helpers/irda_parser.h"
|
||||
#include "irda_worker.h"
|
||||
#include "../infrared_app_signal.h"
|
||||
#include "infrared.h"
|
||||
#include "infrared/helpers/infrared_parser.h"
|
||||
#include "infrared_worker.h"
|
||||
#include "m-string.h"
|
||||
#include <flipper_format/flipper_format.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <furi_hal_irda.h>
|
||||
#include <furi_hal_infrared.h>
|
||||
|
||||
#define TAG "IrdaParser"
|
||||
#define TAG "InfraredParser"
|
||||
|
||||
bool irda_parser_save_signal(
|
||||
bool infrared_parser_save_signal(
|
||||
FlipperFormat* ff,
|
||||
const IrdaAppSignal& signal,
|
||||
const InfraredAppSignal& signal,
|
||||
const std::string& name) {
|
||||
furi_assert(ff);
|
||||
furi_assert(!name.empty());
|
||||
|
@ -33,7 +33,7 @@ bool irda_parser_save_signal(
|
|||
break;
|
||||
} else {
|
||||
auto parsed_signal = signal.get_message();
|
||||
const char* protocol_name = irda_get_protocol_name(parsed_signal.protocol);
|
||||
const char* protocol_name = infrared_get_protocol_name(parsed_signal.protocol);
|
||||
if(!flipper_format_write_string_cstr(ff, "type", "parsed")) break;
|
||||
if(!flipper_format_write_string_cstr(ff, "protocol", protocol_name)) break;
|
||||
if(!flipper_format_write_hex(ff, "address", (uint8_t*)&parsed_signal.address, 4))
|
||||
|
@ -47,7 +47,7 @@ bool irda_parser_save_signal(
|
|||
return result;
|
||||
}
|
||||
|
||||
bool irda_parser_read_signal(FlipperFormat* ff, IrdaAppSignal& signal, std::string& name) {
|
||||
bool infrared_parser_read_signal(FlipperFormat* ff, InfraredAppSignal& signal, std::string& name) {
|
||||
furi_assert(ff);
|
||||
|
||||
bool result = false;
|
||||
|
@ -75,12 +75,12 @@ bool irda_parser_read_signal(FlipperFormat* ff, IrdaAppSignal& signal, std::stri
|
|||
}
|
||||
free(timings);
|
||||
} else if(!string_cmp_str(read_string, "parsed")) {
|
||||
IrdaMessage parsed_signal;
|
||||
InfraredMessage parsed_signal;
|
||||
if(!flipper_format_read_string(ff, "protocol", read_string)) break;
|
||||
parsed_signal.protocol = irda_get_protocol_by_name(string_get_cstr(read_string));
|
||||
parsed_signal.protocol = infrared_get_protocol_by_name(string_get_cstr(read_string));
|
||||
if(!flipper_format_read_hex(ff, "address", (uint8_t*)&parsed_signal.address, 4)) break;
|
||||
if(!flipper_format_read_hex(ff, "command", (uint8_t*)&parsed_signal.command, 4)) break;
|
||||
if(!irda_parser_is_parsed_signal_valid(&parsed_signal)) break;
|
||||
if(!infrared_parser_is_parsed_signal_valid(&parsed_signal)) break;
|
||||
signal.set_message(&parsed_signal);
|
||||
result = true;
|
||||
} else {
|
||||
|
@ -92,17 +92,17 @@ bool irda_parser_read_signal(FlipperFormat* ff, IrdaAppSignal& signal, std::stri
|
|||
return result;
|
||||
}
|
||||
|
||||
bool irda_parser_is_parsed_signal_valid(const IrdaMessage* signal) {
|
||||
bool infrared_parser_is_parsed_signal_valid(const InfraredMessage* signal) {
|
||||
furi_assert(signal);
|
||||
bool result = true;
|
||||
|
||||
if(!irda_is_protocol_valid(signal->protocol)) {
|
||||
if(!infrared_is_protocol_valid(signal->protocol)) {
|
||||
FURI_LOG_E(TAG, "Unknown protocol");
|
||||
result = false;
|
||||
}
|
||||
|
||||
if(result) {
|
||||
uint32_t address_length = irda_get_protocol_address_length(signal->protocol);
|
||||
uint32_t address_length = infrared_get_protocol_address_length(signal->protocol);
|
||||
uint32_t address_mask = (1LU << address_length) - 1;
|
||||
if(signal->address != (signal->address & address_mask)) {
|
||||
FURI_LOG_E(
|
||||
|
@ -115,7 +115,7 @@ bool irda_parser_is_parsed_signal_valid(const IrdaMessage* signal) {
|
|||
}
|
||||
|
||||
if(result) {
|
||||
uint32_t command_length = irda_get_protocol_command_length(signal->protocol);
|
||||
uint32_t command_length = infrared_get_protocol_command_length(signal->protocol);
|
||||
uint32_t command_mask = (1LU << command_length) - 1;
|
||||
if(signal->command != (signal->command & command_mask)) {
|
||||
FURI_LOG_E(
|
||||
|
@ -130,15 +130,18 @@ bool irda_parser_is_parsed_signal_valid(const IrdaMessage* signal) {
|
|||
return result;
|
||||
}
|
||||
|
||||
bool irda_parser_is_raw_signal_valid(uint32_t frequency, float duty_cycle, uint32_t timings_cnt) {
|
||||
bool infrared_parser_is_raw_signal_valid(
|
||||
uint32_t frequency,
|
||||
float duty_cycle,
|
||||
uint32_t timings_cnt) {
|
||||
bool result = true;
|
||||
|
||||
if((frequency > IRDA_MAX_FREQUENCY) || (frequency < IRDA_MIN_FREQUENCY)) {
|
||||
if((frequency > INFRARED_MAX_FREQUENCY) || (frequency < INFRARED_MIN_FREQUENCY)) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Frequency is out of range (%lX - %lX): %lX",
|
||||
IRDA_MIN_FREQUENCY,
|
||||
IRDA_MAX_FREQUENCY,
|
||||
INFRARED_MIN_FREQUENCY,
|
||||
INFRARED_MAX_FREQUENCY,
|
||||
frequency);
|
||||
result = false;
|
||||
} else if((duty_cycle <= 0) || (duty_cycle > 1)) {
|
48
applications/infrared/helpers/infrared_parser.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* @file infrared_parser.h
|
||||
* Infrared: Helper file for conversion Flipper File Format
|
||||
* to Infrared signal class, and backwards
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../infrared_app_signal.h"
|
||||
#include <flipper_format/flipper_format.h>
|
||||
#include <string>
|
||||
|
||||
/** Save Infrared signal into file
|
||||
*
|
||||
* @param ff - Flipper File Format instance
|
||||
* @param signal - Infrared signal to save
|
||||
* @param name - name for saved signal. Every
|
||||
* signal on disk has name.
|
||||
*/
|
||||
bool infrared_parser_save_signal(
|
||||
FlipperFormat* ff,
|
||||
const InfraredAppSignal& signal,
|
||||
const std::string& name);
|
||||
|
||||
/** Read Infrared signal from file
|
||||
*
|
||||
* @param ff - Flipper File Format instance
|
||||
* @param signal - Infrared signal to read to
|
||||
* @param name - name for saved signal. Every
|
||||
* signal in file has name.
|
||||
*/
|
||||
bool infrared_parser_read_signal(FlipperFormat* ff, InfraredAppSignal& signal, std::string& name);
|
||||
|
||||
/** Validate parsed signal
|
||||
*
|
||||
* @signal - signal to validate
|
||||
* @retval true if valid, false otherwise
|
||||
*/
|
||||
bool infrared_parser_is_parsed_signal_valid(const InfraredMessage* signal);
|
||||
|
||||
/** Validate raw signal
|
||||
*
|
||||
* @signal - signal to validate
|
||||
* @retval true if valid, false otherwise
|
||||
*/
|
||||
bool infrared_parser_is_raw_signal_valid(
|
||||
uint32_t frequency,
|
||||
float duty_cycle,
|
||||
uint32_t timings_cnt);
|
|
@ -1,13 +1,13 @@
|
|||
#include "irda_app.h"
|
||||
#include <irda_worker.h>
|
||||
#include "infrared_app.h"
|
||||
#include <infrared_worker.h>
|
||||
#include <furi.h>
|
||||
#include <gui/gui.h>
|
||||
#include <input/input.h>
|
||||
#include <stdio.h>
|
||||
#include <callback-connector.h>
|
||||
|
||||
int32_t IrdaApp::run(void* args) {
|
||||
IrdaAppEvent event;
|
||||
int32_t InfraredApp::run(void* args) {
|
||||
InfraredAppEvent event;
|
||||
bool consumed;
|
||||
bool exit = false;
|
||||
|
||||
|
@ -17,7 +17,7 @@ int32_t IrdaApp::run(void* args) {
|
|||
remote_name.erase(remote_name.find_last_of('.'));
|
||||
bool result = remote_manager.load(remote_name);
|
||||
if(result) {
|
||||
current_scene = IrdaApp::Scene::Remote;
|
||||
current_scene = InfraredApp::Scene::Remote;
|
||||
} else {
|
||||
printf("Failed to load remote \'%s\'\r\n", remote_name.c_str());
|
||||
return -1;
|
||||
|
@ -29,12 +29,12 @@ int32_t IrdaApp::run(void* args) {
|
|||
while(!exit) {
|
||||
view_manager.receive_event(&event);
|
||||
|
||||
if(event.type == IrdaAppEvent::Type::Exit) break;
|
||||
if(event.type == InfraredAppEvent::Type::Exit) break;
|
||||
|
||||
consumed = scenes[current_scene]->on_event(this, &event);
|
||||
|
||||
if(!consumed) {
|
||||
if(event.type == IrdaAppEvent::Type::Back) {
|
||||
if(event.type == InfraredAppEvent::Type::Back) {
|
||||
exit = switch_to_previous_scene();
|
||||
}
|
||||
}
|
||||
|
@ -45,36 +45,36 @@ int32_t IrdaApp::run(void* args) {
|
|||
return 0;
|
||||
};
|
||||
|
||||
IrdaApp::IrdaApp() {
|
||||
furi_check(IrdaAppRemoteManager::max_button_name_length < get_text_store_size());
|
||||
InfraredApp::InfraredApp() {
|
||||
furi_check(InfraredAppRemoteManager::max_button_name_length < get_text_store_size());
|
||||
notification = static_cast<NotificationApp*>(furi_record_open("notification"));
|
||||
irda_worker = irda_worker_alloc();
|
||||
infrared_worker = infrared_worker_alloc();
|
||||
}
|
||||
|
||||
IrdaApp::~IrdaApp() {
|
||||
irda_worker_free(irda_worker);
|
||||
InfraredApp::~InfraredApp() {
|
||||
infrared_worker_free(infrared_worker);
|
||||
furi_record_close("notification");
|
||||
for(auto& [key, scene] : scenes) delete scene;
|
||||
}
|
||||
|
||||
IrdaAppViewManager* IrdaApp::get_view_manager() {
|
||||
InfraredAppViewManager* InfraredApp::get_view_manager() {
|
||||
return &view_manager;
|
||||
}
|
||||
|
||||
void IrdaApp::set_learn_new_remote(bool value) {
|
||||
void InfraredApp::set_learn_new_remote(bool value) {
|
||||
learn_new_remote = value;
|
||||
}
|
||||
|
||||
bool IrdaApp::get_learn_new_remote() {
|
||||
bool InfraredApp::get_learn_new_remote() {
|
||||
return learn_new_remote;
|
||||
}
|
||||
|
||||
void IrdaApp::switch_to_next_scene(Scene next_scene) {
|
||||
void InfraredApp::switch_to_next_scene(Scene next_scene) {
|
||||
previous_scenes_list.push_front(current_scene);
|
||||
switch_to_next_scene_without_saving(next_scene);
|
||||
}
|
||||
|
||||
void IrdaApp::switch_to_next_scene_without_saving(Scene next_scene) {
|
||||
void InfraredApp::switch_to_next_scene_without_saving(Scene next_scene) {
|
||||
if(next_scene != Scene::Exit) {
|
||||
scenes[current_scene]->on_exit(this);
|
||||
current_scene = next_scene;
|
||||
|
@ -83,7 +83,8 @@ void IrdaApp::switch_to_next_scene_without_saving(Scene next_scene) {
|
|||
}
|
||||
}
|
||||
|
||||
void IrdaApp::search_and_switch_to_previous_scene(const std::initializer_list<Scene>& scenes_list) {
|
||||
void InfraredApp::search_and_switch_to_previous_scene(
|
||||
const std::initializer_list<Scene>& scenes_list) {
|
||||
Scene previous_scene = Scene::Start;
|
||||
bool scene_found = false;
|
||||
|
||||
|
@ -101,8 +102,8 @@ void IrdaApp::search_and_switch_to_previous_scene(const std::initializer_list<Sc
|
|||
}
|
||||
|
||||
if(previous_scene == Scene::Exit) {
|
||||
IrdaAppEvent event;
|
||||
event.type = IrdaAppEvent::Type::Exit;
|
||||
InfraredAppEvent event;
|
||||
event.type = InfraredAppEvent::Type::Exit;
|
||||
view_manager.send_event(&event);
|
||||
} else {
|
||||
scenes[current_scene]->on_exit(this);
|
||||
|
@ -112,7 +113,7 @@ void IrdaApp::search_and_switch_to_previous_scene(const std::initializer_list<Sc
|
|||
}
|
||||
}
|
||||
|
||||
bool IrdaApp::switch_to_previous_scene(uint8_t count) {
|
||||
bool InfraredApp::switch_to_previous_scene(uint8_t count) {
|
||||
Scene previous_scene = Scene::Start;
|
||||
|
||||
for(uint8_t i = 0; i < count; i++) previous_scene = get_previous_scene();
|
||||
|
@ -126,7 +127,7 @@ bool IrdaApp::switch_to_previous_scene(uint8_t count) {
|
|||
return false;
|
||||
}
|
||||
|
||||
IrdaApp::Scene IrdaApp::get_previous_scene() {
|
||||
InfraredApp::Scene InfraredApp::get_previous_scene() {
|
||||
Scene scene = Scene::Exit;
|
||||
|
||||
if(!previous_scenes_list.empty()) {
|
||||
|
@ -137,11 +138,11 @@ IrdaApp::Scene IrdaApp::get_previous_scene() {
|
|||
return scene;
|
||||
}
|
||||
|
||||
IrdaAppRemoteManager* IrdaApp::get_remote_manager() {
|
||||
InfraredAppRemoteManager* InfraredApp::get_remote_manager() {
|
||||
return &remote_manager;
|
||||
}
|
||||
|
||||
void IrdaApp::set_text_store(uint8_t index, const char* text...) {
|
||||
void InfraredApp::set_text_store(uint8_t index, const char* text...) {
|
||||
furi_check(index < text_store_max);
|
||||
|
||||
va_list args;
|
||||
|
@ -152,77 +153,63 @@ void IrdaApp::set_text_store(uint8_t index, const char* text...) {
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
char* IrdaApp::get_text_store(uint8_t index) {
|
||||
char* InfraredApp::get_text_store(uint8_t index) {
|
||||
furi_check(index < text_store_max);
|
||||
|
||||
return text_store[index];
|
||||
}
|
||||
|
||||
uint8_t IrdaApp::get_text_store_size() {
|
||||
uint8_t InfraredApp::get_text_store_size() {
|
||||
return text_store_size;
|
||||
}
|
||||
|
||||
void IrdaApp::text_input_callback(void* context) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
event.type = IrdaAppEvent::Type::TextEditDone;
|
||||
void InfraredApp::text_input_callback(void* context) {
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
event.type = InfraredAppEvent::Type::TextEditDone;
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaApp::popup_callback(void* context) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
event.type = IrdaAppEvent::Type::PopupTimer;
|
||||
void InfraredApp::popup_callback(void* context) {
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
event.type = InfraredAppEvent::Type::PopupTimer;
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaApp::set_edit_element(IrdaApp::EditElement value) {
|
||||
void InfraredApp::set_edit_element(InfraredApp::EditElement value) {
|
||||
element = value;
|
||||
}
|
||||
|
||||
IrdaApp::EditElement IrdaApp::get_edit_element(void) {
|
||||
InfraredApp::EditElement InfraredApp::get_edit_element(void) {
|
||||
return element;
|
||||
}
|
||||
|
||||
void IrdaApp::set_edit_action(IrdaApp::EditAction value) {
|
||||
void InfraredApp::set_edit_action(InfraredApp::EditAction value) {
|
||||
action = value;
|
||||
}
|
||||
|
||||
IrdaApp::EditAction IrdaApp::get_edit_action(void) {
|
||||
InfraredApp::EditAction InfraredApp::get_edit_action(void) {
|
||||
return action;
|
||||
}
|
||||
|
||||
void IrdaApp::set_current_button(int value) {
|
||||
void InfraredApp::set_current_button(int value) {
|
||||
current_button = value;
|
||||
}
|
||||
|
||||
int IrdaApp::get_current_button() {
|
||||
int InfraredApp::get_current_button() {
|
||||
return current_button;
|
||||
}
|
||||
|
||||
void IrdaApp::notify_success() {
|
||||
void InfraredApp::notify_success() {
|
||||
notification_message(notification, &sequence_success);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_red_blink() {
|
||||
void InfraredApp::notify_red_blink() {
|
||||
notification_message(notification, &sequence_blink_red_10);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_sent_just_learnt() {
|
||||
static const NotificationSequence sequence = {
|
||||
&message_green_0,
|
||||
&message_vibro_on,
|
||||
&message_delay_50,
|
||||
&message_vibro_off,
|
||||
&message_green_255,
|
||||
&message_do_not_reset,
|
||||
NULL,
|
||||
};
|
||||
|
||||
notification_message_block(notification, &sequence);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_click() {
|
||||
void InfraredApp::notify_click() {
|
||||
static const NotificationSequence sequence = {
|
||||
&message_click,
|
||||
&message_delay_1,
|
||||
|
@ -233,7 +220,7 @@ void IrdaApp::notify_click() {
|
|||
notification_message_block(notification, &sequence);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_click_and_green_blink() {
|
||||
void InfraredApp::notify_click_and_green_blink() {
|
||||
static const NotificationSequence sequence = {
|
||||
&message_click,
|
||||
&message_delay_1,
|
||||
|
@ -248,7 +235,7 @@ void IrdaApp::notify_click_and_green_blink() {
|
|||
notification_message_block(notification, &sequence);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_blink_green() {
|
||||
void InfraredApp::notify_blink_green() {
|
||||
static const NotificationSequence sequence = {
|
||||
&message_green_255,
|
||||
&message_delay_10,
|
||||
|
@ -260,27 +247,27 @@ void IrdaApp::notify_blink_green() {
|
|||
notification_message(notification, &sequence);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_green_on() {
|
||||
void InfraredApp::notify_green_on() {
|
||||
notification_message(notification, &sequence_set_only_green_255);
|
||||
}
|
||||
|
||||
void IrdaApp::notify_green_off() {
|
||||
void InfraredApp::notify_green_off() {
|
||||
notification_message(notification, &sequence_reset_green);
|
||||
}
|
||||
|
||||
IrdaWorker* IrdaApp::get_irda_worker() {
|
||||
return irda_worker;
|
||||
InfraredWorker* InfraredApp::get_infrared_worker() {
|
||||
return infrared_worker;
|
||||
}
|
||||
|
||||
const IrdaAppSignal& IrdaApp::get_received_signal() const {
|
||||
const InfraredAppSignal& InfraredApp::get_received_signal() const {
|
||||
return received_signal;
|
||||
}
|
||||
|
||||
void IrdaApp::set_received_signal(const IrdaAppSignal& signal) {
|
||||
void InfraredApp::set_received_signal(const InfraredAppSignal& signal) {
|
||||
received_signal = signal;
|
||||
}
|
||||
|
||||
void IrdaApp::signal_sent_callback(void* context) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
void InfraredApp::signal_sent_callback(void* context) {
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
app->notify_blink_green();
|
||||
}
|
322
applications/infrared/infrared_app.h
Normal file
|
@ -0,0 +1,322 @@
|
|||
/**
|
||||
* @file infrared_app.h
|
||||
* Infrared: Main infrared application class
|
||||
*/
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include <infrared.h>
|
||||
#include <furi.h>
|
||||
#include <forward_list>
|
||||
#include <stdint.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <infrared_worker.h>
|
||||
|
||||
#include "scene/infrared_app_scene.h"
|
||||
#include "scene/infrared_app_scene.h"
|
||||
#include "infrared_app_view_manager.h"
|
||||
#include "infrared_app_remote_manager.h"
|
||||
#include "infrared_app_view_manager.h"
|
||||
|
||||
/** Main Infrared application class */
|
||||
class InfraredApp {
|
||||
public:
|
||||
/** Enum to save scene state: edit element */
|
||||
enum class EditElement : uint8_t {
|
||||
Button,
|
||||
Remote,
|
||||
};
|
||||
/** Enum to save scene state: edit action */
|
||||
enum class EditAction : uint8_t {
|
||||
Rename,
|
||||
Delete,
|
||||
};
|
||||
/** List of scenes for Infrared application */
|
||||
enum class Scene : uint8_t {
|
||||
Exit,
|
||||
Start,
|
||||
Universal,
|
||||
UniversalTV,
|
||||
UniversalAudio,
|
||||
UniversalAirConditioner,
|
||||
Learn,
|
||||
LearnSuccess,
|
||||
LearnEnterName,
|
||||
LearnDone,
|
||||
AskBack,
|
||||
Remote,
|
||||
RemoteList,
|
||||
Edit,
|
||||
EditKeySelect,
|
||||
EditRename,
|
||||
EditDelete,
|
||||
EditRenameDone,
|
||||
EditDeleteDone,
|
||||
};
|
||||
|
||||
/** Start application
|
||||
*
|
||||
* @param args - application arguments.
|
||||
* Allowed argument is path to remote file.
|
||||
* @retval 0 on success, error code otherwise
|
||||
*/
|
||||
int32_t run(void* args);
|
||||
|
||||
/** Switch to next scene. Put current scene number on stack.
|
||||
* Doesn't save scene state.
|
||||
*
|
||||
* @param index - next scene index
|
||||
*/
|
||||
void switch_to_next_scene(Scene index);
|
||||
|
||||
/** Switch to next scene, but don't put current scene on
|
||||
* stack. Thus calling switch_to_previous_scene() doesn't return
|
||||
* to current scene.
|
||||
*
|
||||
* @param index - next scene index
|
||||
*/
|
||||
void switch_to_next_scene_without_saving(Scene index);
|
||||
|
||||
/** Switch to previous scene. Pop scenes from stack and switch to last one.
|
||||
*
|
||||
* @param count - how many scenes should be popped
|
||||
* @retval false on failed, true on success
|
||||
*/
|
||||
bool switch_to_previous_scene(uint8_t count = 1);
|
||||
|
||||
/** Get previous scene in scene stack
|
||||
*
|
||||
* @retval previous scene
|
||||
*/
|
||||
Scene get_previous_scene();
|
||||
|
||||
/** Get view manager instance
|
||||
*
|
||||
* @retval view manager instance
|
||||
*/
|
||||
InfraredAppViewManager* get_view_manager();
|
||||
|
||||
/** Set one of text stores
|
||||
*
|
||||
* @param index - index of text store
|
||||
* @param text - text to set
|
||||
*/
|
||||
void set_text_store(uint8_t index, const char* text...);
|
||||
|
||||
/** Get value in text store
|
||||
*
|
||||
* @param index - index of text store
|
||||
* @retval value in text_store
|
||||
*/
|
||||
char* get_text_store(uint8_t index);
|
||||
|
||||
/** Get text store size
|
||||
*
|
||||
* @retval size of text store
|
||||
*/
|
||||
uint8_t get_text_store_size();
|
||||
|
||||
/** Get remote manager instance
|
||||
*
|
||||
* @retval remote manager instance
|
||||
*/
|
||||
InfraredAppRemoteManager* get_remote_manager();
|
||||
|
||||
/** Get infrared worker instance
|
||||
*
|
||||
* @retval infrared worker instance
|
||||
*/
|
||||
InfraredWorker* get_infrared_worker();
|
||||
|
||||
/** Get signal, previously got on Learn scene
|
||||
*
|
||||
* @retval received signal
|
||||
*/
|
||||
const InfraredAppSignal& get_received_signal() const;
|
||||
|
||||
/** Set received signal
|
||||
*
|
||||
* @param signal - signal
|
||||
*/
|
||||
void set_received_signal(const InfraredAppSignal& signal);
|
||||
|
||||
/** Switch to previous scene in one of provided in list.
|
||||
* Pop scene stack, and find first scene from list.
|
||||
*
|
||||
* @param scenes_list - list of scenes
|
||||
*/
|
||||
void search_and_switch_to_previous_scene(const std::initializer_list<Scene>& scenes_list);
|
||||
|
||||
/** Set edit element value. It is used on edit scene to determine
|
||||
* what should be deleted - remote or button.
|
||||
*
|
||||
* @param value - value to set
|
||||
*/
|
||||
void set_edit_element(EditElement value);
|
||||
|
||||
/** Get edit element
|
||||
*
|
||||
* @retval edit element value
|
||||
*/
|
||||
EditElement get_edit_element(void);
|
||||
|
||||
/** Set edit action value. It is used on edit scene to determine
|
||||
* what action to perform - deletion or renaming.
|
||||
*
|
||||
* @param value - value to set
|
||||
*/
|
||||
void set_edit_action(EditAction value);
|
||||
|
||||
/** Get edit action
|
||||
*
|
||||
* @retval edit action value
|
||||
*/
|
||||
EditAction get_edit_action(void);
|
||||
|
||||
/** Get state of learning new signal.
|
||||
* Adding new remote with 1 button from start scene and
|
||||
* learning 1 additional button to remote have very similar
|
||||
* flow, so they are joined. Difference in flow is handled
|
||||
* by this boolean flag.
|
||||
*
|
||||
* @retval false if flow is in learning new remote, true if
|
||||
* adding signal to created remote
|
||||
*
|
||||
*/
|
||||
bool get_learn_new_remote();
|
||||
|
||||
/** Set state of learning new signal.
|
||||
* Adding new remote with 1 button from start scene and
|
||||
* learning 1 additional button to remote have very similar
|
||||
* flow, so they are joined. Difference in flow is handled
|
||||
* by this boolean flag.
|
||||
*
|
||||
* @param value - false if flow is in learning new remote, true if
|
||||
* adding signal to created remote
|
||||
*/
|
||||
void set_learn_new_remote(bool value);
|
||||
|
||||
/** Button is not assigned value
|
||||
*/
|
||||
enum : int {
|
||||
ButtonNA = -1,
|
||||
};
|
||||
|
||||
/** Get current button index
|
||||
*
|
||||
* @retval current button index
|
||||
*/
|
||||
int get_current_button();
|
||||
|
||||
/** Set current button index
|
||||
*
|
||||
* @param current button index
|
||||
*/
|
||||
void set_current_button(int value);
|
||||
|
||||
/** Play success notification */
|
||||
void notify_success();
|
||||
/** Play red blink notification */
|
||||
void notify_red_blink();
|
||||
/** Light green */
|
||||
void notify_green_on();
|
||||
/** Disable green light */
|
||||
void notify_green_off();
|
||||
/** Play click sound */
|
||||
void notify_click();
|
||||
/** Play click and green notification */
|
||||
void notify_click_and_green_blink();
|
||||
/** Blink green light */
|
||||
void notify_blink_green();
|
||||
|
||||
/** Text input callback
|
||||
*
|
||||
* @param context - context to pass to callback
|
||||
*/
|
||||
static void text_input_callback(void* context);
|
||||
|
||||
/** Popup callback
|
||||
*
|
||||
* @param context - context to pass to callback
|
||||
*/
|
||||
static void popup_callback(void* context);
|
||||
|
||||
/** Signal sent callback
|
||||
*
|
||||
* @param context - context to pass to callback
|
||||
*/
|
||||
static void signal_sent_callback(void* context);
|
||||
|
||||
/** Main class constructor, initializes all critical objects */
|
||||
InfraredApp();
|
||||
/** Main class destructor, deinitializes all critical objects */
|
||||
~InfraredApp();
|
||||
|
||||
/** Path to Infrared directory */
|
||||
static constexpr const char* infrared_directory = "/any/infrared";
|
||||
/** Infrared files extension (remote files and universal databases) */
|
||||
static constexpr const char* infrared_extension = ".ir";
|
||||
/** Max Raw timings in signal */
|
||||
static constexpr const uint32_t max_raw_timings_in_signal = 512;
|
||||
/** Max line length in Infrared file */
|
||||
static constexpr const uint32_t max_line_length =
|
||||
(9 + 1) * InfraredApp::max_raw_timings_in_signal + 100;
|
||||
|
||||
private:
|
||||
/** Text store size */
|
||||
static constexpr const uint8_t text_store_size = 128;
|
||||
/** Amount of text stores */
|
||||
static constexpr const uint8_t text_store_max = 2;
|
||||
/** Store text here, for some views, because they doesn't
|
||||
* hold ownership of text */
|
||||
char text_store[text_store_max][text_store_size + 1];
|
||||
/**
|
||||
* Flag to control adding new signal flow.
|
||||
* Adding new remote with 1 button from start scene and
|
||||
* learning 1 additional button to remote have very similar
|
||||
* flow, so they are joined. Difference in flow is handled
|
||||
* by this boolean flag.
|
||||
*/
|
||||
bool learn_new_remote;
|
||||
/** Value to control edit scene */
|
||||
EditElement element;
|
||||
/** Value to control edit scene */
|
||||
EditAction action;
|
||||
/** Selected button index */
|
||||
uint32_t current_button;
|
||||
|
||||
/** Notification instance */
|
||||
NotificationApp* notification;
|
||||
/** View manager instance */
|
||||
InfraredAppViewManager view_manager;
|
||||
/** Remote manager instance */
|
||||
InfraredAppRemoteManager remote_manager;
|
||||
/** Infrared worker instance */
|
||||
InfraredWorker* infrared_worker;
|
||||
/** Signal received on Learn scene */
|
||||
InfraredAppSignal received_signal;
|
||||
|
||||
/** Stack of previous scenes */
|
||||
std::forward_list<Scene> previous_scenes_list;
|
||||
/** Now acting scene */
|
||||
Scene current_scene = Scene::Start;
|
||||
|
||||
/** Map of index/scene objects */
|
||||
std::map<Scene, InfraredAppScene*> scenes = {
|
||||
{Scene::Start, new InfraredAppSceneStart()},
|
||||
{Scene::Universal, new InfraredAppSceneUniversal()},
|
||||
{Scene::UniversalTV, new InfraredAppSceneUniversalTV()},
|
||||
{Scene::Learn, new InfraredAppSceneLearn()},
|
||||
{Scene::LearnSuccess, new InfraredAppSceneLearnSuccess()},
|
||||
{Scene::LearnEnterName, new InfraredAppSceneLearnEnterName()},
|
||||
{Scene::LearnDone, new InfraredAppSceneLearnDone()},
|
||||
{Scene::AskBack, new InfraredAppSceneAskBack()},
|
||||
{Scene::Remote, new InfraredAppSceneRemote()},
|
||||
{Scene::RemoteList, new InfraredAppSceneRemoteList()},
|
||||
{Scene::Edit, new InfraredAppSceneEdit()},
|
||||
{Scene::EditKeySelect, new InfraredAppSceneEditKeySelect()},
|
||||
{Scene::EditRename, new InfraredAppSceneEditRename()},
|
||||
{Scene::EditDelete, new InfraredAppSceneEditDelete()},
|
||||
{Scene::EditRenameDone, new InfraredAppSceneEditRenameDone()},
|
||||
{Scene::EditDeleteDone, new InfraredAppSceneEditDeleteDone()},
|
||||
};
|
||||
};
|
|
@ -1,18 +1,18 @@
|
|||
|
||||
#include "helpers/irda_parser.h"
|
||||
#include "irda_app_brute_force.h"
|
||||
#include "irda_app_signal.h"
|
||||
#include "helpers/infrared_parser.h"
|
||||
#include "infrared_app_brute_force.h"
|
||||
#include "infrared_app_signal.h"
|
||||
#include <memory>
|
||||
#include <m-string.h>
|
||||
#include <furi.h>
|
||||
#include <file_worker_cpp.h>
|
||||
|
||||
void IrdaAppBruteForce::add_record(int index, const char* name) {
|
||||
void InfraredAppBruteForce::add_record(int index, const char* name) {
|
||||
records[name].index = index;
|
||||
records[name].amount = 0;
|
||||
}
|
||||
|
||||
bool IrdaAppBruteForce::calculate_messages() {
|
||||
bool InfraredAppBruteForce::calculate_messages() {
|
||||
bool result = false;
|
||||
|
||||
Storage* storage = static_cast<Storage*>(furi_record_open("storage"));
|
||||
|
@ -20,7 +20,7 @@ bool IrdaAppBruteForce::calculate_messages() {
|
|||
result = flipper_format_file_open_existing(ff, universal_db_filename);
|
||||
|
||||
if(result) {
|
||||
IrdaAppSignal signal;
|
||||
InfraredAppSignal signal;
|
||||
|
||||
string_t signal_name;
|
||||
string_init(signal_name);
|
||||
|
@ -38,7 +38,7 @@ bool IrdaAppBruteForce::calculate_messages() {
|
|||
return result;
|
||||
}
|
||||
|
||||
void IrdaAppBruteForce::stop_bruteforce() {
|
||||
void InfraredAppBruteForce::stop_bruteforce() {
|
||||
furi_assert((current_record.size()));
|
||||
|
||||
if(current_record.size()) {
|
||||
|
@ -49,15 +49,15 @@ void IrdaAppBruteForce::stop_bruteforce() {
|
|||
}
|
||||
}
|
||||
|
||||
bool IrdaAppBruteForce::send_next_bruteforce(void) {
|
||||
bool InfraredAppBruteForce::send_next_bruteforce(void) {
|
||||
furi_assert(current_record.size());
|
||||
furi_assert(ff);
|
||||
|
||||
IrdaAppSignal signal;
|
||||
InfraredAppSignal signal;
|
||||
std::string signal_name;
|
||||
bool result = false;
|
||||
do {
|
||||
result = irda_parser_read_signal(ff, signal, signal_name);
|
||||
result = infrared_parser_read_signal(ff, signal, signal_name);
|
||||
} while(result && current_record.compare(signal_name));
|
||||
|
||||
if(result) {
|
||||
|
@ -66,7 +66,7 @@ bool IrdaAppBruteForce::send_next_bruteforce(void) {
|
|||
return result;
|
||||
}
|
||||
|
||||
bool IrdaAppBruteForce::start_bruteforce(int index, int& record_amount) {
|
||||
bool InfraredAppBruteForce::start_bruteforce(int index, int& record_amount) {
|
||||
bool result = false;
|
||||
record_amount = 0;
|
||||
|
67
applications/infrared/infrared_app_brute_force.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file infrared_app_brute_force.h
|
||||
* Infrared: Brute Force class description
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <flipper_format/flipper_format.h>
|
||||
|
||||
/** Class handles brute force mechanic */
|
||||
class InfraredAppBruteForce {
|
||||
/** Universal database filename */
|
||||
const char* universal_db_filename;
|
||||
|
||||
/** Current record name (POWER, MUTE, VOL+, etc).
|
||||
* This is the name of signal to brute force. */
|
||||
std::string current_record;
|
||||
|
||||
/** Flipper File Format instance */
|
||||
FlipperFormat* ff;
|
||||
|
||||
/** Data about every record - index in button panel view
|
||||
* and amount of signals, which is need for correct
|
||||
* progress bar displaying. */
|
||||
typedef struct {
|
||||
/** Index of record in button panel view model */
|
||||
int index;
|
||||
/** Amount of signals of that type (POWER, MUTE, etc) */
|
||||
int amount;
|
||||
} Record;
|
||||
|
||||
/** Container to hold Record info.
|
||||
* 'key' is record name, because we have to search by both, index and name,
|
||||
* but index search has place once per button press, and should not be
|
||||
* noticed, but name search should occur during entering universal menu,
|
||||
* and will go through container for every record in file, that's why
|
||||
* more critical to have faster search by record name.
|
||||
*/
|
||||
std::unordered_map<std::string, Record> records;
|
||||
|
||||
public:
|
||||
/** Calculate messages. Walk through the file ('universal_db_name')
|
||||
* and calculate amount of records of certain type. */
|
||||
bool calculate_messages();
|
||||
|
||||
/** Start brute force */
|
||||
bool start_bruteforce(int index, int& record_amount);
|
||||
|
||||
/** Stop brute force */
|
||||
void stop_bruteforce();
|
||||
|
||||
/** Send next signal during brute force */
|
||||
bool send_next_bruteforce();
|
||||
|
||||
/** Add record to container of records */
|
||||
void add_record(int index, const char* name);
|
||||
|
||||
/** Initialize class, set db file */
|
||||
InfraredAppBruteForce(const char* filename)
|
||||
: universal_db_filename(filename) {
|
||||
}
|
||||
|
||||
/** Deinitialize class */
|
||||
~InfraredAppBruteForce() {
|
||||
}
|
||||
};
|
47
applications/infrared/infrared_app_event.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* @file infrared_app_event.h
|
||||
* Infrared: Scene events description
|
||||
*/
|
||||
#pragma once
|
||||
#include <infrared.h>
|
||||
#include <gui/modules/dialog_ex.h>
|
||||
|
||||
/** Infrared events class */
|
||||
class InfraredAppEvent {
|
||||
public:
|
||||
/** Type of event enum */
|
||||
enum class Type : uint8_t {
|
||||
/** Tick event come after no other events came in 100 ms */
|
||||
Tick,
|
||||
/** Exit application event */
|
||||
Exit,
|
||||
/** Back event */
|
||||
Back,
|
||||
/** Menu selected event type. Provided with payload value. */
|
||||
MenuSelected,
|
||||
/** Button press event. Need for continuous signal sending. */
|
||||
MenuSelectedPress,
|
||||
/** Button release event. Need for continuous signal sending. */
|
||||
MenuSelectedRelease,
|
||||
/** Events from DialogEx view module */
|
||||
DialogExSelected,
|
||||
/** Infrared signal received event */
|
||||
InfraredMessageReceived,
|
||||
/** Text edit done event */
|
||||
TextEditDone,
|
||||
/** Popup timer finished event */
|
||||
PopupTimer,
|
||||
/** Button panel pressed event */
|
||||
ButtonPanelPressed,
|
||||
};
|
||||
|
||||
union {
|
||||
/** Menu selected event type payload. Selected index. */
|
||||
int32_t menu_index;
|
||||
/** DialogEx view module event type payload */
|
||||
DialogExResult dialog_ex_result;
|
||||
} payload;
|
||||
|
||||
/** Type of event */
|
||||
Type type;
|
||||
};
|
|
@ -1,25 +1,26 @@
|
|||
#include <file_worker_cpp.h>
|
||||
#include <flipper_format/flipper_format.h>
|
||||
#include "irda_app_remote_manager.h"
|
||||
#include "irda/helpers/irda_parser.h"
|
||||
#include "irda/irda_app_signal.h"
|
||||
#include "infrared_app_remote_manager.h"
|
||||
#include "infrared/helpers/infrared_parser.h"
|
||||
#include "infrared/infrared_app_signal.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <irda.h>
|
||||
#include <infrared.h>
|
||||
#include <cstdio>
|
||||
#include <furi.h>
|
||||
#include <gui/modules/button_menu.h>
|
||||
#include <storage/storage.h>
|
||||
#include "irda_app.h"
|
||||
#include "infrared_app.h"
|
||||
|
||||
static const std::string default_remote_name = "remote";
|
||||
|
||||
std::string IrdaAppRemoteManager::make_full_name(const std::string& remote_name) const {
|
||||
return std::string("") + IrdaApp::irda_directory + "/" + remote_name + IrdaApp::irda_extension;
|
||||
std::string InfraredAppRemoteManager::make_full_name(const std::string& remote_name) const {
|
||||
return std::string("") + InfraredApp::infrared_directory + "/" + remote_name +
|
||||
InfraredApp::infrared_extension;
|
||||
}
|
||||
|
||||
std::string IrdaAppRemoteManager::find_vacant_remote_name(const std::string& name) {
|
||||
std::string InfraredAppRemoteManager::find_vacant_remote_name(const std::string& name) {
|
||||
bool exist = true;
|
||||
FileWorkerCpp file_worker;
|
||||
|
||||
|
@ -41,14 +42,14 @@ std::string IrdaAppRemoteManager::find_vacant_remote_name(const std::string& nam
|
|||
return !exist ? name + std::to_string(i) : std::string();
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::add_button(const char* button_name, const IrdaAppSignal& signal) {
|
||||
bool InfraredAppRemoteManager::add_button(const char* button_name, const InfraredAppSignal& signal) {
|
||||
remote->buttons.emplace_back(button_name, signal);
|
||||
return store();
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::add_remote_with_button(
|
||||
bool InfraredAppRemoteManager::add_remote_with_button(
|
||||
const char* button_name,
|
||||
const IrdaAppSignal& signal) {
|
||||
const InfraredAppSignal& signal) {
|
||||
furi_check(button_name != nullptr);
|
||||
|
||||
auto new_name = find_vacant_remote_name(default_remote_name);
|
||||
|
@ -56,11 +57,11 @@ bool IrdaAppRemoteManager::add_remote_with_button(
|
|||
return false;
|
||||
}
|
||||
|
||||
remote = std::make_unique<IrdaAppRemote>(new_name);
|
||||
remote = std::make_unique<InfraredAppRemote>(new_name);
|
||||
return add_button(button_name, signal);
|
||||
}
|
||||
|
||||
std::vector<std::string> IrdaAppRemoteManager::get_button_list(void) const {
|
||||
std::vector<std::string> InfraredAppRemoteManager::get_button_list(void) const {
|
||||
std::vector<std::string> name_vector;
|
||||
name_vector.reserve(remote->buttons.size());
|
||||
|
||||
|
@ -72,7 +73,7 @@ std::vector<std::string> IrdaAppRemoteManager::get_button_list(void) const {
|
|||
return name_vector;
|
||||
}
|
||||
|
||||
const IrdaAppSignal& IrdaAppRemoteManager::get_button_data(size_t index) const {
|
||||
const InfraredAppSignal& InfraredAppRemoteManager::get_button_data(size_t index) const {
|
||||
furi_check(remote.get() != nullptr);
|
||||
auto& buttons = remote->buttons;
|
||||
furi_check(index < buttons.size());
|
||||
|
@ -80,7 +81,7 @@ const IrdaAppSignal& IrdaAppRemoteManager::get_button_data(size_t index) const {
|
|||
return buttons.at(index).signal;
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::delete_remote() {
|
||||
bool InfraredAppRemoteManager::delete_remote() {
|
||||
bool result;
|
||||
FileWorkerCpp file_worker;
|
||||
result = file_worker.remove(make_full_name(remote->name).c_str());
|
||||
|
@ -89,11 +90,11 @@ bool IrdaAppRemoteManager::delete_remote() {
|
|||
return result;
|
||||
}
|
||||
|
||||
void IrdaAppRemoteManager::reset_remote() {
|
||||
void InfraredAppRemoteManager::reset_remote() {
|
||||
remote.reset();
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::delete_button(uint32_t index) {
|
||||
bool InfraredAppRemoteManager::delete_button(uint32_t index) {
|
||||
furi_check(remote.get() != nullptr);
|
||||
auto& buttons = remote->buttons;
|
||||
furi_check(index < buttons.size());
|
||||
|
@ -102,30 +103,18 @@ bool IrdaAppRemoteManager::delete_button(uint32_t index) {
|
|||
return store();
|
||||
}
|
||||
|
||||
std::string IrdaAppRemoteManager::get_button_name(uint32_t index) {
|
||||
std::string InfraredAppRemoteManager::get_button_name(uint32_t index) {
|
||||
furi_check(remote.get() != nullptr);
|
||||
auto& buttons = remote->buttons;
|
||||
furi_check(index < buttons.size());
|
||||
return buttons[index].name.c_str();
|
||||
}
|
||||
|
||||
std::string IrdaAppRemoteManager::get_remote_name() {
|
||||
std::string InfraredAppRemoteManager::get_remote_name() {
|
||||
return remote.get() ? remote->name : std::string();
|
||||
}
|
||||
|
||||
int IrdaAppRemoteManager::find_remote_name(const std::vector<std::string>& strings) {
|
||||
furi_assert(remote.get() != nullptr);
|
||||
int i = 0;
|
||||
for(const auto& str : strings) {
|
||||
if(!str.compare(remote->name)) {
|
||||
return i;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::rename_remote(const char* str) {
|
||||
bool InfraredAppRemoteManager::rename_remote(const char* str) {
|
||||
furi_check(str != nullptr);
|
||||
furi_check(remote.get() != nullptr);
|
||||
|
||||
|
@ -148,7 +137,7 @@ bool IrdaAppRemoteManager::rename_remote(const char* str) {
|
|||
return result;
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::rename_button(uint32_t index, const char* str) {
|
||||
bool InfraredAppRemoteManager::rename_button(uint32_t index, const char* str) {
|
||||
furi_check(remote.get() != nullptr);
|
||||
auto& buttons = remote->buttons;
|
||||
furi_check(index < buttons.size());
|
||||
|
@ -157,16 +146,16 @@ bool IrdaAppRemoteManager::rename_button(uint32_t index, const char* str) {
|
|||
return store();
|
||||
}
|
||||
|
||||
size_t IrdaAppRemoteManager::get_number_of_buttons() {
|
||||
size_t InfraredAppRemoteManager::get_number_of_buttons() {
|
||||
furi_check(remote.get() != nullptr);
|
||||
return remote->buttons.size();
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::store(void) {
|
||||
bool InfraredAppRemoteManager::store(void) {
|
||||
bool result = false;
|
||||
FileWorkerCpp file_worker;
|
||||
|
||||
if(!file_worker.mkdir(IrdaApp::irda_directory)) return false;
|
||||
if(!file_worker.mkdir(InfraredApp::infrared_directory)) return false;
|
||||
|
||||
Storage* storage = static_cast<Storage*>(furi_record_open("storage"));
|
||||
FlipperFormat* ff = flipper_format_file_alloc(storage);
|
||||
|
@ -178,7 +167,7 @@ bool IrdaAppRemoteManager::store(void) {
|
|||
}
|
||||
if(result) {
|
||||
for(const auto& button : remote->buttons) {
|
||||
result = irda_parser_save_signal(ff, button.signal, button.name.c_str());
|
||||
result = infrared_parser_save_signal(ff, button.signal, button.name.c_str());
|
||||
if(!result) {
|
||||
break;
|
||||
}
|
||||
|
@ -190,7 +179,7 @@ bool IrdaAppRemoteManager::store(void) {
|
|||
return result;
|
||||
}
|
||||
|
||||
bool IrdaAppRemoteManager::load(const std::string& remote_name) {
|
||||
bool InfraredAppRemoteManager::load(const std::string& remote_name) {
|
||||
bool result = false;
|
||||
Storage* storage = static_cast<Storage*>(furi_record_open("storage"));
|
||||
FlipperFormat* ff = flipper_format_file_alloc(storage);
|
||||
|
@ -208,10 +197,10 @@ bool IrdaAppRemoteManager::load(const std::string& remote_name) {
|
|||
string_clear(header);
|
||||
}
|
||||
if(result) {
|
||||
remote = std::make_unique<IrdaAppRemote>(remote_name);
|
||||
IrdaAppSignal signal;
|
||||
remote = std::make_unique<InfraredAppRemote>(remote_name);
|
||||
InfraredAppSignal signal;
|
||||
std::string signal_name;
|
||||
while(irda_parser_read_signal(ff, signal, signal_name)) {
|
||||
while(infrared_parser_read_signal(ff, signal, signal_name)) {
|
||||
remote->buttons.emplace_back(signal_name.c_str(), std::move(signal));
|
||||
}
|
||||
}
|
188
applications/infrared/infrared_app_remote_manager.h
Normal file
|
@ -0,0 +1,188 @@
|
|||
/**
|
||||
* @file infrared_app_remote_manager.h
|
||||
* Infrared: Remote manager class.
|
||||
* It holds remote, can load/save/rename remote,
|
||||
* add/remove/rename buttons.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "infrared_app_signal.h"
|
||||
|
||||
#include <infrared_worker.h>
|
||||
#include <infrared.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
/** Class to handle remote button */
|
||||
class InfraredAppRemoteButton {
|
||||
/** Allow field access */
|
||||
friend class InfraredAppRemoteManager;
|
||||
/** Name of signal */
|
||||
std::string name;
|
||||
/** Signal data */
|
||||
InfraredAppSignal signal;
|
||||
|
||||
public:
|
||||
/** Initialize remote button
|
||||
*
|
||||
* @param name - button name
|
||||
* @param signal - signal to copy for remote button
|
||||
*/
|
||||
InfraredAppRemoteButton(const char* name, const InfraredAppSignal& signal)
|
||||
: name(name)
|
||||
, signal(signal) {
|
||||
}
|
||||
|
||||
/** Initialize remote button
|
||||
*
|
||||
* @param name - button name
|
||||
* @param signal - signal to move for remote button
|
||||
*/
|
||||
InfraredAppRemoteButton(const char* name, InfraredAppSignal&& signal)
|
||||
: name(name)
|
||||
, signal(std::move(signal)) {
|
||||
}
|
||||
|
||||
/** Deinitialize remote button */
|
||||
~InfraredAppRemoteButton() {
|
||||
}
|
||||
};
|
||||
|
||||
/** Class to handle remote */
|
||||
class InfraredAppRemote {
|
||||
/** Allow field access */
|
||||
friend class InfraredAppRemoteManager;
|
||||
/** Button container */
|
||||
std::vector<InfraredAppRemoteButton> buttons;
|
||||
/** Name of remote */
|
||||
std::string name;
|
||||
|
||||
public:
|
||||
/** Initialize new remote
|
||||
*
|
||||
* @param name - new remote name
|
||||
*/
|
||||
InfraredAppRemote(const std::string& name)
|
||||
: name(name) {
|
||||
}
|
||||
};
|
||||
|
||||
/** Class to handle remote manager */
|
||||
class InfraredAppRemoteManager {
|
||||
/** Remote instance. There can be 1 remote loaded at a time. */
|
||||
std::unique_ptr<InfraredAppRemote> remote;
|
||||
/** Make full name from remote name
|
||||
*
|
||||
* @param remote_name name of remote
|
||||
* @retval full name of remote on disk
|
||||
*/
|
||||
std::string make_full_name(const std::string& remote_name) const;
|
||||
|
||||
public:
|
||||
/** Restriction to button name length. Buttons larger are ignored. */
|
||||
static constexpr const uint32_t max_button_name_length = 22;
|
||||
|
||||
/** Restriction to remote name length. Remotes larger are ignored. */
|
||||
static constexpr const uint32_t max_remote_name_length = 22;
|
||||
|
||||
/** Construct button from signal, and create remote
|
||||
*
|
||||
* @param button_name - name of button to create
|
||||
* @param signal - signal to create button from
|
||||
* @retval true for success, false otherwise
|
||||
* */
|
||||
bool add_remote_with_button(const char* button_name, const InfraredAppSignal& signal);
|
||||
|
||||
/** Add button to current remote
|
||||
*
|
||||
* @param button_name - name of button to create
|
||||
* @param signal - signal to create button from
|
||||
* @retval true for success, false otherwise
|
||||
* */
|
||||
bool add_button(const char* button_name, const InfraredAppSignal& signal);
|
||||
|
||||
/** Rename button in current remote
|
||||
*
|
||||
* @param index - index of button to rename
|
||||
* @param str - new button name
|
||||
*/
|
||||
bool rename_button(uint32_t index, const char* str);
|
||||
|
||||
/** Rename current remote
|
||||
*
|
||||
* @param str - new remote name
|
||||
*/
|
||||
bool rename_remote(const char* str);
|
||||
|
||||
/** Find vacant remote name. If suggested name is occupied,
|
||||
* incremented digit(2,3,4,etc) added to name and check repeated.
|
||||
*
|
||||
* @param name - suggested remote name
|
||||
* @retval garanteed free remote name, prefixed with suggested
|
||||
*/
|
||||
std::string find_vacant_remote_name(const std::string& name);
|
||||
|
||||
/** Get button list
|
||||
*
|
||||
* @retval container of button names
|
||||
*/
|
||||
std::vector<std::string> get_button_list() const;
|
||||
|
||||
/** Get button name by index
|
||||
*
|
||||
* @param index - index of button to get name from
|
||||
* @retval button name
|
||||
*/
|
||||
std::string get_button_name(uint32_t index);
|
||||
|
||||
/** Get remote name
|
||||
*
|
||||
* @retval remote name
|
||||
*/
|
||||
std::string get_remote_name();
|
||||
|
||||
/** Get number of buttons
|
||||
*
|
||||
* @retval number of buttons
|
||||
*/
|
||||
size_t get_number_of_buttons();
|
||||
|
||||
/** Get button's signal
|
||||
*
|
||||
* @param index - index of interested button
|
||||
* @retval signal
|
||||
*/
|
||||
const InfraredAppSignal& get_button_data(size_t index) const;
|
||||
|
||||
/** Delete button
|
||||
*
|
||||
* @param index - index of interested button
|
||||
* @retval true if success, false otherwise
|
||||
*/
|
||||
bool delete_button(uint32_t index);
|
||||
|
||||
/** Delete remote
|
||||
*
|
||||
* @retval true if success, false otherwise
|
||||
*/
|
||||
bool delete_remote();
|
||||
|
||||
/** Clean all loaded info in current remote */
|
||||
void reset_remote();
|
||||
|
||||
/** Store current remote data on disk
|
||||
*
|
||||
* @retval true if success, false otherwise
|
||||
*/
|
||||
bool store();
|
||||
|
||||
/** Load data from disk into current remote
|
||||
*
|
||||
* @param name - name of remote to load
|
||||
* @retval true if success, false otherwise
|
||||
*/
|
||||
bool load(const std::string& name);
|
||||
};
|
|
@ -1,7 +1,7 @@
|
|||
#include "irda_app_signal.h"
|
||||
#include <irda_transmit.h>
|
||||
#include "infrared_app_signal.h"
|
||||
#include <infrared_transmit.h>
|
||||
|
||||
void IrdaAppSignal::copy_raw_signal(
|
||||
void InfraredAppSignal::copy_raw_signal(
|
||||
const uint32_t* timings,
|
||||
size_t size,
|
||||
uint32_t frequency,
|
||||
|
@ -18,7 +18,7 @@ void IrdaAppSignal::copy_raw_signal(
|
|||
}
|
||||
}
|
||||
|
||||
void IrdaAppSignal::clear_timings() {
|
||||
void InfraredAppSignal::clear_timings() {
|
||||
if(raw_signal) {
|
||||
delete[] payload.raw.timings;
|
||||
payload.raw.timings_cnt = 0;
|
||||
|
@ -26,7 +26,7 @@ void IrdaAppSignal::clear_timings() {
|
|||
}
|
||||
}
|
||||
|
||||
IrdaAppSignal::IrdaAppSignal(
|
||||
InfraredAppSignal::InfraredAppSignal(
|
||||
const uint32_t* timings,
|
||||
size_t timings_cnt,
|
||||
uint32_t frequency,
|
||||
|
@ -35,12 +35,12 @@ IrdaAppSignal::IrdaAppSignal(
|
|||
copy_raw_signal(timings, timings_cnt, frequency, duty_cycle);
|
||||
}
|
||||
|
||||
IrdaAppSignal::IrdaAppSignal(const IrdaMessage* irda_message) {
|
||||
InfraredAppSignal::InfraredAppSignal(const InfraredMessage* infrared_message) {
|
||||
raw_signal = false;
|
||||
payload.message = *irda_message;
|
||||
payload.message = *infrared_message;
|
||||
}
|
||||
|
||||
IrdaAppSignal& IrdaAppSignal::operator=(const IrdaAppSignal& other) {
|
||||
InfraredAppSignal& InfraredAppSignal::operator=(const InfraredAppSignal& other) {
|
||||
clear_timings();
|
||||
raw_signal = other.raw_signal;
|
||||
if(!raw_signal) {
|
||||
|
@ -56,7 +56,7 @@ IrdaAppSignal& IrdaAppSignal::operator=(const IrdaAppSignal& other) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
IrdaAppSignal::IrdaAppSignal(const IrdaAppSignal& other) {
|
||||
InfraredAppSignal::InfraredAppSignal(const InfraredAppSignal& other) {
|
||||
raw_signal = other.raw_signal;
|
||||
if(!raw_signal) {
|
||||
payload.message = other.payload.message;
|
||||
|
@ -69,7 +69,7 @@ IrdaAppSignal::IrdaAppSignal(const IrdaAppSignal& other) {
|
|||
}
|
||||
}
|
||||
|
||||
IrdaAppSignal::IrdaAppSignal(IrdaAppSignal&& other) {
|
||||
InfraredAppSignal::InfraredAppSignal(InfraredAppSignal&& other) {
|
||||
raw_signal = other.raw_signal;
|
||||
if(!raw_signal) {
|
||||
payload.message = other.payload.message;
|
||||
|
@ -86,13 +86,13 @@ IrdaAppSignal::IrdaAppSignal(IrdaAppSignal&& other) {
|
|||
}
|
||||
}
|
||||
|
||||
void IrdaAppSignal::set_message(const IrdaMessage* irda_message) {
|
||||
void InfraredAppSignal::set_message(const InfraredMessage* infrared_message) {
|
||||
clear_timings();
|
||||
raw_signal = false;
|
||||
payload.message = *irda_message;
|
||||
payload.message = *infrared_message;
|
||||
}
|
||||
|
||||
void IrdaAppSignal::set_raw_signal(
|
||||
void InfraredAppSignal::set_raw_signal(
|
||||
uint32_t* timings,
|
||||
size_t timings_cnt,
|
||||
uint32_t frequency,
|
||||
|
@ -102,11 +102,11 @@ void IrdaAppSignal::set_raw_signal(
|
|||
copy_raw_signal(timings, timings_cnt, frequency, duty_cycle);
|
||||
}
|
||||
|
||||
void IrdaAppSignal::transmit() const {
|
||||
void InfraredAppSignal::transmit() const {
|
||||
if(!raw_signal) {
|
||||
irda_send(&payload.message, 1);
|
||||
infrared_send(&payload.message, 1);
|
||||
} else {
|
||||
irda_send_raw_ext(
|
||||
infrared_send_raw_ext(
|
||||
payload.raw.timings,
|
||||
payload.raw.timings_cnt,
|
||||
true,
|
134
applications/infrared/infrared_app_signal.h
Normal file
|
@ -0,0 +1,134 @@
|
|||
/**
|
||||
* @file infrared_app_signal.h
|
||||
* Infrared: Signal class
|
||||
*/
|
||||
#pragma once
|
||||
#include <infrared_worker.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <infrared.h>
|
||||
|
||||
/** Infrared application signal class */
|
||||
class InfraredAppSignal {
|
||||
public:
|
||||
/** Raw signal structure */
|
||||
typedef struct {
|
||||
/** Timings amount */
|
||||
size_t timings_cnt;
|
||||
/** Samples of raw signal in ms */
|
||||
uint32_t* timings;
|
||||
/** PWM Frequency of raw signal */
|
||||
uint32_t frequency;
|
||||
/** PWM Duty cycle of raw signal */
|
||||
float duty_cycle;
|
||||
} RawSignal;
|
||||
|
||||
private:
|
||||
/** if true - signal is raw, if false - signal is parsed */
|
||||
bool raw_signal;
|
||||
/** signal data, either raw or parsed */
|
||||
union {
|
||||
/** signal data for parsed signal */
|
||||
InfraredMessage message;
|
||||
/** raw signal data */
|
||||
RawSignal raw;
|
||||
} payload;
|
||||
|
||||
/** Copy raw signal into object
|
||||
*
|
||||
* @param timings - timings (samples) of raw signal
|
||||
* @param size - number of timings
|
||||
* @frequency - PWM frequency of raw signal
|
||||
* @duty_cycle - PWM duty cycle
|
||||
*/
|
||||
void
|
||||
copy_raw_signal(const uint32_t* timings, size_t size, uint32_t frequency, float duty_cycle);
|
||||
/** Clear and free timings data */
|
||||
void clear_timings();
|
||||
|
||||
public:
|
||||
/** Construct Infrared signal class */
|
||||
InfraredAppSignal() {
|
||||
raw_signal = false;
|
||||
payload.message.protocol = InfraredProtocolUnknown;
|
||||
}
|
||||
|
||||
/** Destruct signal class and free all allocated data */
|
||||
~InfraredAppSignal() {
|
||||
clear_timings();
|
||||
}
|
||||
|
||||
/** Construct object with raw signal
|
||||
*
|
||||
* @param timings - timings (samples) of raw signal
|
||||
* @param size - number of timings
|
||||
* @frequency - PWM frequency of raw signal
|
||||
* @duty_cycle - PWM duty cycle
|
||||
*/
|
||||
InfraredAppSignal(
|
||||
const uint32_t* timings,
|
||||
size_t timings_cnt,
|
||||
uint32_t frequency,
|
||||
float duty_cycle);
|
||||
|
||||
/** Construct object with parsed signal
|
||||
*
|
||||
* @param infrared_message - parsed_signal to construct from
|
||||
*/
|
||||
InfraredAppSignal(const InfraredMessage* infrared_message);
|
||||
|
||||
/** Copy constructor */
|
||||
InfraredAppSignal(const InfraredAppSignal& other);
|
||||
/** Move constructor */
|
||||
InfraredAppSignal(InfraredAppSignal&& other);
|
||||
|
||||
/** Assignment operator */
|
||||
InfraredAppSignal& operator=(const InfraredAppSignal& signal);
|
||||
|
||||
/** Set object to parsed signal
|
||||
*
|
||||
* @param infrared_message - parsed_signal to construct from
|
||||
*/
|
||||
void set_message(const InfraredMessage* infrared_message);
|
||||
|
||||
/** Set object to raw signal
|
||||
*
|
||||
* @param timings - timings (samples) of raw signal
|
||||
* @param size - number of timings
|
||||
* @frequency - PWM frequency of raw signal
|
||||
* @duty_cycle - PWM duty cycle
|
||||
*/
|
||||
void
|
||||
set_raw_signal(uint32_t* timings, size_t timings_cnt, uint32_t frequency, float duty_cycle);
|
||||
|
||||
/** Transmit held signal (???) */
|
||||
void transmit() const;
|
||||
|
||||
/** Show is held signal raw
|
||||
*
|
||||
* @retval true if signal is raw, false if signal is parsed
|
||||
*/
|
||||
bool is_raw(void) const {
|
||||
return raw_signal;
|
||||
}
|
||||
|
||||
/** Get parsed signal.
|
||||
* User must check is_raw() signal before calling this function.
|
||||
*
|
||||
* @retval parsed signal pointer
|
||||
*/
|
||||
const InfraredMessage& get_message(void) const {
|
||||
furi_assert(!raw_signal);
|
||||
return payload.message;
|
||||
}
|
||||
|
||||
/** Get raw signal.
|
||||
* User must check is_raw() signal before calling this function.
|
||||
*
|
||||
* @retval raw signal
|
||||
*/
|
||||
const RawSignal& get_raw_signal(void) const {
|
||||
furi_assert(raw_signal);
|
||||
return payload.raw;
|
||||
}
|
||||
};
|
|
@ -6,16 +6,16 @@
|
|||
#include <furi.h>
|
||||
#include <callback-connector.h>
|
||||
|
||||
#include "irda/irda_app_view_manager.h"
|
||||
#include "irda/view/irda_progress_view.h"
|
||||
#include "irda_app.h"
|
||||
#include "irda/irda_app_event.h"
|
||||
#include "infrared/infrared_app_view_manager.h"
|
||||
#include "infrared/view/infrared_progress_view.h"
|
||||
#include "infrared_app.h"
|
||||
#include "infrared/infrared_app_event.h"
|
||||
|
||||
IrdaAppViewManager::IrdaAppViewManager() {
|
||||
event_queue = osMessageQueueNew(10, sizeof(IrdaAppEvent), NULL);
|
||||
InfraredAppViewManager::InfraredAppViewManager() {
|
||||
event_queue = osMessageQueueNew(10, sizeof(InfraredAppEvent), NULL);
|
||||
|
||||
view_dispatcher = view_dispatcher_alloc();
|
||||
auto callback = cbc::obtain_connector(this, &IrdaAppViewManager::previous_view_callback);
|
||||
auto callback = cbc::obtain_connector(this, &InfraredAppViewManager::previous_view_callback);
|
||||
|
||||
gui = static_cast<Gui*>(furi_record_open("gui"));
|
||||
view_dispatcher_attach_to_gui(view_dispatcher, gui, ViewDispatcherTypeFullscreen);
|
||||
|
@ -26,18 +26,18 @@ IrdaAppViewManager::IrdaAppViewManager() {
|
|||
dialog_ex = dialog_ex_alloc();
|
||||
text_input = text_input_alloc();
|
||||
button_panel = button_panel_alloc();
|
||||
progress_view = irda_progress_view_alloc();
|
||||
progress_view = infrared_progress_view_alloc();
|
||||
loading_view = loading_alloc();
|
||||
universal_view_stack = view_stack_alloc();
|
||||
view_stack_add_view(universal_view_stack, button_panel_get_view(button_panel));
|
||||
view_set_orientation(view_stack_get_view(universal_view_stack), ViewOrientationVertical);
|
||||
|
||||
add_view(ViewType::UniversalRemote, view_stack_get_view(universal_view_stack));
|
||||
add_view(ViewType::ButtonMenu, button_menu_get_view(button_menu));
|
||||
add_view(ViewType::Submenu, submenu_get_view(submenu));
|
||||
add_view(ViewType::Popup, popup_get_view(popup));
|
||||
add_view(ViewType::DialogEx, dialog_ex_get_view(dialog_ex));
|
||||
add_view(ViewType::TextInput, text_input_get_view(text_input));
|
||||
add_view(ViewId::UniversalRemote, view_stack_get_view(universal_view_stack));
|
||||
add_view(ViewId::ButtonMenu, button_menu_get_view(button_menu));
|
||||
add_view(ViewId::Submenu, submenu_get_view(submenu));
|
||||
add_view(ViewId::Popup, popup_get_view(popup));
|
||||
add_view(ViewId::DialogEx, dialog_ex_get_view(dialog_ex));
|
||||
add_view(ViewId::TextInput, text_input_get_view(text_input));
|
||||
|
||||
view_set_previous_callback(view_stack_get_view(universal_view_stack), callback);
|
||||
view_set_previous_callback(button_menu_get_view(button_menu), callback);
|
||||
|
@ -47,19 +47,19 @@ IrdaAppViewManager::IrdaAppViewManager() {
|
|||
view_set_previous_callback(text_input_get_view(text_input), callback);
|
||||
}
|
||||
|
||||
IrdaAppViewManager::~IrdaAppViewManager() {
|
||||
InfraredAppViewManager::~InfraredAppViewManager() {
|
||||
view_dispatcher_remove_view(
|
||||
view_dispatcher, static_cast<uint32_t>(IrdaAppViewManager::ViewType::UniversalRemote));
|
||||
view_dispatcher, static_cast<uint32_t>(InfraredAppViewManager::ViewId::UniversalRemote));
|
||||
view_dispatcher_remove_view(
|
||||
view_dispatcher, static_cast<uint32_t>(IrdaAppViewManager::ViewType::ButtonMenu));
|
||||
view_dispatcher, static_cast<uint32_t>(InfraredAppViewManager::ViewId::ButtonMenu));
|
||||
view_dispatcher_remove_view(
|
||||
view_dispatcher, static_cast<uint32_t>(IrdaAppViewManager::ViewType::TextInput));
|
||||
view_dispatcher, static_cast<uint32_t>(InfraredAppViewManager::ViewId::TextInput));
|
||||
view_dispatcher_remove_view(
|
||||
view_dispatcher, static_cast<uint32_t>(IrdaAppViewManager::ViewType::DialogEx));
|
||||
view_dispatcher, static_cast<uint32_t>(InfraredAppViewManager::ViewId::DialogEx));
|
||||
view_dispatcher_remove_view(
|
||||
view_dispatcher, static_cast<uint32_t>(IrdaAppViewManager::ViewType::Submenu));
|
||||
view_dispatcher, static_cast<uint32_t>(InfraredAppViewManager::ViewId::Submenu));
|
||||
view_dispatcher_remove_view(
|
||||
view_dispatcher, static_cast<uint32_t>(IrdaAppViewManager::ViewType::Popup));
|
||||
view_dispatcher, static_cast<uint32_t>(InfraredAppViewManager::ViewId::Popup));
|
||||
|
||||
view_stack_remove_view(universal_view_stack, button_panel_get_view(button_panel));
|
||||
view_stack_free(universal_view_stack);
|
||||
|
@ -69,7 +69,7 @@ IrdaAppViewManager::~IrdaAppViewManager() {
|
|||
button_menu_free(button_menu);
|
||||
dialog_ex_free(dialog_ex);
|
||||
text_input_free(text_input);
|
||||
irda_progress_view_free(progress_view);
|
||||
infrared_progress_view_free(progress_view);
|
||||
loading_free(loading_view);
|
||||
|
||||
view_dispatcher_free(view_dispatcher);
|
||||
|
@ -77,70 +77,70 @@ IrdaAppViewManager::~IrdaAppViewManager() {
|
|||
osMessageQueueDelete(event_queue);
|
||||
}
|
||||
|
||||
void IrdaAppViewManager::switch_to(ViewType type) {
|
||||
void InfraredAppViewManager::switch_to(ViewId type) {
|
||||
view_dispatcher_switch_to_view(view_dispatcher, static_cast<uint32_t>(type));
|
||||
}
|
||||
|
||||
TextInput* IrdaAppViewManager::get_text_input() {
|
||||
TextInput* InfraredAppViewManager::get_text_input() {
|
||||
return text_input;
|
||||
}
|
||||
|
||||
DialogEx* IrdaAppViewManager::get_dialog_ex() {
|
||||
DialogEx* InfraredAppViewManager::get_dialog_ex() {
|
||||
return dialog_ex;
|
||||
}
|
||||
|
||||
Submenu* IrdaAppViewManager::get_submenu() {
|
||||
Submenu* InfraredAppViewManager::get_submenu() {
|
||||
return submenu;
|
||||
}
|
||||
|
||||
Popup* IrdaAppViewManager::get_popup() {
|
||||
Popup* InfraredAppViewManager::get_popup() {
|
||||
return popup;
|
||||
}
|
||||
|
||||
ButtonMenu* IrdaAppViewManager::get_button_menu() {
|
||||
ButtonMenu* InfraredAppViewManager::get_button_menu() {
|
||||
return button_menu;
|
||||
}
|
||||
|
||||
ButtonPanel* IrdaAppViewManager::get_button_panel() {
|
||||
ButtonPanel* InfraredAppViewManager::get_button_panel() {
|
||||
return button_panel;
|
||||
}
|
||||
|
||||
IrdaProgressView* IrdaAppViewManager::get_progress() {
|
||||
InfraredProgressView* InfraredAppViewManager::get_progress() {
|
||||
return progress_view;
|
||||
}
|
||||
|
||||
Loading* IrdaAppViewManager::get_loading() {
|
||||
Loading* InfraredAppViewManager::get_loading() {
|
||||
return loading_view;
|
||||
}
|
||||
|
||||
ViewStack* IrdaAppViewManager::get_universal_view_stack() {
|
||||
ViewStack* InfraredAppViewManager::get_universal_view_stack() {
|
||||
return universal_view_stack;
|
||||
}
|
||||
|
||||
osMessageQueueId_t IrdaAppViewManager::get_event_queue() {
|
||||
osMessageQueueId_t InfraredAppViewManager::get_event_queue() {
|
||||
return event_queue;
|
||||
}
|
||||
|
||||
void IrdaAppViewManager::clear_events() {
|
||||
IrdaAppEvent event;
|
||||
void InfraredAppViewManager::clear_events() {
|
||||
InfraredAppEvent event;
|
||||
while(osMessageQueueGet(event_queue, &event, NULL, 0) == osOK)
|
||||
;
|
||||
}
|
||||
|
||||
void IrdaAppViewManager::receive_event(IrdaAppEvent* event) {
|
||||
void InfraredAppViewManager::receive_event(InfraredAppEvent* event) {
|
||||
if(osMessageQueueGet(event_queue, event, NULL, 100) != osOK) {
|
||||
event->type = IrdaAppEvent::Type::Tick;
|
||||
event->type = InfraredAppEvent::Type::Tick;
|
||||
}
|
||||
}
|
||||
|
||||
void IrdaAppViewManager::send_event(IrdaAppEvent* event) {
|
||||
void InfraredAppViewManager::send_event(InfraredAppEvent* event) {
|
||||
uint32_t timeout = 0;
|
||||
/* Rapid button hammering on signal send scenes causes queue overflow - ignore it,
|
||||
* but try to keep button release event - it switches off IRDA DMA sending. */
|
||||
if(event->type == IrdaAppEvent::Type::MenuSelectedRelease) {
|
||||
* but try to keep button release event - it switches off INFRARED DMA sending. */
|
||||
if(event->type == InfraredAppEvent::Type::MenuSelectedRelease) {
|
||||
timeout = 200;
|
||||
}
|
||||
if((event->type == IrdaAppEvent::Type::DialogExSelected) &&
|
||||
if((event->type == InfraredAppEvent::Type::DialogExSelected) &&
|
||||
(event->payload.dialog_ex_result == DialogExReleaseCenter)) {
|
||||
timeout = 200;
|
||||
}
|
||||
|
@ -148,16 +148,16 @@ void IrdaAppViewManager::send_event(IrdaAppEvent* event) {
|
|||
osMessageQueuePut(event_queue, event, 0, timeout);
|
||||
}
|
||||
|
||||
uint32_t IrdaAppViewManager::previous_view_callback(void* context) {
|
||||
uint32_t InfraredAppViewManager::previous_view_callback(void* context) {
|
||||
if(event_queue != NULL) {
|
||||
IrdaAppEvent event;
|
||||
event.type = IrdaAppEvent::Type::Back;
|
||||
InfraredAppEvent event;
|
||||
event.type = InfraredAppEvent::Type::Back;
|
||||
send_event(&event);
|
||||
}
|
||||
|
||||
return VIEW_IGNORE;
|
||||
}
|
||||
|
||||
void IrdaAppViewManager::add_view(ViewType view_type, View* view) {
|
||||
void InfraredAppViewManager::add_view(ViewId view_type, View* view) {
|
||||
view_dispatcher_add_view(view_dispatcher, static_cast<uint32_t>(view_type), view);
|
||||
}
|
164
applications/infrared/infrared_app_view_manager.h
Normal file
|
@ -0,0 +1,164 @@
|
|||
/**
|
||||
* @file infrared_app_view_manager.h
|
||||
* Infrared: Scene events description
|
||||
*/
|
||||
#pragma once
|
||||
#include <gui/modules/button_menu.h>
|
||||
#include <gui/modules/text_input.h>
|
||||
#include <gui/view_stack.h>
|
||||
#include <gui/modules/button_panel.h>
|
||||
#include <furi.h>
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/modules/dialog_ex.h>
|
||||
#include <gui/modules/submenu.h>
|
||||
#include <gui/modules/popup.h>
|
||||
#include <gui/modules/loading.h>
|
||||
|
||||
#include "infrared_app_event.h"
|
||||
#include "view/infrared_progress_view.h"
|
||||
|
||||
/** Infrared View manager class */
|
||||
class InfraredAppViewManager {
|
||||
public:
|
||||
/** Infrared View Id enum, it is used
|
||||
* to identify added views */
|
||||
enum class ViewId : uint8_t {
|
||||
DialogEx,
|
||||
TextInput,
|
||||
Submenu,
|
||||
ButtonMenu,
|
||||
UniversalRemote,
|
||||
Popup,
|
||||
};
|
||||
|
||||
/** Class constructor */
|
||||
InfraredAppViewManager();
|
||||
/** Class destructor */
|
||||
~InfraredAppViewManager();
|
||||
|
||||
/** Switch to another view
|
||||
*
|
||||
* @param id - view id to switch to
|
||||
*/
|
||||
void switch_to(ViewId id);
|
||||
|
||||
/** Receive event from queue
|
||||
*
|
||||
* @param event - received event
|
||||
*/
|
||||
void receive_event(InfraredAppEvent* event);
|
||||
|
||||
/** Send event to queue
|
||||
*
|
||||
* @param event - event to send
|
||||
*/
|
||||
void send_event(InfraredAppEvent* event);
|
||||
|
||||
/** Clear events that already in queue
|
||||
*
|
||||
* @param event - event to send
|
||||
*/
|
||||
void clear_events();
|
||||
|
||||
/** Get dialog_ex view module
|
||||
*
|
||||
* @retval dialog_ex view module
|
||||
*/
|
||||
DialogEx* get_dialog_ex();
|
||||
|
||||
/** Get submenu view module
|
||||
*
|
||||
* @retval submenu view module
|
||||
*/
|
||||
Submenu* get_submenu();
|
||||
|
||||
/** Get popup view module
|
||||
*
|
||||
* @retval popup view module
|
||||
*/
|
||||
Popup* get_popup();
|
||||
|
||||
/** Get text_input view module
|
||||
*
|
||||
* @retval text_input view module
|
||||
*/
|
||||
TextInput* get_text_input();
|
||||
|
||||
/** Get button_menu view module
|
||||
*
|
||||
* @retval button_menu view module
|
||||
*/
|
||||
ButtonMenu* get_button_menu();
|
||||
|
||||
/** Get button_panel view module
|
||||
*
|
||||
* @retval button_panel view module
|
||||
*/
|
||||
ButtonPanel* get_button_panel();
|
||||
|
||||
/** Get view_stack view module used in universal remote
|
||||
*
|
||||
* @retval view_stack view module
|
||||
*/
|
||||
ViewStack* get_universal_view_stack();
|
||||
|
||||
/** Get progress view module
|
||||
*
|
||||
* @retval progress view module
|
||||
*/
|
||||
InfraredProgressView* get_progress();
|
||||
|
||||
/** Get loading view module
|
||||
*
|
||||
* @retval loading view module
|
||||
*/
|
||||
Loading* get_loading();
|
||||
|
||||
/** Get event queue
|
||||
*
|
||||
* @retval event queue
|
||||
*/
|
||||
osMessageQueueId_t get_event_queue();
|
||||
|
||||
/** Callback to handle back button
|
||||
*
|
||||
* @param context - context to pass to callback
|
||||
* @retval always returns VIEW_IGNORE
|
||||
*/
|
||||
uint32_t previous_view_callback(void* context);
|
||||
|
||||
private:
|
||||
/** View Dispatcher instance.
|
||||
* It handles view switching */
|
||||
ViewDispatcher* view_dispatcher;
|
||||
/** Gui instance */
|
||||
Gui* gui;
|
||||
/** Text input view module instance */
|
||||
TextInput* text_input;
|
||||
/** DialogEx view module instance */
|
||||
DialogEx* dialog_ex;
|
||||
/** Submenu view module instance */
|
||||
Submenu* submenu;
|
||||
/** Popup view module instance */
|
||||
Popup* popup;
|
||||
/** ButtonMenu view module instance */
|
||||
ButtonMenu* button_menu;
|
||||
/** ButtonPanel view module instance */
|
||||
ButtonPanel* button_panel;
|
||||
/** ViewStack view module instance */
|
||||
ViewStack* universal_view_stack;
|
||||
/** ProgressView view module instance */
|
||||
InfraredProgressView* progress_view;
|
||||
/** Loading view module instance */
|
||||
Loading* loading_view;
|
||||
|
||||
/** Queue to handle events, which are processed in scenes */
|
||||
osMessageQueueId_t event_queue;
|
||||
|
||||
/** Add View to pull of views
|
||||
*
|
||||
* @param view_id - id to identify view
|
||||
* @param view - view to add
|
||||
*/
|
||||
void add_view(ViewId view_id, View* view);
|
||||
};
|
9
applications/infrared/infrared_runner.cpp
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include "infrared_app.h"
|
||||
|
||||
extern "C" int32_t infrared_app(void* p) {
|
||||
InfraredApp* app = new InfraredApp();
|
||||
int32_t result = app->run(p);
|
||||
delete app;
|
||||
|
||||
return result;
|
||||
}
|
305
applications/infrared/scene/infrared_app_scene.h
Normal file
|
@ -0,0 +1,305 @@
|
|||
/**
|
||||
* @file infrared_app_scene.h
|
||||
* Infrared: Application scenes
|
||||
*/
|
||||
#pragma once
|
||||
#include "../infrared_app_event.h"
|
||||
#include <furi_hal_infrared.h>
|
||||
#include "infrared.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "../infrared_app_brute_force.h"
|
||||
|
||||
/** Anonymous class */
|
||||
class InfraredApp;
|
||||
|
||||
/** Base Scene class */
|
||||
class InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
virtual void on_enter(InfraredApp* app) = 0;
|
||||
/** Events handler callback */
|
||||
virtual bool on_event(InfraredApp* app, InfraredAppEvent* event) = 0;
|
||||
/** Called when exit scene */
|
||||
virtual void on_exit(InfraredApp* app) = 0;
|
||||
/** Virtual destructor of base class */
|
||||
virtual ~InfraredAppScene(){};
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
/** Start scene
|
||||
* Main Infrared application menu
|
||||
*/
|
||||
class InfraredAppSceneStart : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
private:
|
||||
/** Save previously selected submenu index
|
||||
* to highlight it when get back */
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
|
||||
/** Universal menu scene
|
||||
* Scene to select universal remote
|
||||
*/
|
||||
class InfraredAppSceneUniversal : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
private:
|
||||
/** Save previously selected submenu index
|
||||
* to highlight it when get back */
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
|
||||
/** Learn new signal scene
|
||||
* On this scene catching new IR signal performed.
|
||||
*/
|
||||
class InfraredAppSceneLearn : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
/** New signal learn succeeded scene
|
||||
*/
|
||||
class InfraredAppSceneLearnSuccess : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
bool button_pressed = false;
|
||||
};
|
||||
|
||||
/** Scene to enter name for new button in remote
|
||||
*/
|
||||
class InfraredAppSceneLearnEnterName : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
/** Scene where signal is learnt
|
||||
*/
|
||||
class InfraredAppSceneLearnDone : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
/** Remote interface scene
|
||||
* On this scene you can send IR signals from selected remote
|
||||
*/
|
||||
class InfraredAppSceneRemote : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
private:
|
||||
/** container of button names in current remote. */
|
||||
std::vector<std::string> buttons_names;
|
||||
/** Save previously selected index
|
||||
* to highlight it when get back */
|
||||
uint32_t buttonmenu_item_selected = 0;
|
||||
/** state flag to show button is pressed.
|
||||
* As long as send-signal button pressed no other button
|
||||
* events are handled. */
|
||||
bool button_pressed = false;
|
||||
};
|
||||
|
||||
/** List of remotes scene
|
||||
* Every remote is a file, located on internal/external storage.
|
||||
* Every file has same format, and same extension.
|
||||
* Files are parsed as you enter 'Remote scene' and showed
|
||||
* as a buttons.
|
||||
*/
|
||||
class InfraredAppSceneRemoteList : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
private:
|
||||
/** Save previously selected index
|
||||
* to highlight it when get back */
|
||||
uint32_t submenu_item_selected = 0;
|
||||
/** Remote names to show them in submenu */
|
||||
std::vector<std::string> remote_names;
|
||||
};
|
||||
|
||||
class InfraredAppSceneAskBack : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
class InfraredAppSceneEdit : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
private:
|
||||
/** Save previously selected index
|
||||
* to highlight it when get back */
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
|
||||
class InfraredAppSceneEditKeySelect : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
private:
|
||||
/** Button names to show them in submenu */
|
||||
std::vector<std::string> buttons_names;
|
||||
};
|
||||
|
||||
class InfraredAppSceneEditRename : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
class InfraredAppSceneEditDelete : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
class InfraredAppSceneEditRenameDone : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
class InfraredAppSceneEditDeleteDone : public InfraredAppScene {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
};
|
||||
|
||||
class InfraredAppSceneUniversalCommon : public InfraredAppScene {
|
||||
/** Brute force started flag */
|
||||
bool brute_force_started = false;
|
||||
|
||||
protected:
|
||||
/** Events handler callback */
|
||||
bool on_event(InfraredApp* app, InfraredAppEvent* event) final;
|
||||
/** Called when exit scene */
|
||||
void on_exit(InfraredApp* app) final;
|
||||
|
||||
/** Show popup window
|
||||
*
|
||||
* @param app - application instance
|
||||
*/
|
||||
void show_popup(InfraredApp* app, int record_amount);
|
||||
|
||||
/** Hide popup window
|
||||
*
|
||||
* @param app - application instance
|
||||
*/
|
||||
void hide_popup(InfraredApp* app);
|
||||
|
||||
/** Propagate progress in popup window
|
||||
*
|
||||
* @param app - application instance
|
||||
*/
|
||||
bool progress_popup(InfraredApp* app);
|
||||
|
||||
/** Item selected callback
|
||||
*
|
||||
* @param context - context
|
||||
* @param index - selected item index
|
||||
*/
|
||||
static void infrared_app_item_callback(void* context, uint32_t index);
|
||||
|
||||
/** Brute Force instance */
|
||||
InfraredAppBruteForce brute_force;
|
||||
|
||||
/** Constructor */
|
||||
InfraredAppSceneUniversalCommon(const char* filename)
|
||||
: brute_force(filename) {
|
||||
}
|
||||
|
||||
/** Destructor */
|
||||
~InfraredAppSceneUniversalCommon() {
|
||||
}
|
||||
};
|
||||
|
||||
class InfraredAppSceneUniversalTV : public InfraredAppSceneUniversalCommon {
|
||||
public:
|
||||
/** Called when enter scene */
|
||||
void on_enter(InfraredApp* app) final;
|
||||
|
||||
/** Constructor
|
||||
* Specifies path to brute force db library */
|
||||
InfraredAppSceneUniversalTV()
|
||||
: InfraredAppSceneUniversalCommon("/ext/infrared/assets/tv.ir") {
|
||||
}
|
||||
|
||||
/** Destructor */
|
||||
~InfraredAppSceneUniversalTV() {
|
||||
}
|
||||
};
|
|
@ -1,21 +1,21 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "gui/modules/dialog_ex.h"
|
||||
#include "irda.h"
|
||||
#include "irda/scene/irda_app_scene.h"
|
||||
#include "infrared.h"
|
||||
#include "infrared/scene/infrared_app_scene.h"
|
||||
#include <string>
|
||||
|
||||
static void dialog_result_callback(DialogExResult result, void* context) {
|
||||
auto app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
auto app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::DialogExSelected;
|
||||
event.type = InfraredAppEvent::Type::DialogExSelected;
|
||||
event.payload.dialog_ex_result = result;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneAskBack::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneAskBack::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
DialogEx* dialog_ex = view_manager->get_dialog_ex();
|
||||
|
||||
if(app->get_learn_new_remote()) {
|
||||
|
@ -33,21 +33,21 @@ void IrdaAppSceneAskBack::on_enter(IrdaApp* app) {
|
|||
dialog_ex_set_result_callback(dialog_ex, dialog_result_callback);
|
||||
dialog_ex_set_context(dialog_ex, app);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::DialogEx);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::DialogEx);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneAskBack::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneAskBack::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::DialogExSelected) {
|
||||
if(event->type == InfraredAppEvent::Type::DialogExSelected) {
|
||||
switch(event->payload.dialog_ex_result) {
|
||||
case DialogExResultLeft:
|
||||
consumed = true;
|
||||
if(app->get_learn_new_remote()) {
|
||||
app->search_and_switch_to_previous_scene({IrdaApp::Scene::Start});
|
||||
app->search_and_switch_to_previous_scene({InfraredApp::Scene::Start});
|
||||
} else {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{IrdaApp::Scene::Edit, IrdaApp::Scene::Remote});
|
||||
{InfraredApp::Scene::Edit, InfraredApp::Scene::Remote});
|
||||
}
|
||||
break;
|
||||
case DialogExResultCenter:
|
||||
|
@ -62,12 +62,12 @@ bool IrdaAppSceneAskBack::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
}
|
||||
}
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::Back) {
|
||||
if(event->type == InfraredAppEvent::Type::Back) {
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneAskBack::on_exit(IrdaApp* app) {
|
||||
void InfraredAppSceneAskBack::on_exit(InfraredApp* app) {
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "gui/modules/submenu.h"
|
||||
|
||||
typedef enum {
|
||||
|
@ -10,17 +10,17 @@ typedef enum {
|
|||
} SubmenuIndex;
|
||||
|
||||
static void submenu_callback(void* context, uint32_t index) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::MenuSelected;
|
||||
event.type = InfraredAppEvent::Type::MenuSelected;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneEdit::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneEdit::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_add_item(submenu, "Add key", SubmenuIndexAddKey, submenu_callback, app);
|
||||
|
@ -31,38 +31,38 @@ void IrdaAppSceneEdit::on_enter(IrdaApp* app) {
|
|||
submenu_set_selected_item(submenu, submenu_item_selected);
|
||||
submenu_item_selected = 0;
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Submenu);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Submenu);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneEdit::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneEdit::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::MenuSelected) {
|
||||
if(event->type == InfraredAppEvent::Type::MenuSelected) {
|
||||
submenu_item_selected = event->payload.menu_index;
|
||||
switch(event->payload.menu_index) {
|
||||
case SubmenuIndexAddKey:
|
||||
app->set_learn_new_remote(false);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Learn);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Learn);
|
||||
break;
|
||||
case SubmenuIndexRenameKey:
|
||||
app->set_edit_action(IrdaApp::EditAction::Rename);
|
||||
app->set_edit_element(IrdaApp::EditElement::Button);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditKeySelect);
|
||||
app->set_edit_action(InfraredApp::EditAction::Rename);
|
||||
app->set_edit_element(InfraredApp::EditElement::Button);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditKeySelect);
|
||||
break;
|
||||
case SubmenuIndexDeleteKey:
|
||||
app->set_edit_action(IrdaApp::EditAction::Delete);
|
||||
app->set_edit_element(IrdaApp::EditElement::Button);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditKeySelect);
|
||||
app->set_edit_action(InfraredApp::EditAction::Delete);
|
||||
app->set_edit_element(InfraredApp::EditElement::Button);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditKeySelect);
|
||||
break;
|
||||
case SubmenuIndexRenameRemote:
|
||||
app->set_edit_action(IrdaApp::EditAction::Rename);
|
||||
app->set_edit_element(IrdaApp::EditElement::Remote);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditRename);
|
||||
app->set_edit_action(InfraredApp::EditAction::Rename);
|
||||
app->set_edit_element(InfraredApp::EditElement::Remote);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditRename);
|
||||
break;
|
||||
case SubmenuIndexDeleteRemote:
|
||||
app->set_edit_action(IrdaApp::EditAction::Delete);
|
||||
app->set_edit_element(IrdaApp::EditElement::Remote);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditDelete);
|
||||
app->set_edit_action(InfraredApp::EditAction::Delete);
|
||||
app->set_edit_element(InfraredApp::EditElement::Remote);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditDelete);
|
||||
break;
|
||||
}
|
||||
consumed = true;
|
||||
|
@ -71,8 +71,8 @@ bool IrdaAppSceneEdit::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneEdit::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneEdit::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_reset(submenu);
|
|
@ -1,25 +1,25 @@
|
|||
#include "../irda_app.h"
|
||||
#include "irda.h"
|
||||
#include "irda/scene/irda_app_scene.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "infrared.h"
|
||||
#include "infrared/scene/infrared_app_scene.h"
|
||||
#include <string>
|
||||
|
||||
static void dialog_result_callback(DialogExResult result, void* context) {
|
||||
auto app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
auto app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::DialogExSelected;
|
||||
event.type = InfraredAppEvent::Type::DialogExSelected;
|
||||
event.payload.dialog_ex_result = result;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditDelete::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneEditDelete::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
DialogEx* dialog_ex = view_manager->get_dialog_ex();
|
||||
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
|
||||
if(app->get_edit_element() == IrdaApp::EditElement::Button) {
|
||||
if(app->get_edit_element() == InfraredApp::EditElement::Button) {
|
||||
auto signal = remote_manager->get_button_data(app->get_current_button());
|
||||
dialog_ex_set_header(dialog_ex, "Delete button?", 64, 0, AlignCenter, AlignTop);
|
||||
if(!signal.is_raw()) {
|
||||
|
@ -28,10 +28,10 @@ void IrdaAppSceneEditDelete::on_enter(IrdaApp* app) {
|
|||
0,
|
||||
"%s\n%s\nA=0x%0*lX C=0x%0*lX",
|
||||
remote_manager->get_button_name(app->get_current_button()).c_str(),
|
||||
irda_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(irda_get_protocol_address_length(message->protocol), 4),
|
||||
infrared_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(infrared_get_protocol_address_length(message->protocol), 4),
|
||||
message->address,
|
||||
ROUND_UP_TO(irda_get_protocol_command_length(message->protocol), 4),
|
||||
ROUND_UP_TO(infrared_get_protocol_command_length(message->protocol), 4),
|
||||
message->command);
|
||||
} else {
|
||||
app->set_text_store(
|
||||
|
@ -56,13 +56,13 @@ void IrdaAppSceneEditDelete::on_enter(IrdaApp* app) {
|
|||
dialog_ex_set_result_callback(dialog_ex, dialog_result_callback);
|
||||
dialog_ex_set_context(dialog_ex, app);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::DialogEx);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::DialogEx);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneEditDelete::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneEditDelete::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::DialogExSelected) {
|
||||
if(event->type == InfraredAppEvent::Type::DialogExSelected) {
|
||||
switch(event->payload.dialog_ex_result) {
|
||||
case DialogExResultLeft:
|
||||
app->switch_to_previous_scene();
|
||||
|
@ -73,18 +73,18 @@ bool IrdaAppSceneEditDelete::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
case DialogExResultRight: {
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
bool result = false;
|
||||
if(app->get_edit_element() == IrdaApp::EditElement::Remote) {
|
||||
if(app->get_edit_element() == InfraredApp::EditElement::Remote) {
|
||||
result = remote_manager->delete_remote();
|
||||
} else {
|
||||
result = remote_manager->delete_button(app->get_current_button());
|
||||
app->set_current_button(IrdaApp::ButtonNA);
|
||||
app->set_current_button(InfraredApp::ButtonNA);
|
||||
}
|
||||
|
||||
if(!result) {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{IrdaApp::Scene::RemoteList, IrdaApp::Scene::Start});
|
||||
{InfraredApp::Scene::RemoteList, InfraredApp::Scene::Start});
|
||||
} else {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditDeleteDone);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditDeleteDone);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -96,5 +96,5 @@ bool IrdaAppSceneEditDelete::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditDelete::on_exit(IrdaApp* app) {
|
||||
void InfraredAppSceneEditDelete::on_exit(InfraredApp* app) {
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#include "../infrared_app.h"
|
||||
|
||||
void InfraredAppSceneEditDeleteDone::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
|
||||
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
|
||||
popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
|
||||
|
||||
popup_set_callback(popup, InfraredApp::popup_callback);
|
||||
popup_set_context(popup, app);
|
||||
popup_set_timeout(popup, 1500);
|
||||
popup_enable_timeout(popup);
|
||||
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Popup);
|
||||
}
|
||||
|
||||
bool InfraredAppSceneEditDeleteDone::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == InfraredAppEvent::Type::PopupTimer) {
|
||||
if(app->get_edit_element() == InfraredApp::EditElement::Remote) {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{InfraredApp::Scene::Start, InfraredApp::Scene::RemoteList});
|
||||
} else {
|
||||
app->search_and_switch_to_previous_scene({InfraredApp::Scene::Remote});
|
||||
}
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void InfraredAppSceneEditDeleteDone::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
popup_set_header(popup, nullptr, 0, 0, AlignLeft, AlignTop);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
#include "../infrared_app.h"
|
||||
#include "gui/modules/submenu.h"
|
||||
|
||||
static void submenu_callback(void* context, uint32_t index) {
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = InfraredAppEvent::Type::MenuSelected;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void InfraredAppSceneEditKeySelect::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
int item_number = 0;
|
||||
|
||||
const char* header =
|
||||
app->get_edit_action() == InfraredApp::EditAction::Rename ? "Rename key:" : "Delete key:";
|
||||
submenu_set_header(submenu, header);
|
||||
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
buttons_names = remote_manager->get_button_list();
|
||||
for(const auto& it : buttons_names) {
|
||||
submenu_add_item(submenu, it.c_str(), item_number++, submenu_callback, app);
|
||||
}
|
||||
if((item_number > 0) && (app->get_current_button() != InfraredApp::ButtonNA)) {
|
||||
submenu_set_selected_item(submenu, app->get_current_button());
|
||||
app->set_current_button(InfraredApp::ButtonNA);
|
||||
}
|
||||
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Submenu);
|
||||
}
|
||||
|
||||
bool InfraredAppSceneEditKeySelect::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == InfraredAppEvent::Type::MenuSelected) {
|
||||
app->set_current_button(event->payload.menu_index);
|
||||
consumed = true;
|
||||
if(app->get_edit_action() == InfraredApp::EditAction::Rename) {
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditRename);
|
||||
} else {
|
||||
app->switch_to_next_scene(InfraredApp::Scene::EditDelete);
|
||||
}
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void InfraredAppSceneEditKeySelect::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_reset(submenu);
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
|
||||
void IrdaAppSceneEditRename::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneEditRename::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
TextInput* text_input = view_manager->get_text_input();
|
||||
size_t enter_name_length = 0;
|
||||
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
if(app->get_edit_element() == IrdaApp::EditElement::Button) {
|
||||
furi_assert(app->get_current_button() != IrdaApp::ButtonNA);
|
||||
if(app->get_edit_element() == InfraredApp::EditElement::Button) {
|
||||
furi_assert(app->get_current_button() != InfraredApp::ButtonNA);
|
||||
auto button_name = remote_manager->get_button_name(app->get_current_button());
|
||||
char* buffer_str = app->get_text_store(0);
|
||||
size_t max_len = IrdaAppRemoteManager::max_button_name_length;
|
||||
size_t max_len = InfraredAppRemoteManager::max_button_name_length;
|
||||
strncpy(buffer_str, button_name.c_str(), max_len);
|
||||
buffer_str[max_len + 1] = 0;
|
||||
enter_name_length = max_len;
|
||||
|
@ -18,43 +18,43 @@ void IrdaAppSceneEditRename::on_enter(IrdaApp* app) {
|
|||
} else {
|
||||
auto remote_name = remote_manager->get_remote_name();
|
||||
strncpy(app->get_text_store(0), remote_name.c_str(), app->get_text_store_size());
|
||||
enter_name_length = IrdaAppRemoteManager::max_remote_name_length;
|
||||
enter_name_length = InfraredAppRemoteManager::max_remote_name_length;
|
||||
text_input_set_header_text(text_input, "Name the remote");
|
||||
|
||||
ValidatorIsFile* validator_is_file =
|
||||
validator_is_file_alloc_init(app->irda_directory, app->irda_extension);
|
||||
validator_is_file_alloc_init(app->infrared_directory, app->infrared_extension);
|
||||
text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
|
||||
}
|
||||
|
||||
text_input_set_result_callback(
|
||||
text_input,
|
||||
IrdaApp::text_input_callback,
|
||||
InfraredApp::text_input_callback,
|
||||
app,
|
||||
app->get_text_store(0),
|
||||
enter_name_length,
|
||||
false);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::TextInput);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::TextInput);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneEditRename::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneEditRename::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::TextEditDone) {
|
||||
if(event->type == InfraredAppEvent::Type::TextEditDone) {
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
bool result = false;
|
||||
if(app->get_edit_element() == IrdaApp::EditElement::Button) {
|
||||
if(app->get_edit_element() == InfraredApp::EditElement::Button) {
|
||||
result =
|
||||
remote_manager->rename_button(app->get_current_button(), app->get_text_store(0));
|
||||
app->set_current_button(IrdaApp::ButtonNA);
|
||||
app->set_current_button(InfraredApp::ButtonNA);
|
||||
} else {
|
||||
result = remote_manager->rename_remote(app->get_text_store(0));
|
||||
}
|
||||
if(!result) {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{IrdaApp::Scene::Start, IrdaApp::Scene::RemoteList});
|
||||
{InfraredApp::Scene::Start, InfraredApp::Scene::RemoteList});
|
||||
} else {
|
||||
app->switch_to_next_scene_without_saving(IrdaApp::Scene::EditRenameDone);
|
||||
app->switch_to_next_scene_without_saving(InfraredApp::Scene::EditRenameDone);
|
||||
}
|
||||
consumed = true;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ bool IrdaAppSceneEditRename::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditRename::on_exit(IrdaApp* app) {
|
||||
void InfraredAppSceneEditRename::on_exit(InfraredApp* app) {
|
||||
TextInput* text_input = app->get_view_manager()->get_text_input();
|
||||
|
||||
void* validator_context = text_input_get_validator_callback_context(text_input);
|
|
@ -0,0 +1,31 @@
|
|||
#include "../infrared_app.h"
|
||||
|
||||
void InfraredAppSceneEditRenameDone::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
|
||||
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
|
||||
|
||||
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
|
||||
|
||||
popup_set_callback(popup, InfraredApp::popup_callback);
|
||||
popup_set_context(popup, app);
|
||||
popup_set_timeout(popup, 1500);
|
||||
popup_enable_timeout(popup);
|
||||
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Popup);
|
||||
}
|
||||
|
||||
bool InfraredAppSceneEditRenameDone::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == InfraredAppEvent::Type::PopupTimer) {
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Remote);
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void InfraredAppSceneEditRenameDone::on_exit(InfraredApp* app) {
|
||||
}
|
75
applications/infrared/scene/infrared_app_scene_learn.cpp
Normal file
|
@ -0,0 +1,75 @@
|
|||
#include "../infrared_app.h"
|
||||
#include "../infrared_app_event.h"
|
||||
#include "infrared.h"
|
||||
#include <infrared_worker.h>
|
||||
|
||||
static void signal_received_callback(void* context, InfraredWorkerSignal* received_signal) {
|
||||
furi_assert(context);
|
||||
furi_assert(received_signal);
|
||||
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
|
||||
if(infrared_worker_signal_is_decoded(received_signal)) {
|
||||
InfraredAppSignal signal(infrared_worker_get_decoded_signal(received_signal));
|
||||
app->set_received_signal(signal);
|
||||
} else {
|
||||
const uint32_t* timings;
|
||||
size_t timings_cnt;
|
||||
infrared_worker_get_raw_signal(received_signal, &timings, &timings_cnt);
|
||||
InfraredAppSignal signal(
|
||||
timings, timings_cnt, INFRARED_COMMON_CARRIER_FREQUENCY, INFRARED_COMMON_DUTY_CYCLE);
|
||||
app->set_received_signal(signal);
|
||||
}
|
||||
|
||||
infrared_worker_rx_set_received_signal_callback(app->get_infrared_worker(), NULL, NULL);
|
||||
InfraredAppEvent event;
|
||||
event.type = InfraredAppEvent::Type::InfraredMessageReceived;
|
||||
auto view_manager = app->get_view_manager();
|
||||
view_manager->send_event(&event);
|
||||
}
|
||||
|
||||
void InfraredAppSceneLearn::on_enter(InfraredApp* app) {
|
||||
auto view_manager = app->get_view_manager();
|
||||
auto popup = view_manager->get_popup();
|
||||
|
||||
auto worker = app->get_infrared_worker();
|
||||
infrared_worker_rx_set_received_signal_callback(worker, signal_received_callback, app);
|
||||
infrared_worker_rx_start(worker);
|
||||
|
||||
popup_set_icon(popup, 0, 32, &I_InfraredLearnShort_128x31);
|
||||
popup_set_text(
|
||||
popup, "Point the remote at IR port\nand push the button", 5, 10, AlignLeft, AlignCenter);
|
||||
popup_set_callback(popup, NULL);
|
||||
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Popup);
|
||||
}
|
||||
|
||||
bool InfraredAppSceneLearn::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
switch(event->type) {
|
||||
case InfraredAppEvent::Type::Tick:
|
||||
consumed = true;
|
||||
app->notify_red_blink();
|
||||
break;
|
||||
case InfraredAppEvent::Type::InfraredMessageReceived:
|
||||
app->notify_success();
|
||||
app->switch_to_next_scene_without_saving(InfraredApp::Scene::LearnSuccess);
|
||||
break;
|
||||
case InfraredAppEvent::Type::Back:
|
||||
consumed = true;
|
||||
app->switch_to_previous_scene();
|
||||
break;
|
||||
default:
|
||||
furi_assert(0);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void InfraredAppSceneLearn::on_exit(InfraredApp* app) {
|
||||
infrared_worker_rx_stop(app->get_infrared_worker());
|
||||
auto view_manager = app->get_view_manager();
|
||||
auto popup = view_manager->get_popup();
|
||||
popup_set_text(popup, NULL, 0, 0, AlignCenter, AlignCenter);
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
void IrdaAppSceneLearnDone::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneLearnDone::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
|
||||
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
|
||||
|
@ -14,28 +14,28 @@ void IrdaAppSceneLearnDone::on_enter(IrdaApp* app) {
|
|||
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
|
||||
}
|
||||
|
||||
popup_set_callback(popup, IrdaApp::popup_callback);
|
||||
popup_set_callback(popup, InfraredApp::popup_callback);
|
||||
popup_set_context(popup, app);
|
||||
popup_set_timeout(popup, 1500);
|
||||
popup_enable_timeout(popup);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Popup);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Popup);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneLearnDone::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneLearnDone::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::PopupTimer) {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Remote);
|
||||
if(event->type == InfraredAppEvent::Type::PopupTimer) {
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Remote);
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneLearnDone::on_exit(IrdaApp* app) {
|
||||
void InfraredAppSceneLearnDone::on_exit(InfraredApp* app) {
|
||||
app->set_learn_new_remote(false);
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
popup_set_header(popup, nullptr, 0, 0, AlignLeft, AlignTop);
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "gui/modules/text_input.h"
|
||||
|
||||
void IrdaAppSceneLearnEnterName::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneLearnEnterName::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
TextInput* text_input = view_manager->get_text_input();
|
||||
|
||||
auto signal = app->get_received_signal();
|
||||
|
@ -12,8 +12,8 @@ void IrdaAppSceneLearnEnterName::on_enter(IrdaApp* app) {
|
|||
app->set_text_store(
|
||||
0,
|
||||
"%.4s_%0*lX",
|
||||
irda_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(irda_get_protocol_command_length(message->protocol), 4),
|
||||
infrared_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(infrared_get_protocol_command_length(message->protocol), 4),
|
||||
message->command);
|
||||
} else {
|
||||
auto raw_signal = signal.get_raw_signal();
|
||||
|
@ -23,19 +23,19 @@ void IrdaAppSceneLearnEnterName::on_enter(IrdaApp* app) {
|
|||
text_input_set_header_text(text_input, "Name the key");
|
||||
text_input_set_result_callback(
|
||||
text_input,
|
||||
IrdaApp::text_input_callback,
|
||||
InfraredApp::text_input_callback,
|
||||
app,
|
||||
app->get_text_store(0),
|
||||
IrdaAppRemoteManager::max_button_name_length,
|
||||
InfraredAppRemoteManager::max_button_name_length,
|
||||
true);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::TextInput);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::TextInput);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneLearnEnterName::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneLearnEnterName::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::TextEditDone) {
|
||||
if(event->type == InfraredAppEvent::Type::TextEditDone) {
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
bool result = false;
|
||||
if(app->get_learn_new_remote()) {
|
||||
|
@ -48,13 +48,13 @@ bool IrdaAppSceneLearnEnterName::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
|
||||
if(!result) {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{IrdaApp::Scene::Start, IrdaApp::Scene::RemoteList});
|
||||
{InfraredApp::Scene::Start, InfraredApp::Scene::RemoteList});
|
||||
} else {
|
||||
app->switch_to_next_scene_without_saving(IrdaApp::Scene::LearnDone);
|
||||
app->switch_to_next_scene_without_saving(InfraredApp::Scene::LearnDone);
|
||||
}
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneLearnEnterName::on_exit(IrdaApp* app) {
|
||||
void InfraredAppSceneLearnEnterName::on_exit(InfraredApp* app) {
|
||||
}
|
|
@ -3,42 +3,44 @@
|
|||
#include <memory>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#include "../irda_app.h"
|
||||
#include "irda.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "infrared.h"
|
||||
|
||||
static void dialog_result_callback(DialogExResult result, void* context) {
|
||||
auto app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
auto app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::DialogExSelected;
|
||||
event.type = InfraredAppEvent::Type::DialogExSelected;
|
||||
event.payload.dialog_ex_result = result;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneLearnSuccess::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneLearnSuccess::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
DialogEx* dialog_ex = view_manager->get_dialog_ex();
|
||||
|
||||
DOLPHIN_DEED(DolphinDeedIrLearnSuccess);
|
||||
app->notify_green_on();
|
||||
|
||||
irda_worker_tx_set_get_signal_callback(
|
||||
app->get_irda_worker(), irda_worker_tx_get_signal_steady_callback, app);
|
||||
irda_worker_tx_set_signal_sent_callback(
|
||||
app->get_irda_worker(), IrdaApp::signal_sent_callback, app);
|
||||
infrared_worker_tx_set_get_signal_callback(
|
||||
app->get_infrared_worker(), infrared_worker_tx_get_signal_steady_callback, app);
|
||||
infrared_worker_tx_set_signal_sent_callback(
|
||||
app->get_infrared_worker(), InfraredApp::signal_sent_callback, app);
|
||||
|
||||
auto signal = app->get_received_signal();
|
||||
|
||||
if(!signal.is_raw()) {
|
||||
auto message = &signal.get_message();
|
||||
uint8_t adr_digits = ROUND_UP_TO(irda_get_protocol_address_length(message->protocol), 4);
|
||||
uint8_t cmd_digits = ROUND_UP_TO(irda_get_protocol_command_length(message->protocol), 4);
|
||||
uint8_t adr_digits =
|
||||
ROUND_UP_TO(infrared_get_protocol_address_length(message->protocol), 4);
|
||||
uint8_t cmd_digits =
|
||||
ROUND_UP_TO(infrared_get_protocol_command_length(message->protocol), 4);
|
||||
uint8_t max_digits = MAX(adr_digits, cmd_digits);
|
||||
max_digits = MIN(max_digits, 7);
|
||||
size_t label_x_offset = 63 + (7 - max_digits) * 3;
|
||||
|
||||
app->set_text_store(0, "%s", irda_get_protocol_name(message->protocol));
|
||||
app->set_text_store(0, "%s", infrared_get_protocol_name(message->protocol));
|
||||
app->set_text_store(
|
||||
1,
|
||||
"A: 0x%0*lX\nC: 0x%0*lX\n",
|
||||
|
@ -64,24 +66,24 @@ void IrdaAppSceneLearnSuccess::on_enter(IrdaApp* app) {
|
|||
dialog_ex_set_context(dialog_ex, app);
|
||||
dialog_ex_enable_extended_events(dialog_ex);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::DialogEx);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::DialogEx);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneLearnSuccess::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneLearnSuccess::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
if(event->type == IrdaAppEvent::Type::Tick) {
|
||||
if(event->type == InfraredAppEvent::Type::Tick) {
|
||||
/* Send event every tick to suppress any switching off green light */
|
||||
if(!button_pressed) {
|
||||
app->notify_green_on();
|
||||
}
|
||||
}
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::DialogExSelected) {
|
||||
if(event->type == InfraredAppEvent::Type::DialogExSelected) {
|
||||
switch(event->payload.dialog_ex_result) {
|
||||
case DialogExResultLeft:
|
||||
consumed = true;
|
||||
if(!button_pressed) {
|
||||
app->switch_to_next_scene_without_saving(IrdaApp::Scene::Learn);
|
||||
app->switch_to_next_scene_without_saving(InfraredApp::Scene::Learn);
|
||||
}
|
||||
break;
|
||||
case DialogExResultRight: {
|
||||
|
@ -89,7 +91,7 @@ bool IrdaAppSceneLearnSuccess::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
FileWorkerCpp file_worker;
|
||||
if(!button_pressed) {
|
||||
if(file_worker.check_errors()) {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::LearnEnterName);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::LearnEnterName);
|
||||
} else {
|
||||
app->switch_to_previous_scene();
|
||||
}
|
||||
|
@ -103,21 +105,22 @@ bool IrdaAppSceneLearnSuccess::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
|
||||
auto signal = app->get_received_signal();
|
||||
if(signal.is_raw()) {
|
||||
irda_worker_set_raw_signal(
|
||||
app->get_irda_worker(),
|
||||
infrared_worker_set_raw_signal(
|
||||
app->get_infrared_worker(),
|
||||
signal.get_raw_signal().timings,
|
||||
signal.get_raw_signal().timings_cnt);
|
||||
} else {
|
||||
irda_worker_set_decoded_signal(app->get_irda_worker(), &signal.get_message());
|
||||
infrared_worker_set_decoded_signal(
|
||||
app->get_infrared_worker(), &signal.get_message());
|
||||
}
|
||||
|
||||
irda_worker_tx_start(app->get_irda_worker());
|
||||
infrared_worker_tx_start(app->get_infrared_worker());
|
||||
}
|
||||
break;
|
||||
case DialogExReleaseCenter:
|
||||
if(button_pressed) {
|
||||
button_pressed = false;
|
||||
irda_worker_tx_stop(app->get_irda_worker());
|
||||
infrared_worker_tx_stop(app->get_infrared_worker());
|
||||
app->notify_green_off();
|
||||
}
|
||||
break;
|
||||
|
@ -126,9 +129,9 @@ bool IrdaAppSceneLearnSuccess::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
}
|
||||
}
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::Back) {
|
||||
if(event->type == InfraredAppEvent::Type::Back) {
|
||||
if(!button_pressed) {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::AskBack);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::AskBack);
|
||||
}
|
||||
consumed = true;
|
||||
}
|
||||
|
@ -136,11 +139,11 @@ bool IrdaAppSceneLearnSuccess::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneLearnSuccess::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneLearnSuccess::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
DialogEx* dialog_ex = view_manager->get_dialog_ex();
|
||||
dialog_ex_reset(dialog_ex);
|
||||
app->notify_green_off();
|
||||
irda_worker_tx_set_get_signal_callback(app->get_irda_worker(), nullptr, nullptr);
|
||||
irda_worker_tx_set_signal_sent_callback(app->get_irda_worker(), nullptr, nullptr);
|
||||
infrared_worker_tx_set_get_signal_callback(app->get_infrared_worker(), nullptr, nullptr);
|
||||
infrared_worker_tx_set_signal_sent_callback(app->get_infrared_worker(), nullptr, nullptr);
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
#include <gui/modules/button_menu.h>
|
||||
#include <input/input.h>
|
||||
#include <irda_worker.h>
|
||||
#include <infrared_worker.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
#include "../irda_app.h"
|
||||
#include "../irda_app_view_manager.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "../infrared_app_view_manager.h"
|
||||
|
||||
typedef enum {
|
||||
ButtonIndexPlus = -2,
|
||||
|
@ -12,15 +12,15 @@ typedef enum {
|
|||
} ButtonIndex;
|
||||
|
||||
static void button_menu_callback(void* context, int32_t index, InputType type) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
if(type == InputTypePress) {
|
||||
event.type = IrdaAppEvent::Type::MenuSelectedPress;
|
||||
event.type = InfraredAppEvent::Type::MenuSelectedPress;
|
||||
} else if(type == InputTypeRelease) {
|
||||
event.type = IrdaAppEvent::Type::MenuSelectedRelease;
|
||||
event.type = InfraredAppEvent::Type::MenuSelectedRelease;
|
||||
} else if(type == InputTypeShort) {
|
||||
event.type = IrdaAppEvent::Type::MenuSelected;
|
||||
event.type = InfraredAppEvent::Type::MenuSelected;
|
||||
} else {
|
||||
furi_assert(0);
|
||||
}
|
||||
|
@ -30,17 +30,17 @@ static void button_menu_callback(void* context, int32_t index, InputType type) {
|
|||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneRemote::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneRemote::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
ButtonMenu* button_menu = view_manager->get_button_menu();
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
int i = 0;
|
||||
button_pressed = false;
|
||||
|
||||
irda_worker_tx_set_get_signal_callback(
|
||||
app->get_irda_worker(), irda_worker_tx_get_signal_steady_callback, app);
|
||||
irda_worker_tx_set_signal_sent_callback(
|
||||
app->get_irda_worker(), IrdaApp::signal_sent_callback, app);
|
||||
infrared_worker_tx_set_get_signal_callback(
|
||||
app->get_infrared_worker(), infrared_worker_tx_get_signal_steady_callback, app);
|
||||
infrared_worker_tx_set_signal_sent_callback(
|
||||
app->get_infrared_worker(), InfraredApp::signal_sent_callback, app);
|
||||
buttons_names = remote_manager->get_button_list();
|
||||
|
||||
i = 0;
|
||||
|
@ -60,32 +60,32 @@ void IrdaAppSceneRemote::on_enter(IrdaApp* app) {
|
|||
button_menu_set_selected_item(button_menu, buttonmenu_item_selected);
|
||||
buttonmenu_item_selected = ButtonIndexNA;
|
||||
}
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::ButtonMenu);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::ButtonMenu);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneRemote::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneRemote::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = true;
|
||||
|
||||
if((event->type == IrdaAppEvent::Type::MenuSelected) ||
|
||||
(event->type == IrdaAppEvent::Type::MenuSelectedPress) ||
|
||||
(event->type == IrdaAppEvent::Type::MenuSelectedRelease)) {
|
||||
if((event->type == InfraredAppEvent::Type::MenuSelected) ||
|
||||
(event->type == InfraredAppEvent::Type::MenuSelectedPress) ||
|
||||
(event->type == InfraredAppEvent::Type::MenuSelectedRelease)) {
|
||||
switch(event->payload.menu_index) {
|
||||
case ButtonIndexPlus:
|
||||
furi_assert(event->type == IrdaAppEvent::Type::MenuSelected);
|
||||
furi_assert(event->type == InfraredAppEvent::Type::MenuSelected);
|
||||
app->notify_click();
|
||||
buttonmenu_item_selected = event->payload.menu_index;
|
||||
app->set_learn_new_remote(false);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Learn);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Learn);
|
||||
break;
|
||||
case ButtonIndexEdit:
|
||||
furi_assert(event->type == IrdaAppEvent::Type::MenuSelected);
|
||||
furi_assert(event->type == InfraredAppEvent::Type::MenuSelected);
|
||||
app->notify_click();
|
||||
buttonmenu_item_selected = event->payload.menu_index;
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Edit);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Edit);
|
||||
break;
|
||||
default:
|
||||
furi_assert(event->type != IrdaAppEvent::Type::MenuSelected);
|
||||
bool pressed = (event->type == IrdaAppEvent::Type::MenuSelectedPress);
|
||||
furi_assert(event->type != InfraredAppEvent::Type::MenuSelected);
|
||||
bool pressed = (event->type == InfraredAppEvent::Type::MenuSelectedPress);
|
||||
|
||||
if(pressed && !button_pressed) {
|
||||
button_pressed = true;
|
||||
|
@ -94,28 +94,28 @@ bool IrdaAppSceneRemote::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
auto button_signal =
|
||||
app->get_remote_manager()->get_button_data(event->payload.menu_index);
|
||||
if(button_signal.is_raw()) {
|
||||
irda_worker_set_raw_signal(
|
||||
app->get_irda_worker(),
|
||||
infrared_worker_set_raw_signal(
|
||||
app->get_infrared_worker(),
|
||||
button_signal.get_raw_signal().timings,
|
||||
button_signal.get_raw_signal().timings_cnt);
|
||||
} else {
|
||||
irda_worker_set_decoded_signal(
|
||||
app->get_irda_worker(), &button_signal.get_message());
|
||||
infrared_worker_set_decoded_signal(
|
||||
app->get_infrared_worker(), &button_signal.get_message());
|
||||
}
|
||||
|
||||
DOLPHIN_DEED(DolphinDeedIrSend);
|
||||
irda_worker_tx_start(app->get_irda_worker());
|
||||
infrared_worker_tx_start(app->get_infrared_worker());
|
||||
} else if(!pressed && button_pressed) {
|
||||
button_pressed = false;
|
||||
irda_worker_tx_stop(app->get_irda_worker());
|
||||
infrared_worker_tx_stop(app->get_infrared_worker());
|
||||
app->notify_green_off();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if(event->type == IrdaAppEvent::Type::Back) {
|
||||
} else if(event->type == InfraredAppEvent::Type::Back) {
|
||||
if(!button_pressed) {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{IrdaApp::Scene::Start, IrdaApp::Scene::RemoteList});
|
||||
{InfraredApp::Scene::Start, InfraredApp::Scene::RemoteList});
|
||||
}
|
||||
} else {
|
||||
consumed = false;
|
||||
|
@ -124,10 +124,10 @@ bool IrdaAppSceneRemote::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneRemote::on_exit(IrdaApp* app) {
|
||||
irda_worker_tx_set_get_signal_callback(app->get_irda_worker(), nullptr, nullptr);
|
||||
irda_worker_tx_set_signal_sent_callback(app->get_irda_worker(), nullptr, nullptr);
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneRemote::on_exit(InfraredApp* app) {
|
||||
infrared_worker_tx_set_get_signal_callback(app->get_infrared_worker(), nullptr, nullptr);
|
||||
infrared_worker_tx_set_signal_sent_callback(app->get_infrared_worker(), nullptr, nullptr);
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
ButtonMenu* button_menu = view_manager->get_button_menu();
|
||||
|
||||
button_menu_reset(button_menu);
|
|
@ -1,9 +1,9 @@
|
|||
#include "../irda_app.h"
|
||||
#include "irda/irda_app_event.h"
|
||||
#include "../infrared_app.h"
|
||||
#include "infrared/infrared_app_event.h"
|
||||
#include <text_store.h>
|
||||
#include <file_worker_cpp.h>
|
||||
|
||||
void IrdaAppSceneRemoteList::on_enter(IrdaApp* app) {
|
||||
void InfraredAppSceneRemoteList::on_enter(InfraredApp* app) {
|
||||
furi_assert(app);
|
||||
|
||||
FileWorkerCpp file_worker;
|
||||
|
@ -13,23 +13,24 @@ void IrdaAppSceneRemoteList::on_enter(IrdaApp* app) {
|
|||
auto last_selected_remote = remote_manager->get_remote_name();
|
||||
const char* last_selected_remote_name =
|
||||
last_selected_remote.size() ? last_selected_remote.c_str() : nullptr;
|
||||
auto filename_ts = std::make_unique<TextStore>(IrdaAppRemoteManager::max_remote_name_length);
|
||||
auto filename_ts =
|
||||
std::make_unique<TextStore>(InfraredAppRemoteManager::max_remote_name_length);
|
||||
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
ButtonMenu* button_menu = view_manager->get_button_menu();
|
||||
button_menu_reset(button_menu);
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::ButtonMenu);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::ButtonMenu);
|
||||
|
||||
file_select_result = file_worker.file_select(
|
||||
IrdaApp::irda_directory,
|
||||
IrdaApp::irda_extension,
|
||||
InfraredApp::infrared_directory,
|
||||
InfraredApp::infrared_extension,
|
||||
filename_ts->text,
|
||||
filename_ts->text_size,
|
||||
last_selected_remote_name);
|
||||
|
||||
if(file_select_result) {
|
||||
if(remote_manager->load(std::string(filename_ts->text))) {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Remote);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Remote);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
@ -39,11 +40,11 @@ void IrdaAppSceneRemoteList::on_enter(IrdaApp* app) {
|
|||
}
|
||||
}
|
||||
|
||||
bool IrdaAppSceneRemoteList::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneRemoteList::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneRemoteList::on_exit(IrdaApp* app) {
|
||||
void InfraredAppSceneRemoteList::on_exit(InfraredApp* app) {
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
|
||||
typedef enum {
|
||||
SubmenuIndexUniversalLibrary,
|
||||
|
@ -7,17 +7,17 @@ typedef enum {
|
|||
} SubmenuIndex;
|
||||
|
||||
static void submenu_callback(void* context, uint32_t index) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::MenuSelected;
|
||||
event.type = InfraredAppEvent::Type::MenuSelected;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneStart::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneStart::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_add_item(
|
||||
|
@ -28,24 +28,24 @@ void IrdaAppSceneStart::on_enter(IrdaApp* app) {
|
|||
submenu_set_selected_item(submenu, submenu_item_selected);
|
||||
submenu_item_selected = 0;
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Submenu);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Submenu);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneStart::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneStart::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::MenuSelected) {
|
||||
if(event->type == InfraredAppEvent::Type::MenuSelected) {
|
||||
submenu_item_selected = event->payload.menu_index;
|
||||
switch(event->payload.menu_index) {
|
||||
case SubmenuIndexUniversalLibrary:
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Universal);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Universal);
|
||||
break;
|
||||
case SubmenuIndexLearnNewRemote:
|
||||
app->set_learn_new_remote(true);
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Learn);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::Learn);
|
||||
break;
|
||||
case SubmenuIndexSavedRemotes:
|
||||
app->switch_to_next_scene(IrdaApp::Scene::RemoteList);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::RemoteList);
|
||||
break;
|
||||
default:
|
||||
furi_assert(0);
|
||||
|
@ -57,8 +57,8 @@ bool IrdaAppSceneStart::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneStart::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneStart::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
app->get_remote_manager()->reset_remote();
|
|
@ -1,4 +1,4 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../infrared_app.h"
|
||||
|
||||
typedef enum {
|
||||
SubmenuIndexUniversalTV,
|
||||
|
@ -7,40 +7,40 @@ typedef enum {
|
|||
} SubmenuIndex;
|
||||
|
||||
static void submenu_callback(void* context, uint32_t index) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::MenuSelected;
|
||||
event.type = InfraredAppEvent::Type::MenuSelected;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneUniversal::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneUniversal::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_add_item(submenu, "TV's", SubmenuIndexUniversalTV, submenu_callback, app);
|
||||
submenu_set_selected_item(submenu, submenu_item_selected);
|
||||
submenu_item_selected = 0;
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Submenu);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::Submenu);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneUniversal::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool InfraredAppSceneUniversal::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::MenuSelected) {
|
||||
if(event->type == InfraredAppEvent::Type::MenuSelected) {
|
||||
submenu_item_selected = event->payload.menu_index;
|
||||
switch(event->payload.menu_index) {
|
||||
case SubmenuIndexUniversalTV:
|
||||
app->switch_to_next_scene(IrdaApp::Scene::UniversalTV);
|
||||
app->switch_to_next_scene(InfraredApp::Scene::UniversalTV);
|
||||
break;
|
||||
case SubmenuIndexUniversalAudio:
|
||||
// app->switch_to_next_scene(IrdaApp::Scene::UniversalAudio);
|
||||
// app->switch_to_next_scene(InfraredApp::Scene::UniversalAudio);
|
||||
break;
|
||||
case SubmenuIndexUniversalAirConditioner:
|
||||
// app->switch_to_next_scene(IrdaApp::Scene::UniversalAirConditioner);
|
||||
// app->switch_to_next_scene(InfraredApp::Scene::UniversalAirConditioner);
|
||||
break;
|
||||
}
|
||||
consumed = true;
|
||||
|
@ -49,8 +49,8 @@ bool IrdaAppSceneUniversal::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneUniversal::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneUniversal::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_reset(submenu);
|
|
@ -0,0 +1,101 @@
|
|||
#include <dolphin/dolphin.h>
|
||||
#include <gui/modules/button_menu.h>
|
||||
#include <gui/modules/button_panel.h>
|
||||
#include <gui/view.h>
|
||||
#include <gui/view_stack.h>
|
||||
|
||||
#include "../infrared_app.h"
|
||||
#include "infrared/infrared_app_event.h"
|
||||
#include "infrared/infrared_app_view_manager.h"
|
||||
#include "infrared/scene/infrared_app_scene.h"
|
||||
#include "../view/infrared_progress_view.h"
|
||||
|
||||
void InfraredAppSceneUniversalCommon::infrared_app_item_callback(void* context, uint32_t index) {
|
||||
InfraredApp* app = static_cast<InfraredApp*>(context);
|
||||
InfraredAppEvent event;
|
||||
|
||||
event.type = InfraredAppEvent::Type::ButtonPanelPressed;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
static void infrared_progress_back_callback(void* context) {
|
||||
furi_assert(context);
|
||||
auto app = static_cast<InfraredApp*>(context);
|
||||
|
||||
InfraredAppEvent infrared_event = {
|
||||
.type = InfraredAppEvent::Type::Back,
|
||||
};
|
||||
app->get_view_manager()->clear_events();
|
||||
app->get_view_manager()->send_event(&infrared_event);
|
||||
}
|
||||
|
||||
void InfraredAppSceneUniversalCommon::hide_popup(InfraredApp* app) {
|
||||
auto stack_view = app->get_view_manager()->get_universal_view_stack();
|
||||
auto progress_view = app->get_view_manager()->get_progress();
|
||||
view_stack_remove_view(stack_view, infrared_progress_view_get_view(progress_view));
|
||||
}
|
||||
|
||||
void InfraredAppSceneUniversalCommon::show_popup(InfraredApp* app, int record_amount) {
|
||||
auto stack_view = app->get_view_manager()->get_universal_view_stack();
|
||||
auto progress_view = app->get_view_manager()->get_progress();
|
||||
infrared_progress_view_set_progress_total(progress_view, record_amount);
|
||||
infrared_progress_view_set_back_callback(progress_view, infrared_progress_back_callback, app);
|
||||
view_stack_add_view(stack_view, infrared_progress_view_get_view(progress_view));
|
||||
}
|
||||
|
||||
bool InfraredAppSceneUniversalCommon::progress_popup(InfraredApp* app) {
|
||||
auto progress_view = app->get_view_manager()->get_progress();
|
||||
return infrared_progress_view_increase_progress(progress_view);
|
||||
}
|
||||
|
||||
bool InfraredAppSceneUniversalCommon::on_event(InfraredApp* app, InfraredAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(brute_force_started) {
|
||||
if(event->type == InfraredAppEvent::Type::Tick) {
|
||||
auto view_manager = app->get_view_manager();
|
||||
InfraredAppEvent tick_event = {.type = InfraredAppEvent::Type::Tick};
|
||||
view_manager->send_event(&tick_event);
|
||||
bool result = brute_force.send_next_bruteforce();
|
||||
if(result) {
|
||||
result = progress_popup(app);
|
||||
}
|
||||
if(!result) {
|
||||
brute_force.stop_bruteforce();
|
||||
brute_force_started = false;
|
||||
hide_popup(app);
|
||||
}
|
||||
consumed = true;
|
||||
} else if(event->type == InfraredAppEvent::Type::Back) {
|
||||
brute_force_started = false;
|
||||
brute_force.stop_bruteforce();
|
||||
hide_popup(app);
|
||||
consumed = true;
|
||||
}
|
||||
} else {
|
||||
if(event->type == InfraredAppEvent::Type::ButtonPanelPressed) {
|
||||
int record_amount = 0;
|
||||
if(brute_force.start_bruteforce(event->payload.menu_index, record_amount)) {
|
||||
DOLPHIN_DEED(DolphinDeedIrBruteForce);
|
||||
brute_force_started = true;
|
||||
show_popup(app, record_amount);
|
||||
} else {
|
||||
app->switch_to_previous_scene();
|
||||
}
|
||||
consumed = true;
|
||||
} else if(event->type == InfraredAppEvent::Type::Back) {
|
||||
app->switch_to_previous_scene();
|
||||
consumed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void InfraredAppSceneUniversalCommon::on_exit(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
ButtonPanel* button_panel = view_manager->get_button_panel();
|
||||
button_panel_reset(button_panel);
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
#include <stdint.h>
|
||||
#include <gui/modules/loading.h>
|
||||
#include <gui/view_stack.h>
|
||||
#include "irda/scene/irda_app_scene.h"
|
||||
#include "irda/irda_app.h"
|
||||
#include "infrared/scene/infrared_app_scene.h"
|
||||
#include "infrared/infrared_app.h"
|
||||
|
||||
void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
void InfraredAppSceneUniversalTV::on_enter(InfraredApp* app) {
|
||||
InfraredAppViewManager* view_manager = app->get_view_manager();
|
||||
ButtonPanel* button_panel = view_manager->get_button_panel();
|
||||
button_panel_reserve(button_panel, 2, 3);
|
||||
|
||||
|
@ -19,7 +19,7 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
|||
19,
|
||||
&I_Power_25x27,
|
||||
&I_Power_hvr_25x27,
|
||||
irda_app_item_callback,
|
||||
infrared_app_item_callback,
|
||||
app);
|
||||
brute_force.add_record(i, "POWER");
|
||||
++i;
|
||||
|
@ -32,7 +32,7 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
|||
19,
|
||||
&I_Mute_25x27,
|
||||
&I_Mute_hvr_25x27,
|
||||
irda_app_item_callback,
|
||||
infrared_app_item_callback,
|
||||
app);
|
||||
brute_force.add_record(i, "MUTE");
|
||||
++i;
|
||||
|
@ -45,12 +45,21 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
|||
66,
|
||||
&I_Vol_up_25x27,
|
||||
&I_Vol_up_hvr_25x27,
|
||||
irda_app_item_callback,
|
||||
infrared_app_item_callback,
|
||||
app);
|
||||
brute_force.add_record(i, "VOL+");
|
||||
++i;
|
||||
button_panel_add_item(
|
||||
button_panel, i, 1, 1, 36, 66, &I_Up_25x27, &I_Up_hvr_25x27, irda_app_item_callback, app);
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
1,
|
||||
36,
|
||||
66,
|
||||
&I_Up_25x27,
|
||||
&I_Up_hvr_25x27,
|
||||
infrared_app_item_callback,
|
||||
app);
|
||||
brute_force.add_record(i, "CH+");
|
||||
++i;
|
||||
button_panel_add_item(
|
||||
|
@ -62,7 +71,7 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
|||
98,
|
||||
&I_Vol_down_25x27,
|
||||
&I_Vol_down_hvr_25x27,
|
||||
irda_app_item_callback,
|
||||
infrared_app_item_callback,
|
||||
app);
|
||||
brute_force.add_record(i, "VOL-");
|
||||
++i;
|
||||
|
@ -75,7 +84,7 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
|||
98,
|
||||
&I_Down_25x27,
|
||||
&I_Down_hvr_25x27,
|
||||
irda_app_item_callback,
|
||||
infrared_app_item_callback,
|
||||
app);
|
||||
brute_force.add_record(i, "CH-");
|
||||
|
||||
|
@ -83,7 +92,7 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
|
|||
button_panel_add_label(button_panel, 9, 64, FontSecondary, "Vol");
|
||||
button_panel_add_label(button_panel, 43, 64, FontSecondary, "Ch");
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::UniversalRemote);
|
||||
view_manager->switch_to(InfraredAppViewManager::ViewId::UniversalRemote);
|
||||
|
||||
auto stack_view = app->get_view_manager()->get_universal_view_stack();
|
||||
auto loading_view = app->get_view_manager()->get_loading();
|
|
@ -7,26 +7,26 @@
|
|||
#include "m-string.h"
|
||||
#include <gui/elements.h>
|
||||
#include <furi.h>
|
||||
#include "irda_progress_view.h"
|
||||
#include "infrared_progress_view.h"
|
||||
#include "gui/modules/button_panel.h"
|
||||
#include <stdint.h>
|
||||
|
||||
struct IrdaProgressView {
|
||||
struct InfraredProgressView {
|
||||
View* view;
|
||||
IrdaProgressViewBackCallback back_callback;
|
||||
InfraredProgressViewBackCallback back_callback;
|
||||
void* context;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
size_t progress;
|
||||
size_t progress_total;
|
||||
} IrdaProgressViewModel;
|
||||
} InfraredProgressViewModel;
|
||||
|
||||
bool irda_progress_view_increase_progress(IrdaProgressView* progress) {
|
||||
bool infrared_progress_view_increase_progress(InfraredProgressView* progress) {
|
||||
furi_assert(progress);
|
||||
bool result = false;
|
||||
|
||||
IrdaProgressViewModel* model = view_get_model(progress->view);
|
||||
InfraredProgressViewModel* model = view_get_model(progress->view);
|
||||
if(model->progress < model->progress_total) {
|
||||
++model->progress;
|
||||
result = model->progress < model->progress_total;
|
||||
|
@ -36,8 +36,8 @@ bool irda_progress_view_increase_progress(IrdaProgressView* progress) {
|
|||
return result;
|
||||
}
|
||||
|
||||
static void irda_progress_view_draw_callback(Canvas* canvas, void* _model) {
|
||||
IrdaProgressViewModel* model = (IrdaProgressViewModel*)_model;
|
||||
static void infrared_progress_view_draw_callback(Canvas* canvas, void* _model) {
|
||||
InfraredProgressViewModel* model = (InfraredProgressViewModel*)_model;
|
||||
|
||||
uint8_t x = 0;
|
||||
uint8_t y = 36;
|
||||
|
@ -63,16 +63,18 @@ static void irda_progress_view_draw_callback(Canvas* canvas, void* _model) {
|
|||
canvas_draw_str(canvas, x + 30, y + height - 6, "= stop");
|
||||
}
|
||||
|
||||
void irda_progress_view_set_progress_total(IrdaProgressView* progress, uint16_t progress_total) {
|
||||
void infrared_progress_view_set_progress_total(
|
||||
InfraredProgressView* progress,
|
||||
uint16_t progress_total) {
|
||||
furi_assert(progress);
|
||||
IrdaProgressViewModel* model = view_get_model(progress->view);
|
||||
InfraredProgressViewModel* model = view_get_model(progress->view);
|
||||
model->progress = 0;
|
||||
model->progress_total = progress_total;
|
||||
view_commit_model(progress->view, false);
|
||||
}
|
||||
|
||||
bool irda_progress_view_input_callback(InputEvent* event, void* context) {
|
||||
IrdaProgressView* instance = context;
|
||||
bool infrared_progress_view_input_callback(InputEvent* event, void* context) {
|
||||
InfraredProgressView* instance = context;
|
||||
|
||||
if((event->type == InputTypeShort) && (event->key == InputKeyBack)) {
|
||||
if(instance->back_callback) {
|
||||
|
@ -83,36 +85,36 @@ bool irda_progress_view_input_callback(InputEvent* event, void* context) {
|
|||
return true;
|
||||
}
|
||||
|
||||
IrdaProgressView* irda_progress_view_alloc(void) {
|
||||
IrdaProgressView* instance = malloc(sizeof(IrdaProgressView));
|
||||
InfraredProgressView* infrared_progress_view_alloc(void) {
|
||||
InfraredProgressView* instance = malloc(sizeof(InfraredProgressView));
|
||||
instance->view = view_alloc();
|
||||
view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(IrdaProgressViewModel));
|
||||
IrdaProgressViewModel* model = view_get_model(instance->view);
|
||||
view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(InfraredProgressViewModel));
|
||||
InfraredProgressViewModel* model = view_get_model(instance->view);
|
||||
model->progress = 0;
|
||||
model->progress_total = 0;
|
||||
view_commit_model(instance->view, false);
|
||||
view_set_draw_callback(instance->view, irda_progress_view_draw_callback);
|
||||
view_set_input_callback(instance->view, irda_progress_view_input_callback);
|
||||
view_set_draw_callback(instance->view, infrared_progress_view_draw_callback);
|
||||
view_set_input_callback(instance->view, infrared_progress_view_input_callback);
|
||||
view_set_context(instance->view, instance);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
void irda_progress_view_free(IrdaProgressView* progress) {
|
||||
void infrared_progress_view_free(InfraredProgressView* progress) {
|
||||
view_free(progress->view);
|
||||
free(progress);
|
||||
}
|
||||
|
||||
void irda_progress_view_set_back_callback(
|
||||
IrdaProgressView* instance,
|
||||
IrdaProgressViewBackCallback callback,
|
||||
void infrared_progress_view_set_back_callback(
|
||||
InfraredProgressView* instance,
|
||||
InfraredProgressViewBackCallback callback,
|
||||
void* context) {
|
||||
furi_assert(instance);
|
||||
instance->back_callback = callback;
|
||||
instance->context = context;
|
||||
}
|
||||
|
||||
View* irda_progress_view_get_view(IrdaProgressView* instance) {
|
||||
View* infrared_progress_view_get_view(InfraredProgressView* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->view);
|
||||
return instance->view;
|
68
applications/infrared/view/infrared_progress_view.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/**
|
||||
* @file infrared_progress_view.h
|
||||
* Infrared: Custom Infrared view module.
|
||||
* It shows popup progress bar during brute force.
|
||||
*/
|
||||
#pragma once
|
||||
#include <gui/view.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Anonumous instance */
|
||||
typedef struct InfraredProgressView InfraredProgressView;
|
||||
|
||||
/** Callback for back button handling */
|
||||
typedef void (*InfraredProgressViewBackCallback)(void*);
|
||||
|
||||
/** Allocate and initialize Infrared view
|
||||
*
|
||||
* @retval new allocated instance
|
||||
*/
|
||||
InfraredProgressView* infrared_progress_view_alloc();
|
||||
|
||||
/** Free previously allocated Progress view module instance
|
||||
*
|
||||
* @param instance to free
|
||||
*/
|
||||
void infrared_progress_view_free(InfraredProgressView* instance);
|
||||
|
||||
/** Get progress view module view
|
||||
*
|
||||
* @param instance view module
|
||||
* @retval view
|
||||
*/
|
||||
View* infrared_progress_view_get_view(InfraredProgressView* instance);
|
||||
|
||||
/** Increase progress on progress view module
|
||||
*
|
||||
* @param instance view module
|
||||
* @retval true - value is incremented and maximum is reached,
|
||||
* false - value is incremented and maximum is not reached
|
||||
*/
|
||||
bool infrared_progress_view_increase_progress(InfraredProgressView* instance);
|
||||
|
||||
/** Set maximum progress value
|
||||
*
|
||||
* @param instance - view module
|
||||
* @param progress_max - maximum value of progress
|
||||
*/
|
||||
void infrared_progress_view_set_progress_total(
|
||||
InfraredProgressView* instance,
|
||||
uint16_t progress_max);
|
||||
|
||||
/** Set back button callback
|
||||
*
|
||||
* @param instance - view module
|
||||
* @param callback - callback to call for back button
|
||||
* @param context - context to pass to callback
|
||||
*/
|
||||
void infrared_progress_view_set_back_callback(
|
||||
InfraredProgressView* instance,
|
||||
InfraredProgressViewBackCallback callback,
|
||||
void* context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
140
applications/infrared_monitor/infrared_monitor.c
Normal file
|
@ -0,0 +1,140 @@
|
|||
#include <gui/canvas.h>
|
||||
#include <input/input.h>
|
||||
#include <infrared.h>
|
||||
#include <infrared_worker.h>
|
||||
#include <stdio.h>
|
||||
#include <furi.h>
|
||||
#include <furi_hal_infrared.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/view_port.h>
|
||||
#include <gui/gui.h>
|
||||
#include <gui/elements.h>
|
||||
|
||||
#define INFRARED_TIMINGS_SIZE 700
|
||||
|
||||
typedef struct {
|
||||
uint32_t timing_cnt;
|
||||
struct {
|
||||
uint8_t level;
|
||||
uint32_t duration;
|
||||
} timing[INFRARED_TIMINGS_SIZE];
|
||||
} InfraredDelaysArray;
|
||||
|
||||
typedef struct {
|
||||
char display_text[64];
|
||||
osMessageQueueId_t event_queue;
|
||||
InfraredDelaysArray delays;
|
||||
InfraredWorker* worker;
|
||||
ViewPort* view_port;
|
||||
} InfraredMonitor;
|
||||
|
||||
void infrared_monitor_input_callback(InputEvent* input_event, void* ctx) {
|
||||
furi_assert(ctx);
|
||||
InfraredMonitor* infrared_monitor = (InfraredMonitor*)ctx;
|
||||
|
||||
if((input_event->type == InputTypeShort) && (input_event->key == InputKeyBack)) {
|
||||
osMessageQueuePut(infrared_monitor->event_queue, input_event, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void infrared_monitor_draw_callback(Canvas* canvas, void* ctx) {
|
||||
furi_assert(canvas);
|
||||
furi_assert(ctx);
|
||||
InfraredMonitor* infrared_monitor = (InfraredMonitor*)ctx;
|
||||
|
||||
canvas_clear(canvas);
|
||||
canvas_set_font(canvas, FontPrimary);
|
||||
elements_multiline_text_aligned(canvas, 64, 0, AlignCenter, AlignTop, "INFRARED monitor\n");
|
||||
canvas_set_font(canvas, FontKeyboard);
|
||||
if(strlen(infrared_monitor->display_text)) {
|
||||
elements_multiline_text_aligned(
|
||||
canvas, 64, 43, AlignCenter, AlignCenter, infrared_monitor->display_text);
|
||||
}
|
||||
}
|
||||
|
||||
static void signal_received_callback(void* context, InfraredWorkerSignal* received_signal) {
|
||||
furi_assert(context);
|
||||
furi_assert(received_signal);
|
||||
InfraredMonitor* infrared_monitor = context;
|
||||
|
||||
if(infrared_worker_signal_is_decoded(received_signal)) {
|
||||
const InfraredMessage* message = infrared_worker_get_decoded_signal(received_signal);
|
||||
snprintf(
|
||||
infrared_monitor->display_text,
|
||||
sizeof(infrared_monitor->display_text),
|
||||
"%s\nA:0x%0*lX\nC:0x%0*lX\n%s\n",
|
||||
infrared_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(infrared_get_protocol_address_length(message->protocol), 4),
|
||||
message->address,
|
||||
ROUND_UP_TO(infrared_get_protocol_command_length(message->protocol), 4),
|
||||
message->command,
|
||||
message->repeat ? " R" : "");
|
||||
view_port_update(infrared_monitor->view_port);
|
||||
printf(
|
||||
"== %s, A:0x%0*lX, C:0x%0*lX%s ==\r\n",
|
||||
infrared_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(infrared_get_protocol_address_length(message->protocol), 4),
|
||||
message->address,
|
||||
ROUND_UP_TO(infrared_get_protocol_command_length(message->protocol), 4),
|
||||
message->command,
|
||||
message->repeat ? " R" : "");
|
||||
} else {
|
||||
const uint32_t* timings;
|
||||
size_t timings_cnt;
|
||||
infrared_worker_get_raw_signal(received_signal, &timings, &timings_cnt);
|
||||
snprintf(
|
||||
infrared_monitor->display_text,
|
||||
sizeof(infrared_monitor->display_text),
|
||||
"RAW\n%d samples\n",
|
||||
timings_cnt);
|
||||
view_port_update(infrared_monitor->view_port);
|
||||
printf("RAW, %d samples:\r\n", timings_cnt);
|
||||
for(size_t i = 0; i < timings_cnt; ++i) {
|
||||
printf("%lu ", timings[i]);
|
||||
}
|
||||
printf("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
int32_t infrared_monitor_app(void* p) {
|
||||
(void)p;
|
||||
|
||||
InfraredMonitor* infrared_monitor = malloc(sizeof(InfraredMonitor));
|
||||
infrared_monitor->display_text[0] = 0;
|
||||
infrared_monitor->event_queue = osMessageQueueNew(1, sizeof(InputEvent), NULL);
|
||||
infrared_monitor->view_port = view_port_alloc();
|
||||
Gui* gui = furi_record_open("gui");
|
||||
|
||||
view_port_draw_callback_set(
|
||||
infrared_monitor->view_port, infrared_monitor_draw_callback, infrared_monitor);
|
||||
view_port_input_callback_set(
|
||||
infrared_monitor->view_port, infrared_monitor_input_callback, infrared_monitor);
|
||||
|
||||
gui_add_view_port(gui, infrared_monitor->view_port, GuiLayerFullscreen);
|
||||
|
||||
infrared_monitor->worker = infrared_worker_alloc();
|
||||
infrared_worker_rx_start(infrared_monitor->worker);
|
||||
infrared_worker_rx_set_received_signal_callback(
|
||||
infrared_monitor->worker, signal_received_callback, infrared_monitor);
|
||||
infrared_worker_rx_enable_blink_on_receiving(infrared_monitor->worker, true);
|
||||
|
||||
while(1) {
|
||||
InputEvent event;
|
||||
if(osOK == osMessageQueueGet(infrared_monitor->event_queue, &event, NULL, 50)) {
|
||||
if((event.type == InputTypeShort) && (event.key == InputKeyBack)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
infrared_worker_rx_stop(infrared_monitor->worker);
|
||||
infrared_worker_free(infrared_monitor->worker);
|
||||
osMessageQueueDelete(infrared_monitor->event_queue);
|
||||
view_port_enabled_set(infrared_monitor->view_port, false);
|
||||
gui_remove_view_port(gui, infrared_monitor->view_port);
|
||||
view_port_free(infrared_monitor->view_port);
|
||||
furi_record_close("gui");
|
||||
free(infrared_monitor);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "../irda_app_signal.h"
|
||||
#include <flipper_format/flipper_format.h>
|
||||
#include <string>
|
||||
|
||||
bool irda_parser_save_signal(
|
||||
FlipperFormat* ff,
|
||||
const IrdaAppSignal& signal,
|
||||
const std::string& name);
|
||||
bool irda_parser_read_signal(FlipperFormat* ff, IrdaAppSignal& signal, std::string& name);
|
||||
bool irda_parser_is_parsed_signal_valid(const IrdaMessage* signal);
|
||||
bool irda_parser_is_raw_signal_valid(uint32_t frequency, float duty_cycle, uint32_t timings_cnt);
|
|
@ -1,138 +0,0 @@
|
|||
#pragma once
|
||||
#include <map>
|
||||
#include <irda.h>
|
||||
#include <furi.h>
|
||||
#include "scene/irda_app_scene.h"
|
||||
#include "scene/irda_app_scene.h"
|
||||
#include "irda_app_view_manager.h"
|
||||
#include "irda_app_remote_manager.h"
|
||||
#include <forward_list>
|
||||
#include <stdint.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <irda_worker.h>
|
||||
#include "irda_app_view_manager.h"
|
||||
|
||||
class IrdaApp {
|
||||
public:
|
||||
enum class EditElement : uint8_t {
|
||||
Button,
|
||||
Remote,
|
||||
};
|
||||
enum class EditAction : uint8_t {
|
||||
Rename,
|
||||
Delete,
|
||||
};
|
||||
enum class Scene : uint8_t {
|
||||
Exit,
|
||||
Start,
|
||||
Universal,
|
||||
UniversalTV,
|
||||
UniversalAudio,
|
||||
UniversalAirConditioner,
|
||||
Learn,
|
||||
LearnSuccess,
|
||||
LearnEnterName,
|
||||
LearnDone,
|
||||
AskBack,
|
||||
Remote,
|
||||
RemoteList,
|
||||
Edit,
|
||||
EditKeySelect,
|
||||
EditRename,
|
||||
EditDelete,
|
||||
EditRenameDone,
|
||||
EditDeleteDone,
|
||||
};
|
||||
|
||||
int32_t run(void* args);
|
||||
void switch_to_next_scene(Scene index);
|
||||
void switch_to_next_scene_without_saving(Scene index);
|
||||
bool switch_to_previous_scene(uint8_t count = 1);
|
||||
Scene get_previous_scene();
|
||||
IrdaAppViewManager* get_view_manager();
|
||||
void set_text_store(uint8_t index, const char* text...);
|
||||
char* get_text_store(uint8_t index);
|
||||
uint8_t get_text_store_size();
|
||||
IrdaAppRemoteManager* get_remote_manager();
|
||||
|
||||
IrdaWorker* get_irda_worker();
|
||||
const IrdaAppSignal& get_received_signal() const;
|
||||
void set_received_signal(const IrdaAppSignal& signal);
|
||||
|
||||
void search_and_switch_to_previous_scene(const std::initializer_list<Scene>& scenes_list);
|
||||
|
||||
void set_edit_element(EditElement value);
|
||||
EditElement get_edit_element(void);
|
||||
|
||||
void set_edit_action(EditAction value);
|
||||
EditAction get_edit_action(void);
|
||||
|
||||
bool get_learn_new_remote();
|
||||
void set_learn_new_remote(bool value);
|
||||
|
||||
enum : int {
|
||||
ButtonNA = -1,
|
||||
};
|
||||
int get_current_button();
|
||||
void set_current_button(int value);
|
||||
|
||||
void notify_success();
|
||||
void notify_red_blink();
|
||||
void notify_sent_just_learnt();
|
||||
void notify_green_on();
|
||||
void notify_green_off();
|
||||
void notify_click();
|
||||
void notify_click_and_green_blink();
|
||||
void notify_blink_green();
|
||||
|
||||
static void text_input_callback(void* context);
|
||||
static void popup_callback(void* context);
|
||||
static void signal_sent_callback(void* context);
|
||||
|
||||
IrdaApp();
|
||||
~IrdaApp();
|
||||
|
||||
static constexpr const char* irda_directory = "/any/irda";
|
||||
static constexpr const char* irda_extension = ".ir";
|
||||
static constexpr const uint32_t max_raw_timings_in_signal = 512;
|
||||
static constexpr const uint32_t max_line_length =
|
||||
(9 + 1) * IrdaApp::max_raw_timings_in_signal + 100;
|
||||
|
||||
private:
|
||||
static constexpr const uint8_t text_store_size = 128;
|
||||
static constexpr const uint8_t text_store_max = 2;
|
||||
char text_store[text_store_max][text_store_size + 1];
|
||||
bool learn_new_remote;
|
||||
EditElement element;
|
||||
EditAction action;
|
||||
uint32_t current_button;
|
||||
|
||||
NotificationApp* notification;
|
||||
IrdaAppViewManager view_manager;
|
||||
IrdaAppRemoteManager remote_manager;
|
||||
IrdaWorker* irda_worker;
|
||||
IrdaAppSignal received_signal;
|
||||
|
||||
std::forward_list<Scene> previous_scenes_list;
|
||||
Scene current_scene = Scene::Start;
|
||||
|
||||
std::map<Scene, IrdaAppScene*> scenes = {
|
||||
{Scene::Start, new IrdaAppSceneStart()},
|
||||
{Scene::Universal, new IrdaAppSceneUniversal()},
|
||||
{Scene::UniversalTV, new IrdaAppSceneUniversalTV()},
|
||||
// {Scene::UniversalAudio, new IrdaAppSceneUniversalAudio()},
|
||||
{Scene::Learn, new IrdaAppSceneLearn()},
|
||||
{Scene::LearnSuccess, new IrdaAppSceneLearnSuccess()},
|
||||
{Scene::LearnEnterName, new IrdaAppSceneLearnEnterName()},
|
||||
{Scene::LearnDone, new IrdaAppSceneLearnDone()},
|
||||
{Scene::AskBack, new IrdaAppSceneAskBack()},
|
||||
{Scene::Remote, new IrdaAppSceneRemote()},
|
||||
{Scene::RemoteList, new IrdaAppSceneRemoteList()},
|
||||
{Scene::Edit, new IrdaAppSceneEdit()},
|
||||
{Scene::EditKeySelect, new IrdaAppSceneEditKeySelect()},
|
||||
{Scene::EditRename, new IrdaAppSceneEditRename()},
|
||||
{Scene::EditDelete, new IrdaAppSceneEditDelete()},
|
||||
{Scene::EditRenameDone, new IrdaAppSceneEditRenameDone()},
|
||||
{Scene::EditDeleteDone, new IrdaAppSceneEditDeleteDone()},
|
||||
};
|
||||
};
|
|
@ -1,36 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <flipper_format/flipper_format.h>
|
||||
|
||||
class IrdaAppBruteForce {
|
||||
const char* universal_db_filename;
|
||||
std::string current_record;
|
||||
FlipperFormat* ff;
|
||||
|
||||
typedef struct {
|
||||
int index;
|
||||
int amount;
|
||||
} Record;
|
||||
|
||||
// 'key' is record name, because we have to search by both, index and name,
|
||||
// but index search has place once per button press, and should not be
|
||||
// noticed, but name search should occur during entering universal menu,
|
||||
// and will go through container for every record in file, that's why
|
||||
// more critical to have faster search by record name.
|
||||
std::unordered_map<std::string, Record> records;
|
||||
|
||||
public:
|
||||
bool calculate_messages();
|
||||
void stop_bruteforce();
|
||||
bool send_next_bruteforce();
|
||||
bool start_bruteforce(int index, int& record_amount);
|
||||
void add_record(int index, const char* name);
|
||||
|
||||
IrdaAppBruteForce(const char* filename)
|
||||
: universal_db_filename(filename) {
|
||||
}
|
||||
~IrdaAppBruteForce() {
|
||||
}
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
#pragma once
|
||||
#include <irda.h>
|
||||
#include <gui/modules/dialog_ex.h>
|
||||
|
||||
class IrdaAppEvent {
|
||||
public:
|
||||
enum class Type : uint8_t {
|
||||
Tick,
|
||||
Exit,
|
||||
Back,
|
||||
MenuSelected,
|
||||
MenuSelectedPress,
|
||||
MenuSelectedRelease,
|
||||
DialogExSelected,
|
||||
NextScene,
|
||||
IrdaMessageReceived,
|
||||
TextEditDone,
|
||||
PopupTimer,
|
||||
ButtonPanelPressed,
|
||||
};
|
||||
|
||||
union {
|
||||
int32_t menu_index;
|
||||
DialogExResult dialog_ex_result;
|
||||
} payload;
|
||||
|
||||
Type type;
|
||||
};
|
|
@ -1,76 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "irda_app_signal.h"
|
||||
|
||||
#include <irda_worker.h>
|
||||
#include <irda.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class IrdaAppRemoteButton {
|
||||
friend class IrdaAppRemoteManager;
|
||||
std::string name;
|
||||
IrdaAppSignal signal;
|
||||
|
||||
public:
|
||||
IrdaAppRemoteButton(const char* name, const IrdaAppSignal& signal)
|
||||
: name(name)
|
||||
, signal(signal) {
|
||||
}
|
||||
|
||||
IrdaAppRemoteButton(const char* name, IrdaAppSignal&& signal)
|
||||
: name(name)
|
||||
, signal(std::move(signal)) {
|
||||
}
|
||||
~IrdaAppRemoteButton() {
|
||||
}
|
||||
};
|
||||
|
||||
class IrdaAppRemote {
|
||||
friend class IrdaAppRemoteManager;
|
||||
std::vector<IrdaAppRemoteButton> buttons;
|
||||
std::string name;
|
||||
|
||||
public:
|
||||
IrdaAppRemote(const std::string& name)
|
||||
: name(name) {
|
||||
}
|
||||
|
||||
IrdaAppRemote& operator=(std::string& new_name) noexcept {
|
||||
name = new_name;
|
||||
buttons.clear();
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
class IrdaAppRemoteManager {
|
||||
std::unique_ptr<IrdaAppRemote> remote;
|
||||
std::string make_full_name(const std::string& remote_name) const;
|
||||
std::string make_remote_name(const std::string& full_name) const;
|
||||
|
||||
public:
|
||||
static constexpr const uint32_t max_button_name_length = 22;
|
||||
static constexpr const uint32_t max_remote_name_length = 22;
|
||||
bool add_remote_with_button(const char* button_name, const IrdaAppSignal& signal);
|
||||
bool add_button(const char* button_name, const IrdaAppSignal& signal);
|
||||
|
||||
int find_remote_name(const std::vector<std::string>& strings);
|
||||
bool rename_button(uint32_t index, const char* str);
|
||||
bool rename_remote(const char* str);
|
||||
std::string find_vacant_remote_name(const std::string& name);
|
||||
|
||||
std::vector<std::string> get_button_list() const;
|
||||
std::string get_button_name(uint32_t index);
|
||||
std::string get_remote_name();
|
||||
size_t get_number_of_buttons();
|
||||
const IrdaAppSignal& get_button_data(size_t index) const;
|
||||
bool delete_button(uint32_t index);
|
||||
bool delete_remote();
|
||||
void reset_remote();
|
||||
|
||||
bool store();
|
||||
bool load(const std::string& name);
|
||||
};
|
|
@ -1,68 +0,0 @@
|
|||
#pragma once
|
||||
#include <irda_worker.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <irda.h>
|
||||
|
||||
class IrdaAppSignal {
|
||||
public:
|
||||
typedef struct {
|
||||
size_t timings_cnt;
|
||||
uint32_t* timings;
|
||||
uint32_t frequency;
|
||||
float duty_cycle;
|
||||
} RawSignal;
|
||||
|
||||
private:
|
||||
bool raw_signal;
|
||||
union {
|
||||
IrdaMessage message;
|
||||
RawSignal raw;
|
||||
} payload;
|
||||
|
||||
void
|
||||
copy_raw_signal(const uint32_t* timings, size_t size, uint32_t frequency, float duty_cycle);
|
||||
void clear_timings();
|
||||
|
||||
public:
|
||||
IrdaAppSignal() {
|
||||
raw_signal = false;
|
||||
payload.message.protocol = IrdaProtocolUnknown;
|
||||
}
|
||||
|
||||
~IrdaAppSignal() {
|
||||
clear_timings();
|
||||
}
|
||||
|
||||
IrdaAppSignal(
|
||||
const uint32_t* timings,
|
||||
size_t timings_cnt,
|
||||
uint32_t frequency,
|
||||
float duty_cycle);
|
||||
IrdaAppSignal(const IrdaMessage* irda_message);
|
||||
|
||||
IrdaAppSignal(const IrdaAppSignal& other);
|
||||
IrdaAppSignal(IrdaAppSignal&& other);
|
||||
|
||||
IrdaAppSignal& operator=(const IrdaAppSignal& signal);
|
||||
|
||||
void set_message(const IrdaMessage* irda_message);
|
||||
void
|
||||
set_raw_signal(uint32_t* timings, size_t timings_cnt, uint32_t frequency, float duty_cycle);
|
||||
|
||||
void transmit() const;
|
||||
|
||||
bool is_raw(void) const {
|
||||
return raw_signal;
|
||||
}
|
||||
|
||||
const IrdaMessage& get_message(void) const {
|
||||
furi_assert(!raw_signal);
|
||||
return payload.message;
|
||||
}
|
||||
|
||||
const RawSignal& get_raw_signal(void) const {
|
||||
furi_assert(raw_signal);
|
||||
return payload.raw;
|
||||
}
|
||||
};
|
|
@ -1,66 +0,0 @@
|
|||
#pragma once
|
||||
#include <gui/modules/button_menu.h>
|
||||
#include <gui/modules/text_input.h>
|
||||
#include <gui/view_stack.h>
|
||||
#include <gui/modules/button_panel.h>
|
||||
#include <furi.h>
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/modules/dialog_ex.h>
|
||||
#include <gui/modules/submenu.h>
|
||||
#include <gui/modules/popup.h>
|
||||
#include <gui/modules/loading.h>
|
||||
|
||||
#include "irda_app_event.h"
|
||||
#include "view/irda_progress_view.h"
|
||||
|
||||
class IrdaAppViewManager {
|
||||
public:
|
||||
enum class ViewType : uint8_t {
|
||||
DialogEx,
|
||||
TextInput,
|
||||
Submenu,
|
||||
ButtonMenu,
|
||||
UniversalRemote,
|
||||
Popup,
|
||||
};
|
||||
|
||||
IrdaAppViewManager();
|
||||
~IrdaAppViewManager();
|
||||
|
||||
void switch_to(ViewType type);
|
||||
|
||||
void receive_event(IrdaAppEvent* event);
|
||||
void send_event(IrdaAppEvent* event);
|
||||
void clear_events();
|
||||
|
||||
DialogEx* get_dialog_ex();
|
||||
Submenu* get_submenu();
|
||||
Popup* get_popup();
|
||||
TextInput* get_text_input();
|
||||
ButtonMenu* get_button_menu();
|
||||
ButtonPanel* get_button_panel();
|
||||
ViewStack* get_universal_view_stack();
|
||||
IrdaProgressView* get_progress();
|
||||
Loading* get_loading();
|
||||
|
||||
osMessageQueueId_t get_event_queue();
|
||||
|
||||
uint32_t previous_view_callback(void* context);
|
||||
|
||||
private:
|
||||
ViewDispatcher* view_dispatcher;
|
||||
Gui* gui;
|
||||
TextInput* text_input;
|
||||
DialogEx* dialog_ex;
|
||||
Submenu* submenu;
|
||||
Popup* popup;
|
||||
ButtonMenu* button_menu;
|
||||
ButtonPanel* button_panel;
|
||||
ViewStack* universal_view_stack;
|
||||
IrdaProgressView* progress_view;
|
||||
Loading* loading_view;
|
||||
|
||||
osMessageQueueId_t event_queue;
|
||||
|
||||
void add_view(ViewType view_type, View* view);
|
||||
};
|
|
@ -1,9 +0,0 @@
|
|||
#include "irda_app.h"
|
||||
|
||||
extern "C" int32_t irda_app(void* p) {
|
||||
IrdaApp* app = new IrdaApp();
|
||||
int32_t result = app->run(p);
|
||||
delete app;
|
||||
|
||||
return result;
|
||||
}
|
|
@ -1,184 +0,0 @@
|
|||
#pragma once
|
||||
#include "../irda_app_event.h"
|
||||
#include <furi_hal_irda.h>
|
||||
#include "irda.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "../irda_app_brute_force.h"
|
||||
|
||||
class IrdaApp;
|
||||
|
||||
class IrdaAppScene {
|
||||
public:
|
||||
virtual void on_enter(IrdaApp* app) = 0;
|
||||
virtual bool on_event(IrdaApp* app, IrdaAppEvent* event) = 0;
|
||||
virtual void on_exit(IrdaApp* app) = 0;
|
||||
virtual ~IrdaAppScene(){};
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class IrdaAppSceneStart : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
|
||||
private:
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
|
||||
class IrdaAppSceneUniversal : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
|
||||
private:
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
|
||||
class IrdaAppSceneLearn : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneLearnSuccess : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
bool button_pressed = false;
|
||||
};
|
||||
|
||||
class IrdaAppSceneLearnEnterName : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneLearnDone : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneRemote : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
|
||||
private:
|
||||
std::vector<std::string> buttons_names;
|
||||
uint32_t buttonmenu_item_selected = 0;
|
||||
bool button_pressed = false;
|
||||
};
|
||||
|
||||
class IrdaAppSceneRemoteList : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
|
||||
private:
|
||||
uint32_t submenu_item_selected = 0;
|
||||
std::vector<std::string> remote_names;
|
||||
};
|
||||
|
||||
class IrdaAppSceneAskBack : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneEdit : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
|
||||
private:
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
|
||||
class IrdaAppSceneEditKeySelect : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
|
||||
private:
|
||||
std::vector<std::string> buttons_names;
|
||||
};
|
||||
|
||||
class IrdaAppSceneEditRename : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneEditDelete : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneEditRenameDone : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneEditDeleteDone : public IrdaAppScene {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
};
|
||||
|
||||
class IrdaAppSceneUniversalCommon : public IrdaAppScene {
|
||||
bool brute_force_started = false;
|
||||
|
||||
protected:
|
||||
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
||||
void on_exit(IrdaApp* app) final;
|
||||
IrdaAppBruteForce brute_force;
|
||||
void remove_popup(IrdaApp* app);
|
||||
void show_popup(IrdaApp* app, int record_amount);
|
||||
bool progress_popup(IrdaApp* app);
|
||||
static void irda_app_item_callback(void* context, uint32_t index);
|
||||
IrdaAppSceneUniversalCommon(const char* filename)
|
||||
: brute_force(filename) {
|
||||
}
|
||||
~IrdaAppSceneUniversalCommon() {
|
||||
}
|
||||
};
|
||||
|
||||
class IrdaAppSceneUniversalTV : public IrdaAppSceneUniversalCommon {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
IrdaAppSceneUniversalTV()
|
||||
: IrdaAppSceneUniversalCommon("/ext/irda/assets/tv.ir") {
|
||||
}
|
||||
~IrdaAppSceneUniversalTV() {
|
||||
}
|
||||
};
|
||||
|
||||
class IrdaAppSceneUniversalAudio : public IrdaAppSceneUniversalCommon {
|
||||
public:
|
||||
void on_enter(IrdaApp* app) final;
|
||||
IrdaAppSceneUniversalAudio()
|
||||
: IrdaAppSceneUniversalCommon("/ext/irda/assets/audio.ir") {
|
||||
}
|
||||
~IrdaAppSceneUniversalAudio() {
|
||||
}
|
||||
};
|
|
@ -1,38 +0,0 @@
|
|||
#include "../irda_app.h"
|
||||
|
||||
void IrdaAppSceneEditDeleteDone::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
|
||||
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
|
||||
popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
|
||||
|
||||
popup_set_callback(popup, IrdaApp::popup_callback);
|
||||
popup_set_context(popup, app);
|
||||
popup_set_timeout(popup, 1500);
|
||||
popup_enable_timeout(popup);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Popup);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneEditDeleteDone::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::PopupTimer) {
|
||||
if(app->get_edit_element() == IrdaApp::EditElement::Remote) {
|
||||
app->search_and_switch_to_previous_scene(
|
||||
{IrdaApp::Scene::Start, IrdaApp::Scene::RemoteList});
|
||||
} else {
|
||||
app->search_and_switch_to_previous_scene({IrdaApp::Scene::Remote});
|
||||
}
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditDeleteDone::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
popup_set_header(popup, nullptr, 0, 0, AlignLeft, AlignTop);
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
#include "../irda_app.h"
|
||||
#include "gui/modules/submenu.h"
|
||||
|
||||
static void submenu_callback(void* context, uint32_t index) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::MenuSelected;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditKeySelect::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
int item_number = 0;
|
||||
|
||||
const char* header = app->get_edit_action() == IrdaApp::EditAction::Rename ? "Rename key:" :
|
||||
"Delete key:";
|
||||
submenu_set_header(submenu, header);
|
||||
|
||||
auto remote_manager = app->get_remote_manager();
|
||||
buttons_names = remote_manager->get_button_list();
|
||||
for(const auto& it : buttons_names) {
|
||||
submenu_add_item(submenu, it.c_str(), item_number++, submenu_callback, app);
|
||||
}
|
||||
if((item_number > 0) && (app->get_current_button() != IrdaApp::ButtonNA)) {
|
||||
submenu_set_selected_item(submenu, app->get_current_button());
|
||||
app->set_current_button(IrdaApp::ButtonNA);
|
||||
}
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Submenu);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneEditKeySelect::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::MenuSelected) {
|
||||
app->set_current_button(event->payload.menu_index);
|
||||
consumed = true;
|
||||
if(app->get_edit_action() == IrdaApp::EditAction::Rename) {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditRename);
|
||||
} else {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::EditDelete);
|
||||
}
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditKeySelect::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
Submenu* submenu = view_manager->get_submenu();
|
||||
|
||||
submenu_reset(submenu);
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#include "../irda_app.h"
|
||||
|
||||
void IrdaAppSceneEditRenameDone::on_enter(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
Popup* popup = view_manager->get_popup();
|
||||
|
||||
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
|
||||
|
||||
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
|
||||
|
||||
popup_set_callback(popup, IrdaApp::popup_callback);
|
||||
popup_set_context(popup, app);
|
||||
popup_set_timeout(popup, 1500);
|
||||
popup_enable_timeout(popup);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Popup);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneEditRenameDone::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == IrdaAppEvent::Type::PopupTimer) {
|
||||
app->switch_to_next_scene(IrdaApp::Scene::Remote);
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneEditRenameDone::on_exit(IrdaApp* app) {
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
#include "../irda_app.h"
|
||||
#include "../irda_app_event.h"
|
||||
#include "irda.h"
|
||||
#include <irda_worker.h>
|
||||
|
||||
static void signal_received_callback(void* context, IrdaWorkerSignal* received_signal) {
|
||||
furi_assert(context);
|
||||
furi_assert(received_signal);
|
||||
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
|
||||
if(irda_worker_signal_is_decoded(received_signal)) {
|
||||
IrdaAppSignal signal(irda_worker_get_decoded_signal(received_signal));
|
||||
app->set_received_signal(signal);
|
||||
} else {
|
||||
const uint32_t* timings;
|
||||
size_t timings_cnt;
|
||||
irda_worker_get_raw_signal(received_signal, &timings, &timings_cnt);
|
||||
IrdaAppSignal signal(
|
||||
timings, timings_cnt, IRDA_COMMON_CARRIER_FREQUENCY, IRDA_COMMON_DUTY_CYCLE);
|
||||
app->set_received_signal(signal);
|
||||
}
|
||||
|
||||
irda_worker_rx_set_received_signal_callback(app->get_irda_worker(), NULL, NULL);
|
||||
IrdaAppEvent event;
|
||||
event.type = IrdaAppEvent::Type::IrdaMessageReceived;
|
||||
auto view_manager = app->get_view_manager();
|
||||
view_manager->send_event(&event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneLearn::on_enter(IrdaApp* app) {
|
||||
auto view_manager = app->get_view_manager();
|
||||
auto popup = view_manager->get_popup();
|
||||
|
||||
auto worker = app->get_irda_worker();
|
||||
irda_worker_rx_set_received_signal_callback(worker, signal_received_callback, app);
|
||||
irda_worker_rx_start(worker);
|
||||
|
||||
popup_set_icon(popup, 0, 32, &I_IrdaLearnShort_128x31);
|
||||
popup_set_text(
|
||||
popup, "Point the remote at IR port\nand push the button", 5, 10, AlignLeft, AlignCenter);
|
||||
popup_set_callback(popup, NULL);
|
||||
|
||||
view_manager->switch_to(IrdaAppViewManager::ViewType::Popup);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneLearn::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
switch(event->type) {
|
||||
case IrdaAppEvent::Type::Tick:
|
||||
consumed = true;
|
||||
app->notify_red_blink();
|
||||
break;
|
||||
case IrdaAppEvent::Type::IrdaMessageReceived:
|
||||
app->notify_success();
|
||||
app->switch_to_next_scene_without_saving(IrdaApp::Scene::LearnSuccess);
|
||||
break;
|
||||
case IrdaAppEvent::Type::Back:
|
||||
consumed = true;
|
||||
app->switch_to_previous_scene();
|
||||
break;
|
||||
default:
|
||||
furi_assert(0);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneLearn::on_exit(IrdaApp* app) {
|
||||
irda_worker_rx_stop(app->get_irda_worker());
|
||||
auto view_manager = app->get_view_manager();
|
||||
auto popup = view_manager->get_popup();
|
||||
popup_set_text(popup, NULL, 0, 0, AlignCenter, AlignCenter);
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
#include <dolphin/dolphin.h>
|
||||
#include <gui/modules/button_menu.h>
|
||||
#include <gui/modules/button_panel.h>
|
||||
#include <gui/view.h>
|
||||
#include <gui/view_stack.h>
|
||||
|
||||
#include "../irda_app.h"
|
||||
#include "irda/irda_app_event.h"
|
||||
#include "irda/irda_app_view_manager.h"
|
||||
#include "irda/scene/irda_app_scene.h"
|
||||
#include "../view/irda_progress_view.h"
|
||||
|
||||
void IrdaAppSceneUniversalCommon::irda_app_item_callback(void* context, uint32_t index) {
|
||||
IrdaApp* app = static_cast<IrdaApp*>(context);
|
||||
IrdaAppEvent event;
|
||||
|
||||
event.type = IrdaAppEvent::Type::ButtonPanelPressed;
|
||||
event.payload.menu_index = index;
|
||||
|
||||
app->get_view_manager()->send_event(&event);
|
||||
}
|
||||
|
||||
static void irda_progress_back_callback(void* context) {
|
||||
furi_assert(context);
|
||||
auto app = static_cast<IrdaApp*>(context);
|
||||
|
||||
IrdaAppEvent irda_event = {
|
||||
.type = IrdaAppEvent::Type::Back,
|
||||
};
|
||||
app->get_view_manager()->clear_events();
|
||||
app->get_view_manager()->send_event(&irda_event);
|
||||
}
|
||||
|
||||
void IrdaAppSceneUniversalCommon::remove_popup(IrdaApp* app) {
|
||||
auto stack_view = app->get_view_manager()->get_universal_view_stack();
|
||||
auto progress_view = app->get_view_manager()->get_progress();
|
||||
view_stack_remove_view(stack_view, irda_progress_view_get_view(progress_view));
|
||||
}
|
||||
|
||||
void IrdaAppSceneUniversalCommon::show_popup(IrdaApp* app, int record_amount) {
|
||||
auto stack_view = app->get_view_manager()->get_universal_view_stack();
|
||||
auto progress_view = app->get_view_manager()->get_progress();
|
||||
irda_progress_view_set_progress_total(progress_view, record_amount);
|
||||
irda_progress_view_set_back_callback(progress_view, irda_progress_back_callback, app);
|
||||
view_stack_add_view(stack_view, irda_progress_view_get_view(progress_view));
|
||||
}
|
||||
|
||||
bool IrdaAppSceneUniversalCommon::progress_popup(IrdaApp* app) {
|
||||
auto progress_view = app->get_view_manager()->get_progress();
|
||||
return irda_progress_view_increase_progress(progress_view);
|
||||
}
|
||||
|
||||
bool IrdaAppSceneUniversalCommon::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
||||
bool consumed = false;
|
||||
|
||||
if(brute_force_started) {
|
||||
if(event->type == IrdaAppEvent::Type::Tick) {
|
||||
auto view_manager = app->get_view_manager();
|
||||
IrdaAppEvent tick_event = {.type = IrdaAppEvent::Type::Tick};
|
||||
view_manager->send_event(&tick_event);
|
||||
bool result = brute_force.send_next_bruteforce();
|
||||
if(result) {
|
||||
result = progress_popup(app);
|
||||
}
|
||||
if(!result) {
|
||||
brute_force.stop_bruteforce();
|
||||
brute_force_started = false;
|
||||
remove_popup(app);
|
||||
}
|
||||
consumed = true;
|
||||
} else if(event->type == IrdaAppEvent::Type::Back) {
|
||||
brute_force_started = false;
|
||||
brute_force.stop_bruteforce();
|
||||
remove_popup(app);
|
||||
consumed = true;
|
||||
}
|
||||
} else {
|
||||
if(event->type == IrdaAppEvent::Type::ButtonPanelPressed) {
|
||||
int record_amount = 0;
|
||||
if(brute_force.start_bruteforce(event->payload.menu_index, record_amount)) {
|
||||
DOLPHIN_DEED(DolphinDeedIrBruteForce);
|
||||
brute_force_started = true;
|
||||
show_popup(app, record_amount);
|
||||
} else {
|
||||
app->switch_to_previous_scene();
|
||||
}
|
||||
consumed = true;
|
||||
} else if(event->type == IrdaAppEvent::Type::Back) {
|
||||
app->switch_to_previous_scene();
|
||||
consumed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void IrdaAppSceneUniversalCommon::on_exit(IrdaApp* app) {
|
||||
IrdaAppViewManager* view_manager = app->get_view_manager();
|
||||
ButtonPanel* button_panel = view_manager->get_button_panel();
|
||||
button_panel_reset(button_panel);
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#pragma once
|
||||
#include <gui/view.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct IrdaProgressView IrdaProgressView;
|
||||
|
||||
typedef void (*IrdaProgressViewBackCallback)(void*);
|
||||
|
||||
IrdaProgressView* irda_progress_view_alloc();
|
||||
void irda_progress_view_free(IrdaProgressView* progress);
|
||||
View* irda_progress_view_get_view(IrdaProgressView* progress);
|
||||
|
||||
bool irda_progress_view_increase_progress(IrdaProgressView* progress);
|
||||
void irda_progress_view_set_progress_total(IrdaProgressView* progress, uint16_t progress_max);
|
||||
void irda_progress_view_set_back_callback(
|
||||
IrdaProgressView* instance,
|
||||
IrdaProgressViewBackCallback callback,
|
||||
void* context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -1,139 +0,0 @@
|
|||
#include <gui/canvas.h>
|
||||
#include <input/input.h>
|
||||
#include <irda.h>
|
||||
#include <irda_worker.h>
|
||||
#include <stdio.h>
|
||||
#include <furi.h>
|
||||
#include <furi_hal_irda.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/view_port.h>
|
||||
#include <gui/gui.h>
|
||||
#include <gui/elements.h>
|
||||
|
||||
#define IRDA_TIMINGS_SIZE 700
|
||||
|
||||
typedef struct {
|
||||
uint32_t timing_cnt;
|
||||
struct {
|
||||
uint8_t level;
|
||||
uint32_t duration;
|
||||
} timing[IRDA_TIMINGS_SIZE];
|
||||
} IrdaDelaysArray;
|
||||
|
||||
typedef struct {
|
||||
char display_text[64];
|
||||
osMessageQueueId_t event_queue;
|
||||
IrdaDelaysArray delays;
|
||||
IrdaWorker* worker;
|
||||
ViewPort* view_port;
|
||||
} IrdaMonitor;
|
||||
|
||||
void irda_monitor_input_callback(InputEvent* input_event, void* ctx) {
|
||||
furi_assert(ctx);
|
||||
IrdaMonitor* irda_monitor = (IrdaMonitor*)ctx;
|
||||
|
||||
if((input_event->type == InputTypeShort) && (input_event->key == InputKeyBack)) {
|
||||
osMessageQueuePut(irda_monitor->event_queue, input_event, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void irda_monitor_draw_callback(Canvas* canvas, void* ctx) {
|
||||
furi_assert(canvas);
|
||||
furi_assert(ctx);
|
||||
IrdaMonitor* irda_monitor = (IrdaMonitor*)ctx;
|
||||
|
||||
canvas_clear(canvas);
|
||||
canvas_set_font(canvas, FontPrimary);
|
||||
elements_multiline_text_aligned(canvas, 64, 0, AlignCenter, AlignTop, "IRDA monitor\n");
|
||||
canvas_set_font(canvas, FontKeyboard);
|
||||
if(strlen(irda_monitor->display_text)) {
|
||||
elements_multiline_text_aligned(
|
||||
canvas, 64, 43, AlignCenter, AlignCenter, irda_monitor->display_text);
|
||||
}
|
||||
}
|
||||
|
||||
static void signal_received_callback(void* context, IrdaWorkerSignal* received_signal) {
|
||||
furi_assert(context);
|
||||
furi_assert(received_signal);
|
||||
IrdaMonitor* irda_monitor = context;
|
||||
|
||||
if(irda_worker_signal_is_decoded(received_signal)) {
|
||||
const IrdaMessage* message = irda_worker_get_decoded_signal(received_signal);
|
||||
snprintf(
|
||||
irda_monitor->display_text,
|
||||
sizeof(irda_monitor->display_text),
|
||||
"%s\nA:0x%0*lX\nC:0x%0*lX\n%s\n",
|
||||
irda_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(irda_get_protocol_address_length(message->protocol), 4),
|
||||
message->address,
|
||||
ROUND_UP_TO(irda_get_protocol_command_length(message->protocol), 4),
|
||||
message->command,
|
||||
message->repeat ? " R" : "");
|
||||
view_port_update(irda_monitor->view_port);
|
||||
printf(
|
||||
"== %s, A:0x%0*lX, C:0x%0*lX%s ==\r\n",
|
||||
irda_get_protocol_name(message->protocol),
|
||||
ROUND_UP_TO(irda_get_protocol_address_length(message->protocol), 4),
|
||||
message->address,
|
||||
ROUND_UP_TO(irda_get_protocol_command_length(message->protocol), 4),
|
||||
message->command,
|
||||
message->repeat ? " R" : "");
|
||||
} else {
|
||||
const uint32_t* timings;
|
||||
size_t timings_cnt;
|
||||
irda_worker_get_raw_signal(received_signal, &timings, &timings_cnt);
|
||||
snprintf(
|
||||
irda_monitor->display_text,
|
||||
sizeof(irda_monitor->display_text),
|
||||
"RAW\n%d samples\n",
|
||||
timings_cnt);
|
||||
view_port_update(irda_monitor->view_port);
|
||||
printf("RAW, %d samples:\r\n", timings_cnt);
|
||||
for(size_t i = 0; i < timings_cnt; ++i) {
|
||||
printf("%lu ", timings[i]);
|
||||
}
|
||||
printf("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
int32_t irda_monitor_app(void* p) {
|
||||
(void)p;
|
||||
|
||||
IrdaMonitor* irda_monitor = malloc(sizeof(IrdaMonitor));
|
||||
irda_monitor->display_text[0] = 0;
|
||||
irda_monitor->event_queue = osMessageQueueNew(1, sizeof(InputEvent), NULL);
|
||||
irda_monitor->view_port = view_port_alloc();
|
||||
Gui* gui = furi_record_open("gui");
|
||||
|
||||
view_port_draw_callback_set(irda_monitor->view_port, irda_monitor_draw_callback, irda_monitor);
|
||||
view_port_input_callback_set(
|
||||
irda_monitor->view_port, irda_monitor_input_callback, irda_monitor);
|
||||
|
||||
gui_add_view_port(gui, irda_monitor->view_port, GuiLayerFullscreen);
|
||||
|
||||
irda_monitor->worker = irda_worker_alloc();
|
||||
irda_worker_rx_start(irda_monitor->worker);
|
||||
irda_worker_rx_set_received_signal_callback(
|
||||
irda_monitor->worker, signal_received_callback, irda_monitor);
|
||||
irda_worker_rx_enable_blink_on_receiving(irda_monitor->worker, true);
|
||||
|
||||
while(1) {
|
||||
InputEvent event;
|
||||
if(osOK == osMessageQueueGet(irda_monitor->event_queue, &event, NULL, 50)) {
|
||||
if((event.type == InputTypeShort) && (event.key == InputKeyBack)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
irda_worker_rx_stop(irda_monitor->worker);
|
||||
irda_worker_free(irda_monitor->worker);
|
||||
osMessageQueueDelete(irda_monitor->event_queue);
|
||||
view_port_enabled_set(irda_monitor->view_port, false);
|
||||
gui_remove_view_port(gui, irda_monitor->view_port);
|
||||
view_port_free(irda_monitor->view_port);
|
||||
furi_record_close("gui");
|
||||
free(irda_monitor);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
#include <furi.h>
|
||||
#include "../minunit.h"
|
||||
#include "irda.h"
|
||||
#include "common/irda_common_i.h"
|
||||
#include "test_data/irda_nec_test_data.srcdata"
|
||||
#include "test_data/irda_necext_test_data.srcdata"
|
||||
#include "test_data/irda_samsung_test_data.srcdata"
|
||||
#include "test_data/irda_rc6_test_data.srcdata"
|
||||
#include "test_data/irda_rc5_test_data.srcdata"
|
||||
#include "test_data/irda_sirc_test_data.srcdata"
|
||||
#include "infrared.h"
|
||||
#include "common/infrared_common_i.h"
|
||||
#include "test_data/infrared_nec_test_data.srcdata"
|
||||
#include "test_data/infrared_necext_test_data.srcdata"
|
||||
#include "test_data/infrared_samsung_test_data.srcdata"
|
||||
#include "test_data/infrared_rc6_test_data.srcdata"
|
||||
#include "test_data/infrared_rc5_test_data.srcdata"
|
||||
#include "test_data/infrared_sirc_test_data.srcdata"
|
||||
|
||||
#define RUN_ENCODER(data, expected) \
|
||||
run_encoder((data), COUNT_OF(data), (expected), COUNT_OF(expected))
|
||||
|
@ -17,28 +17,28 @@
|
|||
|
||||
#define RUN_ENCODER_DECODER(data) run_encoder_decoder((data), COUNT_OF(data))
|
||||
|
||||
static IrdaDecoderHandler* decoder_handler;
|
||||
static IrdaEncoderHandler* encoder_handler;
|
||||
static InfraredDecoderHandler* decoder_handler;
|
||||
static InfraredEncoderHandler* encoder_handler;
|
||||
|
||||
static void test_setup(void) {
|
||||
decoder_handler = irda_alloc_decoder();
|
||||
encoder_handler = irda_alloc_encoder();
|
||||
decoder_handler = infrared_alloc_decoder();
|
||||
encoder_handler = infrared_alloc_encoder();
|
||||
}
|
||||
|
||||
static void test_teardown(void) {
|
||||
irda_free_decoder(decoder_handler);
|
||||
irda_free_encoder(encoder_handler);
|
||||
infrared_free_decoder(decoder_handler);
|
||||
infrared_free_encoder(encoder_handler);
|
||||
}
|
||||
|
||||
static void compare_message_results(
|
||||
const IrdaMessage* message_decoded,
|
||||
const IrdaMessage* message_expected) {
|
||||
const InfraredMessage* message_decoded,
|
||||
const InfraredMessage* message_expected) {
|
||||
mu_check(message_decoded->protocol == message_expected->protocol);
|
||||
mu_check(message_decoded->command == message_expected->command);
|
||||
mu_check(message_decoded->address == message_expected->address);
|
||||
if((message_expected->protocol == IrdaProtocolSIRC) ||
|
||||
(message_expected->protocol == IrdaProtocolSIRC15) ||
|
||||
(message_expected->protocol == IrdaProtocolSIRC20)) {
|
||||
if((message_expected->protocol == InfraredProtocolSIRC) ||
|
||||
(message_expected->protocol == InfraredProtocolSIRC15) ||
|
||||
(message_expected->protocol == InfraredProtocolSIRC20)) {
|
||||
mu_check(message_decoded->repeat == false);
|
||||
} else {
|
||||
mu_check(message_decoded->repeat == message_expected->repeat);
|
||||
|
@ -47,19 +47,19 @@ static void compare_message_results(
|
|||
|
||||
/* Encodes signal and merges same levels (high+high, low+low) */
|
||||
static void run_encoder_fill_array(
|
||||
IrdaEncoderHandler* handler,
|
||||
InfraredEncoderHandler* handler,
|
||||
uint32_t* timings,
|
||||
uint32_t* timings_len,
|
||||
bool* start_level) {
|
||||
uint32_t duration = 0;
|
||||
bool level = false;
|
||||
bool level_read;
|
||||
IrdaStatus status = IrdaStatusError;
|
||||
InfraredStatus status = InfraredStatusError;
|
||||
int i = 0;
|
||||
bool first = true;
|
||||
|
||||
while(1) {
|
||||
status = irda_encode(handler, &duration, &level_read);
|
||||
status = infrared_encode(handler, &duration, &level_read);
|
||||
if(first) {
|
||||
if(start_level) *start_level = level_read;
|
||||
first = false;
|
||||
|
@ -72,8 +72,8 @@ static void run_encoder_fill_array(
|
|||
level = level_read;
|
||||
timings[i] += duration;
|
||||
|
||||
furi_check((status == IrdaStatusOk) || (status == IrdaStatusDone));
|
||||
if(status == IrdaStatusDone) break;
|
||||
furi_check((status == InfraredStatusOk) || (status == InfraredStatusDone));
|
||||
if(status == InfraredStatusDone) break;
|
||||
}
|
||||
|
||||
*timings_len = i + 1;
|
||||
|
@ -81,7 +81,7 @@ static void run_encoder_fill_array(
|
|||
|
||||
// messages in input array for encoder should have one protocol
|
||||
static void run_encoder(
|
||||
const IrdaMessage input_messages[],
|
||||
const InfraredMessage input_messages[],
|
||||
uint32_t input_messages_len,
|
||||
const uint32_t expected_timings[],
|
||||
uint32_t expected_timings_len) {
|
||||
|
@ -91,9 +91,9 @@ static void run_encoder(
|
|||
timings = malloc(sizeof(uint32_t) * timings_len);
|
||||
|
||||
for(uint32_t message_counter = 0; message_counter < input_messages_len; ++message_counter) {
|
||||
const IrdaMessage* message = &input_messages[message_counter];
|
||||
const InfraredMessage* message = &input_messages[message_counter];
|
||||
if(!message->repeat) {
|
||||
irda_reset_encoder(encoder_handler, message);
|
||||
infrared_reset_encoder(encoder_handler, message);
|
||||
}
|
||||
|
||||
timings_len = 200;
|
||||
|
@ -109,25 +109,26 @@ static void run_encoder(
|
|||
mu_assert(j == expected_timings_len, "encoded less timings than expected");
|
||||
}
|
||||
|
||||
static void run_encoder_decoder(const IrdaMessage input_messages[], uint32_t input_messages_len) {
|
||||
static void
|
||||
run_encoder_decoder(const InfraredMessage input_messages[], uint32_t input_messages_len) {
|
||||
uint32_t* timings = 0;
|
||||
uint32_t timings_len = 200;
|
||||
bool level = false;
|
||||
timings = malloc(sizeof(uint32_t) * timings_len);
|
||||
|
||||
for(uint32_t message_counter = 0; message_counter < input_messages_len; ++message_counter) {
|
||||
const IrdaMessage* message_encoded = &input_messages[message_counter];
|
||||
const InfraredMessage* message_encoded = &input_messages[message_counter];
|
||||
if(!message_encoded->repeat) {
|
||||
irda_reset_encoder(encoder_handler, message_encoded);
|
||||
infrared_reset_encoder(encoder_handler, message_encoded);
|
||||
}
|
||||
|
||||
timings_len = 200;
|
||||
run_encoder_fill_array(encoder_handler, timings, &timings_len, &level);
|
||||
furi_check(timings_len <= 200);
|
||||
|
||||
const IrdaMessage* message_decoded = 0;
|
||||
const InfraredMessage* message_decoded = 0;
|
||||
for(int i = 0; i < timings_len; ++i) {
|
||||
message_decoded = irda_decode(decoder_handler, level, timings[i]);
|
||||
message_decoded = infrared_decode(decoder_handler, level, timings[i]);
|
||||
if((i == timings_len - 2) && level && message_decoded) {
|
||||
/* In case we end with space timing - message can be decoded at last mark */
|
||||
break;
|
||||
|
@ -135,7 +136,7 @@ static void run_encoder_decoder(const IrdaMessage input_messages[], uint32_t inp
|
|||
mu_check(!message_decoded);
|
||||
} else {
|
||||
if(!message_decoded) {
|
||||
message_decoded = irda_check_decoder_ready(decoder_handler);
|
||||
message_decoded = infrared_check_decoder_ready(decoder_handler);
|
||||
}
|
||||
mu_check(message_decoded);
|
||||
}
|
||||
|
@ -153,32 +154,32 @@ static void run_encoder_decoder(const IrdaMessage input_messages[], uint32_t inp
|
|||
static void run_decoder(
|
||||
const uint32_t* input_delays,
|
||||
uint32_t input_delays_len,
|
||||
const IrdaMessage* message_expected,
|
||||
const InfraredMessage* message_expected,
|
||||
uint32_t message_expected_len) {
|
||||
IrdaMessage message_decoded_check_local;
|
||||
InfraredMessage message_decoded_check_local;
|
||||
bool level = 0;
|
||||
uint32_t message_counter = 0;
|
||||
const IrdaMessage* message_decoded = 0;
|
||||
const InfraredMessage* message_decoded = 0;
|
||||
|
||||
for(uint32_t i = 0; i < input_delays_len; ++i) {
|
||||
const IrdaMessage* message_decoded_check = 0;
|
||||
const InfraredMessage* message_decoded_check = 0;
|
||||
|
||||
if(input_delays[i] > IRDA_RAW_RX_TIMING_DELAY_US) {
|
||||
message_decoded_check = irda_check_decoder_ready(decoder_handler);
|
||||
if(input_delays[i] > INFRARED_RAW_RX_TIMING_DELAY_US) {
|
||||
message_decoded_check = infrared_check_decoder_ready(decoder_handler);
|
||||
if(message_decoded_check) {
|
||||
/* irda_decode() can reset message, but we have to call irda_decode() to perform real
|
||||
* simulation: irda_check() by timeout, then irda_decode() when meet edge */
|
||||
/* infrared_decode() can reset message, but we have to call infrared_decode() to perform real
|
||||
* simulation: infrared_check() by timeout, then infrared_decode() when meet edge */
|
||||
message_decoded_check_local = *message_decoded_check;
|
||||
message_decoded_check = &message_decoded_check_local;
|
||||
}
|
||||
}
|
||||
|
||||
message_decoded = irda_decode(decoder_handler, level, input_delays[i]);
|
||||
message_decoded = infrared_decode(decoder_handler, level, input_delays[i]);
|
||||
|
||||
if(message_decoded_check || message_decoded) {
|
||||
mu_assert(
|
||||
!(message_decoded_check && message_decoded),
|
||||
"both messages decoded: check_ready() and irda_decode()");
|
||||
"both messages decoded: check_ready() and infrared_decode()");
|
||||
|
||||
if(message_decoded_check) {
|
||||
message_decoded = message_decoded_check;
|
||||
|
@ -192,7 +193,7 @@ static void run_decoder(
|
|||
level = !level;
|
||||
}
|
||||
|
||||
message_decoded = irda_check_decoder_ready(decoder_handler);
|
||||
message_decoded = infrared_check_decoder_ready(decoder_handler);
|
||||
if(message_decoded) {
|
||||
compare_message_results(message_decoded, &message_expected[message_counter]);
|
||||
++message_counter;
|
||||
|
@ -304,7 +305,7 @@ MU_TEST(test_encoder_decoder_all) {
|
|||
RUN_ENCODER_DECODER(test_sirc);
|
||||
}
|
||||
|
||||
MU_TEST_SUITE(test_irda_decoder_encoder) {
|
||||
MU_TEST_SUITE(test_infrared_decoder_encoder) {
|
||||
MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
|
||||
|
||||
MU_RUN_TEST(test_encoder_sirc);
|
||||
|
@ -323,8 +324,8 @@ MU_TEST_SUITE(test_irda_decoder_encoder) {
|
|||
MU_RUN_TEST(test_encoder_decoder_all);
|
||||
}
|
||||
|
||||
int run_minunit_test_irda_decoder_encoder() {
|
||||
MU_RUN_SUITE(test_irda_decoder_encoder);
|
||||
int run_minunit_test_infrared_decoder_encoder() {
|
||||
MU_RUN_SUITE(test_infrared_decoder_encoder);
|
||||
|
||||
return MU_EXIT_CODE;
|
||||
}
|
|
@ -10,10 +10,10 @@ const uint32_t test_decoder_nec_input1[] = {
|
|||
/* message */
|
||||
1415838, 9080, 4436, 611, 494, 600, 505, 578, 500, 608, 501, 602, 502, 580, 498, 606, 508, 605, 500, 583, 1633, 608, 1608, 611, 1631, 578, 1638, 602, 1614, 606, 1637, 583, 1633, 607, 1609, 611, 494, 600, 505, 570, 500, 604, 501, 602, 502, 581, 497, 606, 499, 605, 499, 583, 1633, 617, 1608, 611, 1631, 579, 1638, 602};
|
||||
|
||||
const IrdaMessage test_decoder_nec_expected1[] = {
|
||||
{IrdaProtocolNEC, 0x00, 0, false},
|
||||
{IrdaProtocolNEC, 0x00, 0, true},
|
||||
{IrdaProtocolNEC, 0x00, 0, false},
|
||||
const InfraredMessage test_decoder_nec_expected1[] = {
|
||||
{InfraredProtocolNEC, 0x00, 0, false},
|
||||
{InfraredProtocolNEC, 0x00, 0, true},
|
||||
{InfraredProtocolNEC, 0x00, 0, false},
|
||||
};
|
||||
|
||||
const uint32_t test_decoder_nec_input2[] = {
|
||||
|
@ -123,59 +123,59 @@ const uint32_t test_decoder_nec_input2[] = {
|
|||
40069,9025,2221,588
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_nec_expected2[] = {
|
||||
{IrdaProtocolNEC, 0x00, 0x02, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x02, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x06, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x06, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x04, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x04, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x09, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x09, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x09, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x0A, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x0A, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x08, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x0A, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x0A, true},
|
||||
const InfraredMessage test_decoder_nec_expected2[] = {
|
||||
{InfraredProtocolNEC, 0x00, 0x02, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x02, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x06, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x06, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x04, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x04, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x09, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x09, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x09, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x0A, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x0A, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x08, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x0A, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x0A, true},
|
||||
};
|
||||
|
||||
const uint32_t test_decoder_nec_input3[] = {
|
||||
|
@ -198,112 +198,112 @@ const uint32_t test_decoder_nec_input3[] = {
|
|||
92592, 8861, 4414, 538,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_nec_expected3[] = {
|
||||
{IrdaProtocolNECext, 0x286, 0xB649, false},
|
||||
{IrdaProtocolNECext, 0x286, 0xB649, false},
|
||||
{IrdaProtocolNECext, 0x6880, 0xB649, false},
|
||||
{IrdaProtocolNECext, 0x6880, 0xB649, false},
|
||||
{IrdaProtocolNECext, 0x6380, 0x150F, false},
|
||||
{IrdaProtocolNECext, 0x6380, 0x150F, false},
|
||||
{IrdaProtocolNECext, 0x6480, 0x849, false},
|
||||
{IrdaProtocolNECext, 0x6480, 0x849, false},
|
||||
{IrdaProtocolNECext, 0x7A83, 0x8, false},
|
||||
{IrdaProtocolNECext, 0x7A83, 0x8, false},
|
||||
{IrdaProtocolNEC, 0x71, 0x4A, false},
|
||||
{IrdaProtocolNEC, 0x71, 0x4A, false},
|
||||
{IrdaProtocolNEC42, 0x7B, 0x0, false},
|
||||
{IrdaProtocolNEC42, 0x7B, 0x0, false},
|
||||
{IrdaProtocolNEC42, 0x11C, 0x12, false},
|
||||
const InfraredMessage test_decoder_nec_expected3[] = {
|
||||
{InfraredProtocolNECext, 0x286, 0xB649, false},
|
||||
{InfraredProtocolNECext, 0x286, 0xB649, false},
|
||||
{InfraredProtocolNECext, 0x6880, 0xB649, false},
|
||||
{InfraredProtocolNECext, 0x6880, 0xB649, false},
|
||||
{InfraredProtocolNECext, 0x6380, 0x150F, false},
|
||||
{InfraredProtocolNECext, 0x6380, 0x150F, false},
|
||||
{InfraredProtocolNECext, 0x6480, 0x849, false},
|
||||
{InfraredProtocolNECext, 0x6480, 0x849, false},
|
||||
{InfraredProtocolNECext, 0x7A83, 0x8, false},
|
||||
{InfraredProtocolNECext, 0x7A83, 0x8, false},
|
||||
{InfraredProtocolNEC, 0x71, 0x4A, false},
|
||||
{InfraredProtocolNEC, 0x71, 0x4A, false},
|
||||
{InfraredProtocolNEC42, 0x7B, 0x0, false},
|
||||
{InfraredProtocolNEC42, 0x7B, 0x0, false},
|
||||
{InfraredProtocolNEC42, 0x11C, 0x12, false},
|
||||
};
|
||||
|
||||
|
||||
const IrdaMessage test_nec[] = {
|
||||
{IrdaProtocolNEC, 0x00, 0x00, false},
|
||||
{IrdaProtocolNEC, 0x01, 0x00, false},
|
||||
{IrdaProtocolNEC, 0x01, 0x80, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x80, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x00, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x00, true},
|
||||
{IrdaProtocolNEC, 0x00, 0x00, false},
|
||||
{IrdaProtocolNEC, 0x00, 0x00, true},
|
||||
{IrdaProtocolNEC, 0xFF, 0xFF, false},
|
||||
{IrdaProtocolNEC, 0xFE, 0xFF, false},
|
||||
{IrdaProtocolNEC, 0xFE, 0x7F, false},
|
||||
{IrdaProtocolNEC, 0xFF, 0x7F, false},
|
||||
{IrdaProtocolNEC, 0xFF, 0xFF, false},
|
||||
{IrdaProtocolNEC, 0xFF, 0xFF, true},
|
||||
{IrdaProtocolNEC, 0xAA, 0x55, false},
|
||||
{IrdaProtocolNEC, 0x55, 0xAA, false},
|
||||
{IrdaProtocolNEC, 0x55, 0x55, false},
|
||||
{IrdaProtocolNEC, 0xAA, 0xAA, false},
|
||||
{IrdaProtocolNEC, 0xAA, 0xAA, true},
|
||||
const InfraredMessage test_nec[] = {
|
||||
{InfraredProtocolNEC, 0x00, 0x00, false},
|
||||
{InfraredProtocolNEC, 0x01, 0x00, false},
|
||||
{InfraredProtocolNEC, 0x01, 0x80, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x80, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x00, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x00, true},
|
||||
{InfraredProtocolNEC, 0x00, 0x00, false},
|
||||
{InfraredProtocolNEC, 0x00, 0x00, true},
|
||||
{InfraredProtocolNEC, 0xFF, 0xFF, false},
|
||||
{InfraredProtocolNEC, 0xFE, 0xFF, false},
|
||||
{InfraredProtocolNEC, 0xFE, 0x7F, false},
|
||||
{InfraredProtocolNEC, 0xFF, 0x7F, false},
|
||||
{InfraredProtocolNEC, 0xFF, 0xFF, false},
|
||||
{InfraredProtocolNEC, 0xFF, 0xFF, true},
|
||||
{InfraredProtocolNEC, 0xAA, 0x55, false},
|
||||
{InfraredProtocolNEC, 0x55, 0xAA, false},
|
||||
{InfraredProtocolNEC, 0x55, 0x55, false},
|
||||
{InfraredProtocolNEC, 0xAA, 0xAA, false},
|
||||
{InfraredProtocolNEC, 0xAA, 0xAA, true},
|
||||
|
||||
{IrdaProtocolNEC, 0xAA, 0xAA, false},
|
||||
{IrdaProtocolNEC, 0xAA, 0xAA, true},
|
||||
{IrdaProtocolNEC, 0xAA, 0xAA, true},
|
||||
{InfraredProtocolNEC, 0xAA, 0xAA, false},
|
||||
{InfraredProtocolNEC, 0xAA, 0xAA, true},
|
||||
{InfraredProtocolNEC, 0xAA, 0xAA, true},
|
||||
|
||||
{IrdaProtocolNEC, 0x55, 0x55, false},
|
||||
{IrdaProtocolNEC, 0x55, 0x55, true},
|
||||
{IrdaProtocolNEC, 0x55, 0x55, true},
|
||||
{IrdaProtocolNEC, 0x55, 0x55, true},
|
||||
{InfraredProtocolNEC, 0x55, 0x55, false},
|
||||
{InfraredProtocolNEC, 0x55, 0x55, true},
|
||||
{InfraredProtocolNEC, 0x55, 0x55, true},
|
||||
{InfraredProtocolNEC, 0x55, 0x55, true},
|
||||
};
|
||||
|
||||
const IrdaMessage test_nec42[] = {
|
||||
{IrdaProtocolNEC42, 0x0000, 0x00, false},
|
||||
{IrdaProtocolNEC42, 0x0001, 0x00, false},
|
||||
{IrdaProtocolNEC42, 0x0001, 0x80, false},
|
||||
{IrdaProtocolNEC42, 0x0000, 0x80, false},
|
||||
{IrdaProtocolNEC42, 0x0000, 0x00, false},
|
||||
{IrdaProtocolNEC42, 0x0000, 0x00, true},
|
||||
{IrdaProtocolNEC42, 0x0000, 0x00, false},
|
||||
{IrdaProtocolNEC42, 0x0000, 0x00, true},
|
||||
{IrdaProtocolNEC42, 0x1FFF, 0xFF, false},
|
||||
{IrdaProtocolNEC42, 0x1FFE, 0xFF, false},
|
||||
{IrdaProtocolNEC42, 0x1FFE, 0x7F, false},
|
||||
{IrdaProtocolNEC42, 0x1FFF, 0x7F, false},
|
||||
{IrdaProtocolNEC42, 0x1FFF, 0xFF, false},
|
||||
{IrdaProtocolNEC42, 0x1FFF, 0xFF, true},
|
||||
{IrdaProtocolNEC42, 0x0AAA, 0x55, false},
|
||||
{IrdaProtocolNEC42, 0x1555, 0xAA, false},
|
||||
{IrdaProtocolNEC42, 0x1555, 0x55, false},
|
||||
{IrdaProtocolNEC42, 0x0AAA, 0xAA, false},
|
||||
{IrdaProtocolNEC42, 0x0AAA, 0xAA, true},
|
||||
{IrdaProtocolNEC42, 0x0AAA, 0xAA, false},
|
||||
{IrdaProtocolNEC42, 0x0AAA, 0xAA, true},
|
||||
{IrdaProtocolNEC42, 0x0AAA, 0xAA, true},
|
||||
{IrdaProtocolNEC42, 0x1555, 0x55, false},
|
||||
{IrdaProtocolNEC42, 0x1555, 0x55, true},
|
||||
{IrdaProtocolNEC42, 0x1555, 0x55, true},
|
||||
{IrdaProtocolNEC42, 0x1555, 0x55, true},
|
||||
const InfraredMessage test_nec42[] = {
|
||||
{InfraredProtocolNEC42, 0x0000, 0x00, false},
|
||||
{InfraredProtocolNEC42, 0x0001, 0x00, false},
|
||||
{InfraredProtocolNEC42, 0x0001, 0x80, false},
|
||||
{InfraredProtocolNEC42, 0x0000, 0x80, false},
|
||||
{InfraredProtocolNEC42, 0x0000, 0x00, false},
|
||||
{InfraredProtocolNEC42, 0x0000, 0x00, true},
|
||||
{InfraredProtocolNEC42, 0x0000, 0x00, false},
|
||||
{InfraredProtocolNEC42, 0x0000, 0x00, true},
|
||||
{InfraredProtocolNEC42, 0x1FFF, 0xFF, false},
|
||||
{InfraredProtocolNEC42, 0x1FFE, 0xFF, false},
|
||||
{InfraredProtocolNEC42, 0x1FFE, 0x7F, false},
|
||||
{InfraredProtocolNEC42, 0x1FFF, 0x7F, false},
|
||||
{InfraredProtocolNEC42, 0x1FFF, 0xFF, false},
|
||||
{InfraredProtocolNEC42, 0x1FFF, 0xFF, true},
|
||||
{InfraredProtocolNEC42, 0x0AAA, 0x55, false},
|
||||
{InfraredProtocolNEC42, 0x1555, 0xAA, false},
|
||||
{InfraredProtocolNEC42, 0x1555, 0x55, false},
|
||||
{InfraredProtocolNEC42, 0x0AAA, 0xAA, false},
|
||||
{InfraredProtocolNEC42, 0x0AAA, 0xAA, true},
|
||||
{InfraredProtocolNEC42, 0x0AAA, 0xAA, false},
|
||||
{InfraredProtocolNEC42, 0x0AAA, 0xAA, true},
|
||||
{InfraredProtocolNEC42, 0x0AAA, 0xAA, true},
|
||||
{InfraredProtocolNEC42, 0x1555, 0x55, false},
|
||||
{InfraredProtocolNEC42, 0x1555, 0x55, true},
|
||||
{InfraredProtocolNEC42, 0x1555, 0x55, true},
|
||||
{InfraredProtocolNEC42, 0x1555, 0x55, true},
|
||||
};
|
||||
|
||||
const IrdaMessage test_nec42ext[] = {
|
||||
{IrdaProtocolNEC42ext, 0x0000000, 0x0000, false},
|
||||
{IrdaProtocolNEC42ext, 0x0000001, 0x0000, false},
|
||||
{IrdaProtocolNEC42ext, 0x0000001, 0x8000, false},
|
||||
{IrdaProtocolNEC42ext, 0x0000000, 0x8000, false},
|
||||
{IrdaProtocolNEC42ext, 0x0000000, 0x0000, false},
|
||||
{IrdaProtocolNEC42ext, 0x0000000, 0x0000, true},
|
||||
{IrdaProtocolNEC42ext, 0x0000000, 0x0000, false},
|
||||
{IrdaProtocolNEC42ext, 0x0000000, 0x0000, true},
|
||||
{IrdaProtocolNEC42ext, 0x3F000FF, 0xF00F, false},
|
||||
{IrdaProtocolNEC42ext, 0x3F000FE, 0xF00F, false},
|
||||
{IrdaProtocolNEC42ext, 0x3F000FE, 0x700F, false},
|
||||
{IrdaProtocolNEC42ext, 0x3F000FF, 0x700F, false},
|
||||
{IrdaProtocolNEC42ext, 0x3F000FF, 0xF00F, false},
|
||||
{IrdaProtocolNEC42ext, 0x3F000FF, 0xF00F, true},
|
||||
{IrdaProtocolNEC42ext, 0x2AAAAAA, 0x5555, false},
|
||||
{IrdaProtocolNEC42ext, 0x1555555, 0xAAAA, false},
|
||||
{IrdaProtocolNEC42ext, 0x1555555, 0x5555, false},
|
||||
{IrdaProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, false},
|
||||
{IrdaProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, true},
|
||||
{IrdaProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, false},
|
||||
{IrdaProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, true},
|
||||
{IrdaProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, true},
|
||||
{IrdaProtocolNEC42ext, 0x1555555, 0x5555, false},
|
||||
{IrdaProtocolNEC42ext, 0x1555555, 0x5555, true},
|
||||
{IrdaProtocolNEC42ext, 0x1555555, 0x5555, true},
|
||||
{IrdaProtocolNEC42ext, 0x1555555, 0x5555, true},
|
||||
const InfraredMessage test_nec42ext[] = {
|
||||
{InfraredProtocolNEC42ext, 0x0000000, 0x0000, false},
|
||||
{InfraredProtocolNEC42ext, 0x0000001, 0x0000, false},
|
||||
{InfraredProtocolNEC42ext, 0x0000001, 0x8000, false},
|
||||
{InfraredProtocolNEC42ext, 0x0000000, 0x8000, false},
|
||||
{InfraredProtocolNEC42ext, 0x0000000, 0x0000, false},
|
||||
{InfraredProtocolNEC42ext, 0x0000000, 0x0000, true},
|
||||
{InfraredProtocolNEC42ext, 0x0000000, 0x0000, false},
|
||||
{InfraredProtocolNEC42ext, 0x0000000, 0x0000, true},
|
||||
{InfraredProtocolNEC42ext, 0x3F000FF, 0xF00F, false},
|
||||
{InfraredProtocolNEC42ext, 0x3F000FE, 0xF00F, false},
|
||||
{InfraredProtocolNEC42ext, 0x3F000FE, 0x700F, false},
|
||||
{InfraredProtocolNEC42ext, 0x3F000FF, 0x700F, false},
|
||||
{InfraredProtocolNEC42ext, 0x3F000FF, 0xF00F, false},
|
||||
{InfraredProtocolNEC42ext, 0x3F000FF, 0xF00F, true},
|
||||
{InfraredProtocolNEC42ext, 0x2AAAAAA, 0x5555, false},
|
||||
{InfraredProtocolNEC42ext, 0x1555555, 0xAAAA, false},
|
||||
{InfraredProtocolNEC42ext, 0x1555555, 0x5555, false},
|
||||
{InfraredProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, false},
|
||||
{InfraredProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, true},
|
||||
{InfraredProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, false},
|
||||
{InfraredProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, true},
|
||||
{InfraredProtocolNEC42ext, 0x2AAAAAA, 0xAAAA, true},
|
||||
{InfraredProtocolNEC42ext, 0x1555555, 0x5555, false},
|
||||
{InfraredProtocolNEC42ext, 0x1555555, 0x5555, true},
|
||||
{InfraredProtocolNEC42ext, 0x1555555, 0x5555, true},
|
||||
{InfraredProtocolNEC42ext, 0x1555555, 0x5555, true},
|
||||
};
|
||||
|
||||
const uint32_t test_decoder_nec42ext_input1[] = {
|
||||
|
@ -331,11 +331,11 @@ const uint32_t test_decoder_nec42ext_input2[] = {
|
|||
560, 560, 560, 560, 560, 10000, 560, // 42 OK + 1 failed
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_nec42ext_expected1[] = {
|
||||
{IrdaProtocolNEC42ext, 0x00, 0, false},
|
||||
const InfraredMessage test_decoder_nec42ext_expected1[] = {
|
||||
{InfraredProtocolNEC42ext, 0x00, 0, false},
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_nec42ext_expected2[] = {
|
||||
{IrdaProtocolNEC42ext, 0x00, 0, false},
|
||||
const InfraredMessage test_decoder_nec42ext_expected2[] = {
|
||||
{InfraredProtocolNEC42ext, 0x00, 0, false},
|
||||
};
|
||||
|
|
@ -110,146 +110,146 @@ const uint32_t test_decoder_necext_input1[] = {
|
|||
261924, 8965, 4465, 585, 529, 588, 525, 592, 1638, 588, 525, 592, 523, 584, 530, 587, 526, 591, 1639, 587, 1642, 583, 529, 587, 527, 590, 1639, 587, 1643, 584, 1646, 590,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_necext_expected1[] = {
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, false},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
{IrdaProtocolNECext, 0x7984, 0xed12, true},
|
||||
const InfraredMessage test_decoder_necext_expected1[] = {
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, false},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
{InfraredProtocolNECext, 0x7984, 0xed12, true},
|
||||
};
|
||||
|
||||
const IrdaMessage test_necext[] = {
|
||||
{IrdaProtocolNECext, 0x0000, 0x0000, false},
|
||||
{IrdaProtocolNECext, 0x0001, 0x0000, false},
|
||||
{IrdaProtocolNECext, 0x0001, 0x8000, false},
|
||||
{IrdaProtocolNECext, 0x0000, 0x8000, false},
|
||||
{IrdaProtocolNECext, 0x0000, 0x0000, false},
|
||||
{IrdaProtocolNECext, 0x0000, 0x0000, true},
|
||||
{IrdaProtocolNECext, 0x0000, 0x0000, false},
|
||||
{IrdaProtocolNECext, 0x0000, 0x0000, true},
|
||||
{IrdaProtocolNECext, 0xFFFF, 0xFFFF, false},
|
||||
{IrdaProtocolNECext, 0xFFFE, 0xFFFF, false},
|
||||
{IrdaProtocolNECext, 0xFFFE, 0x7FFF, false},
|
||||
{IrdaProtocolNECext, 0xFFFF, 0x7FFF, false},
|
||||
{IrdaProtocolNECext, 0xFFFF, 0xFFFF, false},
|
||||
{IrdaProtocolNECext, 0xFFFF, 0xFFFF, true},
|
||||
{IrdaProtocolNECext, 0xAAAA, 0x5555, false},
|
||||
{IrdaProtocolNECext, 0x5555, 0xAAAA, false},
|
||||
{IrdaProtocolNECext, 0x5555, 0x5555, false},
|
||||
{IrdaProtocolNECext, 0xAAAA, 0xAAAA, false},
|
||||
{IrdaProtocolNECext, 0xAAAA, 0xAAAA, true},
|
||||
const InfraredMessage test_necext[] = {
|
||||
{InfraredProtocolNECext, 0x0000, 0x0000, false},
|
||||
{InfraredProtocolNECext, 0x0001, 0x0000, false},
|
||||
{InfraredProtocolNECext, 0x0001, 0x8000, false},
|
||||
{InfraredProtocolNECext, 0x0000, 0x8000, false},
|
||||
{InfraredProtocolNECext, 0x0000, 0x0000, false},
|
||||
{InfraredProtocolNECext, 0x0000, 0x0000, true},
|
||||
{InfraredProtocolNECext, 0x0000, 0x0000, false},
|
||||
{InfraredProtocolNECext, 0x0000, 0x0000, true},
|
||||
{InfraredProtocolNECext, 0xFFFF, 0xFFFF, false},
|
||||
{InfraredProtocolNECext, 0xFFFE, 0xFFFF, false},
|
||||
{InfraredProtocolNECext, 0xFFFE, 0x7FFF, false},
|
||||
{InfraredProtocolNECext, 0xFFFF, 0x7FFF, false},
|
||||
{InfraredProtocolNECext, 0xFFFF, 0xFFFF, false},
|
||||
{InfraredProtocolNECext, 0xFFFF, 0xFFFF, true},
|
||||
{InfraredProtocolNECext, 0xAAAA, 0x5555, false},
|
||||
{InfraredProtocolNECext, 0x5555, 0xAAAA, false},
|
||||
{InfraredProtocolNECext, 0x5555, 0x5555, false},
|
||||
{InfraredProtocolNECext, 0xAAAA, 0xAAAA, false},
|
||||
{InfraredProtocolNECext, 0xAAAA, 0xAAAA, true},
|
||||
|
||||
{IrdaProtocolNECext, 0xAAAA, 0xAAAA, false},
|
||||
{IrdaProtocolNECext, 0xAAAA, 0xAAAA, true},
|
||||
{IrdaProtocolNECext, 0xAAAA, 0xAAAA, true},
|
||||
{InfraredProtocolNECext, 0xAAAA, 0xAAAA, false},
|
||||
{InfraredProtocolNECext, 0xAAAA, 0xAAAA, true},
|
||||
{InfraredProtocolNECext, 0xAAAA, 0xAAAA, true},
|
||||
|
||||
{IrdaProtocolNECext, 0x5555, 0x5555, false},
|
||||
{IrdaProtocolNECext, 0x5555, 0x5555, true},
|
||||
{IrdaProtocolNECext, 0x5555, 0x5555, true},
|
||||
{IrdaProtocolNECext, 0x5555, 0x5555, true},
|
||||
{InfraredProtocolNECext, 0x5555, 0x5555, false},
|
||||
{InfraredProtocolNECext, 0x5555, 0x5555, true},
|
||||
{InfraredProtocolNECext, 0x5555, 0x5555, true},
|
||||
{InfraredProtocolNECext, 0x5555, 0x5555, true},
|
||||
};
|
||||
|
||||
|
|
@ -8,8 +8,8 @@ const uint32_t test_decoder_rc5x_input1[] = {
|
|||
27000 + 888, 1776, 888, 888, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 888, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5x_expected1[] = {
|
||||
{IrdaProtocolRC5X, 0x13, 0x10, false}, // toggle 0
|
||||
const InfraredMessage test_decoder_rc5x_expected1[] = {
|
||||
{InfraredProtocolRC5X, 0x13, 0x10, false}, // toggle 0
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -22,8 +22,8 @@ const uint32_t test_decoder_rc5_input1[] = {
|
|||
27000 + 888, 888, 888, 1776, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 888, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected1[] = {
|
||||
{IrdaProtocolRC5, 0x13, 0x10, false}, // toggle 0
|
||||
const InfraredMessage test_decoder_rc5_expected1[] = {
|
||||
{InfraredProtocolRC5, 0x13, 0x10, false}, // toggle 0
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,8 +37,8 @@ const uint32_t test_decoder_rc5_input2[] = {
|
|||
27000 + 888, 888, 888, 888, 888, 888, 888, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 888, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected2[] = {
|
||||
{IrdaProtocolRC5, 0x13, 0x10, false}, // toggle 1
|
||||
const InfraredMessage test_decoder_rc5_expected2[] = {
|
||||
{InfraredProtocolRC5, 0x13, 0x10, false}, // toggle 1
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -51,8 +51,8 @@ const uint32_t test_decoder_rc5_input3[] = {
|
|||
27000 + 888, 888, 888, 1776, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected3[] = {
|
||||
{IrdaProtocolRC5, 0x13, 0x11, false}, // toggle 0
|
||||
const InfraredMessage test_decoder_rc5_expected3[] = {
|
||||
{InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 0
|
||||
};
|
||||
|
||||
|
||||
|
@ -66,8 +66,8 @@ const uint32_t test_decoder_rc5_input4[] = {
|
|||
27000 + 888, 888, 888, 888, 888, 888, 888, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected4[] = {
|
||||
{IrdaProtocolRC5, 0x13, 0x11, false}, // toggle 1
|
||||
const InfraredMessage test_decoder_rc5_expected4[] = {
|
||||
{InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 1
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -80,8 +80,8 @@ const uint32_t test_decoder_rc5_input5[] = {
|
|||
27000 + 888, 888, 888, 1776, 1776, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected5[] = {
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, false}, // toggle 0
|
||||
const InfraredMessage test_decoder_rc5_expected5[] = {
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, false}, // toggle 0
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -94,8 +94,8 @@ const uint32_t test_decoder_rc5_input6[] = {
|
|||
27000 + 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected6[] = {
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, false}, // toggle 1
|
||||
const InfraredMessage test_decoder_rc5_expected6[] = {
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, false}, // toggle 1
|
||||
};
|
||||
|
||||
|
||||
|
@ -113,48 +113,48 @@ const uint32_t test_decoder_rc5_input_all_repeats[] = {
|
|||
27000 + 888, 888, 888, 1776, 1776, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc5_expected_all_repeats[] = {
|
||||
{IrdaProtocolRC5, 0x13, 0x11, false}, // toggle 0
|
||||
{IrdaProtocolRC5, 0x13, 0x11, false}, // toggle 1
|
||||
{IrdaProtocolRC5, 0x13, 0x11, true}, // toggle 1
|
||||
{IrdaProtocolRC5, 0x13, 0x11, true}, // toggle 1
|
||||
{IrdaProtocolRC5, 0x13, 0x11, false}, // toggle 0
|
||||
{IrdaProtocolRC5, 0x13, 0x10, false}, // toggle 1
|
||||
{IrdaProtocolRC5, 0x13, 0x10, false}, // toggle 0
|
||||
{IrdaProtocolRC5, 0x13, 0x10, true}, // toggle 0
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, false}, // toggle 1
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, false}, // toggle 0
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, true}, // toggle 0
|
||||
const InfraredMessage test_decoder_rc5_expected_all_repeats[] = {
|
||||
{InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 0
|
||||
{InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 1
|
||||
{InfraredProtocolRC5, 0x13, 0x11, true}, // toggle 1
|
||||
{InfraredProtocolRC5, 0x13, 0x11, true}, // toggle 1
|
||||
{InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 0
|
||||
{InfraredProtocolRC5, 0x13, 0x10, false}, // toggle 1
|
||||
{InfraredProtocolRC5, 0x13, 0x10, false}, // toggle 0
|
||||
{InfraredProtocolRC5, 0x13, 0x10, true}, // toggle 0
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, false}, // toggle 1
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, false}, // toggle 0
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, true}, // toggle 0
|
||||
};
|
||||
|
||||
|
||||
const IrdaMessage test_rc5[] = {
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, false},
|
||||
{IrdaProtocolRC5, 0x00, 0x00, false},
|
||||
{IrdaProtocolRC5, 0x10, 0x01, false},
|
||||
{IrdaProtocolRC5, 0x01, 0x20, false},
|
||||
{IrdaProtocolRC5, 0x01, 0x20, false},
|
||||
{IrdaProtocolRC5, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5, 0x1F, 0x3F, false},
|
||||
{IrdaProtocolRC5, 0x0A, 0x2A, false},
|
||||
{IrdaProtocolRC5, 0x15, 0x15, false},
|
||||
{IrdaProtocolRC5, 0x15, 0x15, true},
|
||||
const InfraredMessage test_rc5[] = {
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, false},
|
||||
{InfraredProtocolRC5, 0x00, 0x00, false},
|
||||
{InfraredProtocolRC5, 0x10, 0x01, false},
|
||||
{InfraredProtocolRC5, 0x01, 0x20, false},
|
||||
{InfraredProtocolRC5, 0x01, 0x20, false},
|
||||
{InfraredProtocolRC5, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5, 0x1F, 0x3F, false},
|
||||
{InfraredProtocolRC5, 0x0A, 0x2A, false},
|
||||
{InfraredProtocolRC5, 0x15, 0x15, false},
|
||||
{InfraredProtocolRC5, 0x15, 0x15, true},
|
||||
|
||||
{IrdaProtocolRC5X, 0x1F, 0x3F, false},
|
||||
{IrdaProtocolRC5X, 0x00, 0x00, false},
|
||||
{IrdaProtocolRC5X, 0x10, 0x01, false},
|
||||
{IrdaProtocolRC5X, 0x01, 0x20, false},
|
||||
{IrdaProtocolRC5X, 0x01, 0x20, false},
|
||||
{IrdaProtocolRC5X, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5X, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5X, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5X, 0x01, 0x20, true},
|
||||
{IrdaProtocolRC5X, 0x1F, 0x3F, false},
|
||||
{IrdaProtocolRC5X, 0x0A, 0x2A, false},
|
||||
{IrdaProtocolRC5X, 0x15, 0x15, false},
|
||||
{IrdaProtocolRC5X, 0x15, 0x15, true},
|
||||
{InfraredProtocolRC5X, 0x1F, 0x3F, false},
|
||||
{InfraredProtocolRC5X, 0x00, 0x00, false},
|
||||
{InfraredProtocolRC5X, 0x10, 0x01, false},
|
||||
{InfraredProtocolRC5X, 0x01, 0x20, false},
|
||||
{InfraredProtocolRC5X, 0x01, 0x20, false},
|
||||
{InfraredProtocolRC5X, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5X, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5X, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5X, 0x01, 0x20, true},
|
||||
{InfraredProtocolRC5X, 0x1F, 0x3F, false},
|
||||
{InfraredProtocolRC5X, 0x0A, 0x2A, false},
|
||||
{InfraredProtocolRC5X, 0x15, 0x15, false},
|
||||
{InfraredProtocolRC5X, 0x15, 0x15, true},
|
||||
};
|
||||
|
|
@ -79,28 +79,28 @@ const uint32_t test_decoder_rc6_input1[] = {
|
|||
27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_rc6_expected1[] = {
|
||||
{IrdaProtocolRC6, 0x94, 0xA0, false}, // toggle 0
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 1
|
||||
// {IrdaProtocolRC6, 0x95, 0xA0, false}, failed
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 0
|
||||
{IrdaProtocolRC6, 0x94, 0xA0, false}, // toggle 1
|
||||
{IrdaProtocolRC6, 0x95, 0xA0, false}, // toggle 0
|
||||
// {IrdaProtocolRC6, 0x93, 0xA0, false}, failed
|
||||
// {IrdaProtocolRC6, 0x93, 0xA0, false}, failed
|
||||
// {IrdaProtocolRC6, 0x93, 0xA0, false}, failed
|
||||
{IrdaProtocolRC6, 0x95, 0xA0, false}, // toggle 1
|
||||
const InfraredMessage test_decoder_rc6_expected1[] = {
|
||||
{InfraredProtocolRC6, 0x94, 0xA0, false}, // toggle 0
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, false}, // toggle 1
|
||||
// {InfraredProtocolRC6, 0x95, 0xA0, false}, failed
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, false}, // toggle 0
|
||||
{InfraredProtocolRC6, 0x94, 0xA0, false}, // toggle 1
|
||||
{InfraredProtocolRC6, 0x95, 0xA0, false}, // toggle 0
|
||||
// {InfraredProtocolRC6, 0x93, 0xA0, false}, failed
|
||||
// {InfraredProtocolRC6, 0x93, 0xA0, false}, failed
|
||||
// {InfraredProtocolRC6, 0x93, 0xA0, false}, failed
|
||||
{InfraredProtocolRC6, 0x95, 0xA0, false}, // toggle 1
|
||||
};
|
||||
|
||||
const IrdaMessage test_encoder_rc6_input1[] = {
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, false}, // Toggle 0
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, true}, // Toggle 0
|
||||
{IrdaProtocolRC6, 0x93, 0xA1, false}, // Toggle 1
|
||||
{IrdaProtocolRC6, 0x93, 0xA1, true}, // Toggle 1
|
||||
{IrdaProtocolRC6, 0x93, 0xA1, true}, // Toggle 1
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, false}, // Toggle 0
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, false}, // Toggle 1
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, true}, // Toggle 1
|
||||
const InfraredMessage test_encoder_rc6_input1[] = {
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, false}, // Toggle 0
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, true}, // Toggle 0
|
||||
{InfraredProtocolRC6, 0x93, 0xA1, false}, // Toggle 1
|
||||
{InfraredProtocolRC6, 0x93, 0xA1, true}, // Toggle 1
|
||||
{InfraredProtocolRC6, 0x93, 0xA1, true}, // Toggle 1
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, false}, // Toggle 0
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, false}, // Toggle 1
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, true}, // Toggle 1
|
||||
};
|
||||
|
||||
const uint32_t test_encoder_rc6_expected1[] = {
|
||||
|
@ -115,48 +115,48 @@ const uint32_t test_encoder_rc6_expected1[] = {
|
|||
};
|
||||
|
||||
|
||||
const IrdaMessage test_rc6[] = {
|
||||
{IrdaProtocolRC6, 0x00, 0x00, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x80, 0x00, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x80, 0x01, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x00, 0x01, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x00, 0x00, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x00, 0x00, true}, // t 0
|
||||
{IrdaProtocolRC6, 0x00, 0x00, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x00, 0x00, true}, // t 1
|
||||
{IrdaProtocolRC6, 0xFF, 0xFF, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x7F, 0xFF, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x7F, 0xFE, false}, // t 0
|
||||
{IrdaProtocolRC6, 0xFF, 0xFE, false}, // t 1
|
||||
{IrdaProtocolRC6, 0xFF, 0xFF, false}, // t 0
|
||||
{IrdaProtocolRC6, 0xFF, 0xFF, true}, // t 0
|
||||
{IrdaProtocolRC6, 0xAA, 0x55, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x55, 0xAA, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x55, 0x55, false}, // t 1
|
||||
{IrdaProtocolRC6, 0xAA, 0xAA, false}, // t 0
|
||||
{IrdaProtocolRC6, 0xAA, 0xAA, true}, // t 0
|
||||
const InfraredMessage test_rc6[] = {
|
||||
{InfraredProtocolRC6, 0x00, 0x00, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x80, 0x00, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x80, 0x01, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x00, 0x01, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x00, 0x00, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x00, 0x00, true}, // t 0
|
||||
{InfraredProtocolRC6, 0x00, 0x00, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x00, 0x00, true}, // t 1
|
||||
{InfraredProtocolRC6, 0xFF, 0xFF, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x7F, 0xFF, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x7F, 0xFE, false}, // t 0
|
||||
{InfraredProtocolRC6, 0xFF, 0xFE, false}, // t 1
|
||||
{InfraredProtocolRC6, 0xFF, 0xFF, false}, // t 0
|
||||
{InfraredProtocolRC6, 0xFF, 0xFF, true}, // t 0
|
||||
{InfraredProtocolRC6, 0xAA, 0x55, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x55, 0xAA, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x55, 0x55, false}, // t 1
|
||||
{InfraredProtocolRC6, 0xAA, 0xAA, false}, // t 0
|
||||
{InfraredProtocolRC6, 0xAA, 0xAA, true}, // t 0
|
||||
// same with inverted toggle bit
|
||||
{IrdaProtocolRC6, 0x00, 0x00, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x80, 0x00, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x80, 0x01, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x00, 0x01, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x00, 0x00, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x00, 0x00, true}, // t 1
|
||||
{IrdaProtocolRC6, 0x00, 0x00, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x00, 0x00, true}, // t 0
|
||||
{IrdaProtocolRC6, 0xFF, 0xFF, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x7F, 0xFF, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x7F, 0xFE, false}, // t 1
|
||||
{IrdaProtocolRC6, 0xFF, 0xFE, false}, // t 0
|
||||
{IrdaProtocolRC6, 0xFF, 0xFF, false}, // t 1
|
||||
{IrdaProtocolRC6, 0xFF, 0xFF, true}, // t 1
|
||||
{IrdaProtocolRC6, 0xAA, 0x55, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x55, 0xAA, false}, // t 1
|
||||
{IrdaProtocolRC6, 0x55, 0x55, false}, // t 0
|
||||
{IrdaProtocolRC6, 0xAA, 0xAA, false}, // t 1
|
||||
{IrdaProtocolRC6, 0xAA, 0xAA, true}, // t 1
|
||||
{InfraredProtocolRC6, 0x00, 0x00, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x80, 0x00, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x80, 0x01, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x00, 0x01, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x00, 0x00, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x00, 0x00, true}, // t 1
|
||||
{InfraredProtocolRC6, 0x00, 0x00, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x00, 0x00, true}, // t 0
|
||||
{InfraredProtocolRC6, 0xFF, 0xFF, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x7F, 0xFF, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x7F, 0xFE, false}, // t 1
|
||||
{InfraredProtocolRC6, 0xFF, 0xFE, false}, // t 0
|
||||
{InfraredProtocolRC6, 0xFF, 0xFF, false}, // t 1
|
||||
{InfraredProtocolRC6, 0xFF, 0xFF, true}, // t 1
|
||||
{InfraredProtocolRC6, 0xAA, 0x55, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x55, 0xAA, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x55, 0x55, false}, // t 0
|
||||
{InfraredProtocolRC6, 0xAA, 0xAA, false}, // t 1
|
||||
{InfraredProtocolRC6, 0xAA, 0xAA, true}, // t 1
|
||||
|
||||
{IrdaProtocolRC6, 0x93, 0xA0, false}, // t 0
|
||||
{IrdaProtocolRC6, 0x93, 0xA1, false}, // t 1
|
||||
{InfraredProtocolRC6, 0x93, 0xA0, false}, // t 0
|
||||
{InfraredProtocolRC6, 0x93, 0xA1, false}, // t 1
|
||||
};
|
||||
|
|
@ -179,76 +179,76 @@ const uint32_t test_decoder_samsung32_input1[] = {
|
|||
532, 584,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_samsung32_expected1[] = {
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, false}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x81, false}, {IrdaProtocolSamsung32, 0x0E, 0x81, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x02, false}, {IrdaProtocolSamsung32, 0x0E, 0x02, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x03, false}, {IrdaProtocolSamsung32, 0x0E, 0x03, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, false}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, false}, {IrdaProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, false}, {IrdaProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, false}, {IrdaProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x0C, true}, {IrdaProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, true}, {IrdaProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, true}, {IrdaProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{IrdaProtocolSamsung32, 0x0E, 0x01, false}, {IrdaProtocolSamsung32, 0x0E, 0x01, true},
|
||||
const InfraredMessage test_decoder_samsung32_expected1[] = {
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, false}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x81, false}, {InfraredProtocolSamsung32, 0x0E, 0x81, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x02, false}, {InfraredProtocolSamsung32, 0x0E, 0x02, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x03, false}, {InfraredProtocolSamsung32, 0x0E, 0x03, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, false}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, false}, {InfraredProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, false}, {InfraredProtocolSamsung32, 0x0E, 0x0C, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, false}, {InfraredProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x0C, true}, {InfraredProtocolSamsung32, 0x0E, 0x0C, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, true},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, true}, {InfraredProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, true}, {InfraredProtocolSamsung32, 0x0E, 0x01, false},
|
||||
{InfraredProtocolSamsung32, 0x0E, 0x01, false}, {InfraredProtocolSamsung32, 0x0E, 0x01, true},
|
||||
};
|
||||
|
||||
const IrdaMessage test_samsung32[] = {
|
||||
{IrdaProtocolSamsung32, 0x00, 0x00, false},
|
||||
{IrdaProtocolSamsung32, 0x01, 0x00, false},
|
||||
{IrdaProtocolSamsung32, 0x01, 0x80, false},
|
||||
{IrdaProtocolSamsung32, 0x00, 0x80, false},
|
||||
{IrdaProtocolSamsung32, 0x00, 0x00, false},
|
||||
{IrdaProtocolSamsung32, 0x00, 0x00, true},
|
||||
{IrdaProtocolSamsung32, 0x00, 0x00, false},
|
||||
{IrdaProtocolSamsung32, 0x00, 0x00, true},
|
||||
{IrdaProtocolSamsung32, 0xFF, 0xFF, false},
|
||||
{IrdaProtocolSamsung32, 0xFE, 0xFF, false},
|
||||
{IrdaProtocolSamsung32, 0xFE, 0x7F, false},
|
||||
{IrdaProtocolSamsung32, 0xFF, 0x7F, false},
|
||||
{IrdaProtocolSamsung32, 0xFF, 0xFF, false},
|
||||
{IrdaProtocolSamsung32, 0xFF, 0xFF, true},
|
||||
{IrdaProtocolSamsung32, 0xAA, 0x55, false},
|
||||
{IrdaProtocolSamsung32, 0x55, 0xAA, false},
|
||||
{IrdaProtocolSamsung32, 0x55, 0x55, false},
|
||||
{IrdaProtocolSamsung32, 0xAA, 0xAA, false},
|
||||
{IrdaProtocolSamsung32, 0xAA, 0xAA, true},
|
||||
const InfraredMessage test_samsung32[] = {
|
||||
{InfraredProtocolSamsung32, 0x00, 0x00, false},
|
||||
{InfraredProtocolSamsung32, 0x01, 0x00, false},
|
||||
{InfraredProtocolSamsung32, 0x01, 0x80, false},
|
||||
{InfraredProtocolSamsung32, 0x00, 0x80, false},
|
||||
{InfraredProtocolSamsung32, 0x00, 0x00, false},
|
||||
{InfraredProtocolSamsung32, 0x00, 0x00, true},
|
||||
{InfraredProtocolSamsung32, 0x00, 0x00, false},
|
||||
{InfraredProtocolSamsung32, 0x00, 0x00, true},
|
||||
{InfraredProtocolSamsung32, 0xFF, 0xFF, false},
|
||||
{InfraredProtocolSamsung32, 0xFE, 0xFF, false},
|
||||
{InfraredProtocolSamsung32, 0xFE, 0x7F, false},
|
||||
{InfraredProtocolSamsung32, 0xFF, 0x7F, false},
|
||||
{InfraredProtocolSamsung32, 0xFF, 0xFF, false},
|
||||
{InfraredProtocolSamsung32, 0xFF, 0xFF, true},
|
||||
{InfraredProtocolSamsung32, 0xAA, 0x55, false},
|
||||
{InfraredProtocolSamsung32, 0x55, 0xAA, false},
|
||||
{InfraredProtocolSamsung32, 0x55, 0x55, false},
|
||||
{InfraredProtocolSamsung32, 0xAA, 0xAA, false},
|
||||
{InfraredProtocolSamsung32, 0xAA, 0xAA, true},
|
||||
|
||||
{IrdaProtocolSamsung32, 0xAA, 0xAA, false},
|
||||
{IrdaProtocolSamsung32, 0xAA, 0xAA, true},
|
||||
{IrdaProtocolSamsung32, 0xAA, 0xAA, true},
|
||||
{InfraredProtocolSamsung32, 0xAA, 0xAA, false},
|
||||
{InfraredProtocolSamsung32, 0xAA, 0xAA, true},
|
||||
{InfraredProtocolSamsung32, 0xAA, 0xAA, true},
|
||||
|
||||
{IrdaProtocolSamsung32, 0x55, 0x55, false},
|
||||
{IrdaProtocolSamsung32, 0x55, 0x55, true},
|
||||
{IrdaProtocolSamsung32, 0x55, 0x55, true},
|
||||
{IrdaProtocolSamsung32, 0x55, 0x55, true},
|
||||
{InfraredProtocolSamsung32, 0x55, 0x55, false},
|
||||
{InfraredProtocolSamsung32, 0x55, 0x55, true},
|
||||
{InfraredProtocolSamsung32, 0x55, 0x55, true},
|
||||
{InfraredProtocolSamsung32, 0x55, 0x55, true},
|
||||
};
|
||||
|
|
@ -124,128 +124,128 @@ const uint32_t test_decoder_sirc_input1[] = { /* 121 timings */
|
|||
26263, 2414, 611, 1192, 607, 544, 606, 1197, 602, 569, 606, 1197, 602, 539, 611, 540, 635, 1168, 606, 565, 610, 541, 608, 563, 587, 564,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_sirc_expected1[] = {
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x60, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x60, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x60, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x65, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x65, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x65, false},
|
||||
{IrdaProtocolSIRC20, 0x410, 0x17, false},
|
||||
{IrdaProtocolSIRC20, 0x410, 0x17, false},
|
||||
{IrdaProtocolSIRC20, 0x410, 0x17, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x21, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x21, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x21, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7B, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7B, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7B, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x78, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x78, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x78, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x79, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x79, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x79, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7D, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7D, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x7D, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x73, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x73, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x73, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x13, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x13, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x13, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x13, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x12, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x12, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x12, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x12, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x30, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x30, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x30, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x39, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x39, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x39, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x31, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x31, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x31, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x34, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x34, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x34, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x32, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x32, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x32, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x33, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x33, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x33, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x0F, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x0F, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x0F, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x38, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x38, false},
|
||||
{IrdaProtocolSIRC20, 0x73A, 0x38, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x10, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x01, 0x2F, false},
|
||||
{IrdaProtocolSIRC, 0x01, 0x2F, false},
|
||||
{IrdaProtocolSIRC, 0x01, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x01, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x01, 0x15, false},
|
||||
{IrdaProtocolSIRC, 0x01, 0x15, false},
|
||||
const InfraredMessage test_decoder_sirc_expected1[] = {
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x60, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x60, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x60, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x65, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x65, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x65, false},
|
||||
{InfraredProtocolSIRC20, 0x410, 0x17, false},
|
||||
{InfraredProtocolSIRC20, 0x410, 0x17, false},
|
||||
{InfraredProtocolSIRC20, 0x410, 0x17, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x21, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x21, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x21, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7B, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7B, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7B, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x78, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x78, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x78, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x79, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x79, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x79, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7A, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7C, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7D, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7D, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x7D, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x73, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x73, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x73, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x13, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x13, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x13, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x13, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x12, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x12, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x12, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x12, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x30, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x30, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x30, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x39, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x39, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x39, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x31, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x31, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x31, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x34, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x34, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x34, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x32, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x32, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x32, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x33, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x33, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x33, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x0F, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x0F, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x0F, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x38, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x38, false},
|
||||
{InfraredProtocolSIRC20, 0x73A, 0x38, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x10, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x01, 0x2F, false},
|
||||
{InfraredProtocolSIRC, 0x01, 0x2F, false},
|
||||
{InfraredProtocolSIRC, 0x01, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x01, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x01, 0x15, false},
|
||||
{InfraredProtocolSIRC, 0x01, 0x15, false},
|
||||
};
|
||||
|
||||
|
||||
|
@ -284,23 +284,23 @@ const uint32_t test_decoder_sirc_input2[] = {
|
|||
1000000, 2400, 600, 1200, 600, 1200, 600, 600, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_sirc_expected2[] = {
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
const InfraredMessage test_decoder_sirc_expected2[] = {
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
/* failed - 13 data bits */
|
||||
|
||||
{IrdaProtocolSIRC, 0x1F, 0x7F, false},
|
||||
{InfraredProtocolSIRC, 0x1F, 0x7F, false},
|
||||
/* failed - 2 data bits */
|
||||
{IrdaProtocolSIRC, 0x1F, 0x7F, false},
|
||||
{InfraredProtocolSIRC, 0x1F, 0x7F, false},
|
||||
/* failed - sudden end */
|
||||
{IrdaProtocolSIRC, 0x1F, 0x7F, false},
|
||||
{InfraredProtocolSIRC, 0x1F, 0x7F, false},
|
||||
/* failed */
|
||||
{IrdaProtocolSIRC, 0x0A, 0x55, false},
|
||||
{InfraredProtocolSIRC, 0x0A, 0x55, false},
|
||||
|
||||
{IrdaProtocolSIRC, 0x00, 0x00, false},
|
||||
{InfraredProtocolSIRC, 0x00, 0x00, false},
|
||||
|
||||
{IrdaProtocolSIRC, 0x0D, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0x0D, 0x53, false},
|
||||
};
|
||||
|
||||
|
||||
|
@ -334,18 +334,18 @@ const uint32_t test_decoder_sirc_input3[] = {
|
|||
10000, 2400, 600, 1200, 600, 1200, 600, 600, 600, 600, 600, 1200, 600, 600, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_sirc_expected3[] = {
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0xFD, 0x13, false},
|
||||
const InfraredMessage test_decoder_sirc_expected3[] = {
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x0D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0xFD, 0x13, false},
|
||||
};
|
||||
|
||||
const uint32_t test_decoder_sirc_input4[] = {
|
||||
|
@ -357,13 +357,13 @@ const uint32_t test_decoder_sirc_input4[] = {
|
|||
1000000, 2400, 600, 1200, 600, 1200, 600, 600, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 600,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_sirc_expected4[] = {
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false}, // {IrdaProtocolSIRC20, 0x15, 0x3ED3, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
const InfraredMessage test_decoder_sirc_expected4[] = {
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false}, // {InfraredProtocolSIRC20, 0x15, 0x3ED3, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
};
|
||||
|
||||
const uint32_t test_decoder_sirc_input5[] = {
|
||||
|
@ -396,48 +396,48 @@ const uint32_t test_decoder_sirc_input5[] = {
|
|||
10000, 2400, 600, 1200, 600, 1200, 600, 600, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 600,
|
||||
};
|
||||
|
||||
const IrdaMessage test_decoder_sirc_expected5[] = {
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
const InfraredMessage test_decoder_sirc_expected5[] = {
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC20, 0xFB5, 0x53, false},
|
||||
};
|
||||
|
||||
const IrdaMessage test_encoder_sirc_input1[] = {
|
||||
{IrdaProtocolSIRC, 0xA, 0x55, false},
|
||||
const InfraredMessage test_encoder_sirc_input1[] = {
|
||||
{InfraredProtocolSIRC, 0xA, 0x55, false},
|
||||
};
|
||||
|
||||
const uint32_t test_encoder_sirc_expected1[] = {
|
||||
10000, 2400, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 600,
|
||||
};
|
||||
|
||||
const IrdaMessage test_encoder_sirc_input2[] = {
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, true},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, true},
|
||||
const InfraredMessage test_encoder_sirc_input2[] = {
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, true},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, true},
|
||||
};
|
||||
|
||||
const uint32_t test_encoder_sirc_expected2[] = {
|
||||
|
@ -446,34 +446,34 @@ const uint32_t test_encoder_sirc_expected2[] = {
|
|||
18600, 2400, 600, 1200, 600, 1200, 600, 600, 600, 600, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 600, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 600,
|
||||
};
|
||||
|
||||
const IrdaMessage test_sirc[] = {
|
||||
{IrdaProtocolSIRC20, 0x1FFF, 0x7F, false},
|
||||
{IrdaProtocolSIRC20, 0x1FFF, 0x7F, true},
|
||||
{IrdaProtocolSIRC20, 0x1FFF, 0x7F, true},
|
||||
{IrdaProtocolSIRC, 0x00, 0x00, false},
|
||||
{IrdaProtocolSIRC, 0x00, 0x00, true},
|
||||
{IrdaProtocolSIRC, 0x00, 0x00, true},
|
||||
const InfraredMessage test_sirc[] = {
|
||||
{InfraredProtocolSIRC20, 0x1FFF, 0x7F, false},
|
||||
{InfraredProtocolSIRC20, 0x1FFF, 0x7F, true},
|
||||
{InfraredProtocolSIRC20, 0x1FFF, 0x7F, true},
|
||||
{InfraredProtocolSIRC, 0x00, 0x00, false},
|
||||
{InfraredProtocolSIRC, 0x00, 0x00, true},
|
||||
{InfraredProtocolSIRC, 0x00, 0x00, true},
|
||||
|
||||
{IrdaProtocolSIRC, 0x1A, 0x22, false},
|
||||
{IrdaProtocolSIRC, 0x1A, 0x22, true},
|
||||
{IrdaProtocolSIRC, 0x1A, 0x22, true},
|
||||
{IrdaProtocolSIRC, 0x17, 0x0A, false},
|
||||
{InfraredProtocolSIRC, 0x1A, 0x22, false},
|
||||
{InfraredProtocolSIRC, 0x1A, 0x22, true},
|
||||
{InfraredProtocolSIRC, 0x1A, 0x22, true},
|
||||
{InfraredProtocolSIRC, 0x17, 0x0A, false},
|
||||
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, true},
|
||||
{IrdaProtocolSIRC15, 0x7D, 0x53, true},
|
||||
{IrdaProtocolSIRC15, 0x71, 0x0, false},
|
||||
{IrdaProtocolSIRC15, 0x15, 0x01, false},
|
||||
{IrdaProtocolSIRC15, 0x01, 0x15, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, false},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, true},
|
||||
{InfraredProtocolSIRC15, 0x7D, 0x53, true},
|
||||
{InfraredProtocolSIRC15, 0x71, 0x0, false},
|
||||
{InfraredProtocolSIRC15, 0x15, 0x01, false},
|
||||
{InfraredProtocolSIRC15, 0x01, 0x15, false},
|
||||
|
||||
{IrdaProtocolSIRC20, 0xAA, 0x55, false},
|
||||
{IrdaProtocolSIRC20, 0x331, 0x71, false},
|
||||
{InfraredProtocolSIRC20, 0xAA, 0x55, false},
|
||||
{InfraredProtocolSIRC20, 0x331, 0x71, false},
|
||||
|
||||
{IrdaProtocolSIRC, 0x00, 0x00, false},
|
||||
{IrdaProtocolSIRC, 0x1F, 0x7F, false},
|
||||
{IrdaProtocolSIRC15, 0x00, 0x00, false},
|
||||
{IrdaProtocolSIRC15, 0xFF, 0x7F, false},
|
||||
{IrdaProtocolSIRC20, 0x00, 0x00, false},
|
||||
{IrdaProtocolSIRC20, 0x1FFF, 0x7F, false},
|
||||
{InfraredProtocolSIRC, 0x00, 0x00, false},
|
||||
{InfraredProtocolSIRC, 0x1F, 0x7F, false},
|
||||
{InfraredProtocolSIRC15, 0x00, 0x00, false},
|
||||
{InfraredProtocolSIRC15, 0xFF, 0x7F, false},
|
||||
{InfraredProtocolSIRC20, 0x00, 0x00, false},
|
||||
{InfraredProtocolSIRC20, 0x1FFF, 0x7F, false},
|
||||
};
|
||||
|
|
@ -651,7 +651,7 @@ MU_TEST(test_storage_list) {
|
|||
|
||||
test_rpc_storage_list_run("/int", ++command_id);
|
||||
test_rpc_storage_list_run("/ext", ++command_id);
|
||||
test_rpc_storage_list_run("/ext/irda", ++command_id);
|
||||
test_rpc_storage_list_run("/ext/infrared", ++command_id);
|
||||
test_rpc_storage_list_run("/ext/ibutton", ++command_id);
|
||||
test_rpc_storage_list_run("/ext/lfrfid", ++command_id);
|
||||
test_rpc_storage_list_run("error_path", ++command_id);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#define TAG "UnitTests"
|
||||
|
||||
int run_minunit();
|
||||
int run_minunit_test_irda_decoder_encoder();
|
||||
int run_minunit_test_infrared_decoder_encoder();
|
||||
int run_minunit_test_rpc();
|
||||
int run_minunit_test_flipper_format();
|
||||
int run_minunit_test_flipper_format_string();
|
||||
|
@ -53,7 +53,7 @@ void unit_tests_cli(Cli* cli, string_t args, void* context) {
|
|||
uint32_t cycle_counter = DWT->CYCCNT;
|
||||
|
||||
test_result |= run_minunit();
|
||||
test_result |= run_minunit_test_irda_decoder_encoder();
|
||||
test_result |= run_minunit_test_infrared_decoder_encoder();
|
||||
test_result |= run_minunit_test_rpc();
|
||||
test_result |= run_minunit_test_stream();
|
||||
test_result |= run_minunit_test_flipper_format();
|
||||
|
|
|
@ -202,27 +202,6 @@ const uint8_t* const _I_ArrowUpEmpty_14x15[] = {_I_ArrowUpEmpty_14x15_0};
|
|||
const uint8_t _I_ArrowUpFilled_14x15_0[] = {0x00,0xC0,0x00,0x20,0x01,0xD0,0x02,0xE8,0x05,0xF4,0x0B,0xFA,0x17,0x61,0x21,0xAF,0x3D,0x68,0x05,0xA8,0x05,0x68,0x05,0xA8,0x05,0xE8,0x05,0x08,0x04,0xF8,0x07,};
|
||||
const uint8_t* const _I_ArrowUpFilled_14x15[] = {_I_ArrowUpFilled_14x15_0};
|
||||
|
||||
const uint8_t _I_Back3_45x8_0[] = {0x00,0x04,0x00,0x10,0x00,0x40,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x7F,0x00,0xFC,0x01,0xF0,0x07,0x86,0x20,0x18,0x82,0x60,0x08,0x04,0x71,0x10,0xC4,0x41,0x10,0x00,0x21,0x00,0x84,0x00,0x10,0x80,0x00,0x00,0x02,0x00,0x08,0x7E,0x00,0xF8,0x01,0xE0,0x07,};
|
||||
const uint8_t* const _I_Back3_45x8[] = {_I_Back3_45x8_0};
|
||||
|
||||
const uint8_t _I_DoorLeft_70x55_0[] = {0x01,0x00,0x19,0x01,0x00,0x2c,0x32,0x01,0x03,0x04,0x2c,0x18,0x10,0xf0,0x40,0x47,0x82,0x06,0x81,0x03,0xff,0x80,0x08,0x1a,0x20,0x82,0x15,0x28,0x21,0x87,0x82,0x08,0x6f,0xc0,0xb1,0xe6,0x10,0x10,0x8b,0x46,0x20,0x43,0x55,0x8f,0x82,0x10,0x32,0x73,0x0a,0x09,0x89,0x6c,0x1e,0x09,0x00,0x18,0x60,0xf0,0x0c,0x84,0x93,0x82,0x03,0x18,0x0c,0x02,0x1d,0x00,0x90,0x52,0x70,0x50,0x1e,0x00,0x58,0x63,0x90,0x0a,0x06,0x4a,0x09,0x03,0xb0,0x02,0x06,0x70,0x62,0x49,0xf8,0x0c,0x66,0x3f,0xf0,0x41,0x63,0x04,0x43,0x00,0x99,0x60,0x00,0x85,0xc8,0x06,0x14,0xd0,0x80,0x3f,0xc8,0x0d,0xb8,0x10,0x70,0xf8,0x34,0x13,0x03,0x39,0x04,0x1c,0x42,0x19,0xf8,0xa0,0xc2,0x01,0x07,0xef,0x02,0x8c,0x80,0x10,0x9d,0x00,0x43,0xec,0x00,0xa3,0x10,0x04,0x25,0xce,0x19,0xfc,0x88,0x82,0x12,0x0c,0x35,0x10,0x42,0x4c,0xa1,0x90,0x3f,0xc0,0x21,0x22,0x39,0x82,0xc8,0x88,0xd2,0x11,0xf0,0x01,0x88,0xd5,0x18,0xe2,0x08,0x68,0x10,0x0c,0xa8,0x00,0x83,0x81,0xcc,0xd5,0xc3,0x80,0x84,0x82,0x0e,0xcc,0xc0,0x15,0x79,0x02,0x0b,0x98,0xf8,0x11,0x88,0x82,0x0f,0x31,0x19,0x02,0x08,0x2c,0x9f,0x6a,0x1d,0x20,0x41,0x31,0x4c,0x10,0x8d,0x73,0x04,0x23,0xa4,0xc4,0x6c,0xde,0x20,0x42,0xcc,0x01,0x07,0x07,0xff,0x80,0x06,0x3e,0x08,0x38,0x70,0x20,0xa1,0xe0,0x83,0x8e,0x01,0x0c,0xf0,0x73,0x80,0x43,0x70,0x05,0x08,0x00,0x2c,0x04,0xc4,0x46,0x53,0x09,0x98,0x24,0x80,0x65,0x80,0xb0,0xd9,0x84,0x65,0x32,0x06,0x17,0x0f,0x98,0x23,0x63,0xe1,0x88,0xc4,0x08,0x5f,0xc1,0x30,0x9d,0x84,0x4e,0x66,0x94,0x11,0x98,0x75,0x26,0x00,};
|
||||
const uint8_t* const _I_DoorLeft_70x55[] = {_I_DoorLeft_70x55_0};
|
||||
|
||||
const uint8_t _I_DoorLocked_10x56_0[] = {0x01,0x00,0x4e,0x00,0x86,0x40,0x25,0xb0,0x0b,0x6c,0x03,0x9b,0x00,0xc6,0xc0,0x65,0x90,0x10,0x3a,0xc3,0x20,0x31,0xc8,0x04,0xe2,0x01,0x70,0x80,0x78,0x20,0x1c,0x48,0x07,0x22,0x01,0xd0,0x00,0xf0,0x44,0x68,0x90,0x09,0x04,0x02,0x21,0x00,0x84,0x40,0x25,0x80,0x12,0x1e,0x88,0x14,0xc0,0x2e,0x0d,0x11,0xca,0xf8,0x60,0x1c,0x38,0x07,0x1a,0x05,0xcc,0x80,0x72,0x60,0x5c,0x38,0x10,0x1c,0xf9,0x10,0x2e,0x00,0x05,0x60,0x00,0x11,};
|
||||
const uint8_t* const _I_DoorLocked_10x56[] = {_I_DoorLocked_10x56_0};
|
||||
|
||||
const uint8_t _I_DoorRight_70x55_0[] = {0x01,0x00,0x16,0x01,0x81,0xcc,0x01,0x0f,0x60,0x04,0x3f,0x00,0x10,0xf8,0x08,0x0c,0x02,0x05,0x01,0x84,0x02,0x06,0x26,0x0a,0x10,0x8a,0xcc,0xe0,0x1d,0x68,0xe0,0x18,0xab,0xd0,0x0b,0x18,0x10,0x46,0xe6,0x16,0x1e,0x18,0x10,0x46,0xe4,0x28,0x2c,0x98,0x14,0x68,0x00,0x21,0x1d,0x10,0x8c,0x40,0x02,0x0e,0x10,0xa1,0x08,0xc8,0x40,0x42,0x62,0x11,0x94,0x03,0xfd,0xff,0x00,0x0c,0xff,0x0c,0x08,0x28,0x60,0xe4,0xc0,0x85,0x00,0x83,0x00,0x87,0xf1,0x00,0x8c,0x02,0x0b,0x07,0x24,0x84,0xff,0x04,0xc7,0x80,0xa0,0xe4,0xa0,0x81,0x41,0x04,0x17,0x02,0x41,0x49,0x81,0x0e,0x10,0xb2,0xa0,0x82,0x0e,0x9f,0xfc,0x0a,0x62,0xf2,0xc0,0x03,0x92,0xf0,0x08,0x2d,0x78,0x20,0xff,0x02,0x01,0x08,0xae,0x60,0x64,0x38,0x0d,0xb0,0x8d,0x08,0x82,0x11,0x58,0xc4,0x13,0xc0,0x35,0x68,0x62,0x68,0x81,0x09,0x08,0x84,0x40,0x81,0x0d,0x18,0x69,0x10,0x47,0x44,0x66,0x5f,0x21,0xa9,0x29,0x94,0x10,0x2f,0x23,0x53,0x14,0x60,0x42,0x3c,0x08,0xfc,0x02,0x2c,0x62,0x23,0x58,0xd0,0x22,0x00,0x83,0x3e,0x98,0x44,0x43,0x46,0x22,0x30,0x89,0xce,0x01,0x0f,0x70,0x04,0x3f,0x81,0x8a,0x3c,0x21,0xaa,0x70,0x1a,0xe3,0x44,0x1a,0xa6,0x01,0xd2,0x38,0x90,0x8a,0x40,0x20,0xe5,0x96,0x80,0x43,0x81,0x06,0x6b,0x28,0x07,0xf3,0xfe,0x00,0x19,0xf9,0x34,0xc1,0x08,0x8f,0x20,0xf1,0x3e,0x16,0x00,0xa8,0x19,0x00,0x10,0x76,0x03,0xe2,0x3e,0x90,0x45,0x38,0x01,0x42,0x05,0x88,0x44,0x67,0x15,0x70,0x41,0x38,0x04,0x10,0x24,0x03,0x00,0x10,0x20,0x4a,0x46,0xe9,0x46,0xe1,0x04,0x50,0x66,0x40,0x85,0x19,0x98,0x00,0xc0,};
|
||||
const uint8_t* const _I_DoorRight_70x55[] = {_I_DoorRight_70x55_0};
|
||||
|
||||
const uint8_t _I_PassportBottom_128x17_0[] = {0x01,0x00,0x5e,0x00,0x96,0x01,0x97,0xe1,0xff,0x00,0x2e,0x3e,0x68,0x0f,0x5a,0xc5,0x54,0x00,0xb9,0x50,0xfb,0x6a,0x35,0x40,0x05,0xcd,0x4e,0x03,0xfd,0x30,0x0f,0xf8,0x7f,0xa0,0x81,0xfe,0xf9,0x1b,0xfb,0xf3,0x01,0x47,0x66,0x02,0x1b,0x03,0x07,0xe7,0x02,0x0b,0x02,0x07,0xe5,0x82,0x0b,0xf2,0x1c,0xb0,0x01,0x67,0xf0,0x5f,0xd0,0x3f,0x23,0xf0,0x9b,0xc9,0xe5,0x80,0x03,0xd5,0xc0,0x00,0x86,0x01,0xf3,0xe6,0x1e,0x58,0x00,0x36,0xa8,0x06,0xac,0x04,0x30,0x6c,0x30,0xee,0x60,0x1f,0xe0,0x10,0xff,0x0d,0xfb,0x00,};
|
||||
const uint8_t* const _I_PassportBottom_128x17[] = {_I_PassportBottom_128x17_0};
|
||||
|
||||
const uint8_t _I_PassportLeft_6x47_0[] = {0x01,0x00,0x1c,0x00,0x9e,0x40,0xa3,0x32,0x59,0x2c,0x66,0x03,0x01,0x82,0xc2,0x62,0x32,0x50,0x16,0xc8,0x60,0x30,0x28,0x24,0x32,0x39,0x3c,0x9e,0x4d,0x25,0x80,0x1a,};
|
||||
const uint8_t* const _I_PassportLeft_6x47[] = {_I_PassportLeft_6x47_0};
|
||||
|
||||
const uint8_t _I_WarningDolphin_45x42_0[] = {0x01,0x00,0xc6,0x00,0x00,0x1c,0x22,0x04,0x05,0x7f,0xfc,0x1e,0x20,0x05,0x1e,0x04,0x02,0x30,0x05,0x29,0x84,0x02,0xc1,0x20,0x02,0x8c,0x22,0x01,0x80,0x02,0x94,0x10,0x32,0x30,0x10,0x10,0x87,0xca,0x84,0x03,0x10,0x42,0x81,0x48,0x28,0x38,0x08,0x04,0x3e,0x01,0x84,0x83,0xe0,0x30,0x11,0x08,0x05,0xa2,0x11,0x40,0xa0,0x4b,0xc6,0xc5,0x40,0xd0,0x56,0xe0,0x10,0x60,0x29,0x54,0xf0,0x10,0x18,0xf0,0x14,0x6b,0xf6,0x0c,0x04,0x3e,0x40,0x05,0x12,0x80,0xc1,0xe4,0x01,0xd2,0xf8,0x40,0xe4,0x18,0x09,0xf4,0x03,0xf1,0x01,0x90,0x40,0x28,0x30,0x0f,0xe4,0x00,0x16,0x24,0x11,0xbf,0x01,0x44,0xee,0x53,0xf0,0x29,0xf0,0x3e,0x02,0x91,0x3b,0x8c,0xc3,0x81,0x13,0x90,0x48,0x20,0x3f,0xf9,0xfc,0x42,0x60,0x05,0x10,0x98,0x81,0x56,0x11,0x38,0x02,0x9c,0x1a,0x31,0x1e,0x02,0x8f,0x02,0x03,0x1c,0x90,0xc0,0x7c,0x02,0xf1,0xce,0x02,0x07,0x01,0x1f,0x80,0x63,0xa8,0x08,0x71,0x3c,0x8e,0x39,0x24,0x40,0x51,0xc7,0x81,0x53,0x0f,0x3c,0x02,0x9d,0x1e,0x38,0x29,0x10,0x29,0x17,0xc8,0x0a,0x32,0x3a,0x00,0x14,0x4b,0xa2,0x05,0x58,0x98,0x15,0x22,0x20,0x54,0x84,0x81,0x50,};
|
||||
const uint8_t* const _I_WarningDolphin_45x42[] = {_I_WarningDolphin_45x42_0};
|
||||
|
||||
const uint8_t _I_Back_15x10_0[] = {0x00,0x04,0x00,0x06,0x00,0xFF,0x0F,0x06,0x10,0x04,0x20,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x10,0xFE,0x0F,};
|
||||
const uint8_t* const _I_Back_15x10[] = {_I_Back_15x10_0};
|
||||
|
||||
|
@ -238,23 +217,23 @@ const uint8_t* const _I_Down_hvr_25x27[] = {_I_Down_hvr_25x27_0};
|
|||
const uint8_t _I_Fill_marker_7x7_0[] = {0x00,0x1C,0x32,0x6F,0x5F,0x7F,0x3E,0x1C,};
|
||||
const uint8_t* const _I_Fill_marker_7x7[] = {_I_Fill_marker_7x7_0};
|
||||
|
||||
const uint8_t _I_IrdaArrowDown_4x8_0[] = {0x00,0xFF,0x7E,0x3C,0x18,};
|
||||
const uint8_t* const _I_IrdaArrowDown_4x8[] = {_I_IrdaArrowDown_4x8_0};
|
||||
const uint8_t _I_InfraredArrowDown_4x8_0[] = {0x00,0xFF,0x7E,0x3C,0x18,};
|
||||
const uint8_t* const _I_InfraredArrowDown_4x8[] = {_I_InfraredArrowDown_4x8_0};
|
||||
|
||||
const uint8_t _I_IrdaArrowUp_4x8_0[] = {0x00,0x18,0x3C,0x7E,0xFF,};
|
||||
const uint8_t* const _I_IrdaArrowUp_4x8[] = {_I_IrdaArrowUp_4x8_0};
|
||||
const uint8_t _I_InfraredArrowUp_4x8_0[] = {0x00,0x18,0x3C,0x7E,0xFF,};
|
||||
const uint8_t* const _I_InfraredArrowUp_4x8[] = {_I_InfraredArrowUp_4x8_0};
|
||||
|
||||
const uint8_t _I_IrdaLearnShort_128x31_0[] = {0x01,0x00,0x10,0x01,0x00,0x47,0xfb,0xfe,0x00,0x38,0x38,0x3e,0x20,0x20,0x54,0x84,0x03,0x9f,0xc0,0x06,0x58,0x80,0x3d,0xf2,0x00,0x65,0x90,0x03,0xde,0x90,0x06,0x5a,0x07,0xc0,0x8a,0x70,0x1a,0x04,0x02,0x51,0x80,0x03,0x94,0x02,0x3f,0x40,0x20,0x24,0x0b,0x01,0x00,0x92,0x70,0x35,0x40,0x01,0xe0,0xdf,0xf0,0x10,0x40,0x71,0x58,0x20,0x90,0x88,0x0c,0x4a,0x81,0x55,0x00,0x0f,0x87,0xf7,0x00,0x82,0x43,0x36,0x16,0xdc,0x9c,0x12,0x21,0x01,0x85,0x70,0x3f,0xc1,0xf1,0xf8,0xfc,0x60,0x20,0xf5,0x90,0x40,0xa1,0x34,0x08,0x18,0x7c,0x7e,0x24,0x91,0x07,0x8c,0xc0,0x5e,0x52,0x28,0x14,0x17,0x81,0x01,0x0f,0x8f,0xe7,0xe3,0x03,0x1f,0x8e,0x02,0xdb,0x03,0x8e,0x49,0x20,0x50,0x2e,0x04,0x72,0xbd,0x55,0xdc,0xeb,0xa0,0x7c,0x4f,0x68,0xbc,0x60,0x72,0x40,0x79,0x50,0x23,0x9a,0x6d,0x56,0x66,0x5c,0x0f,0x21,0x78,0x9b,0x04,0x1e,0x28,0x21,0x8e,0x5c,0x43,0xe6,0x2f,0x10,0xf9,0x0b,0xc7,0x04,0x99,0x18,0x06,0xe0,0x7e,0x56,0x32,0x78,0x8f,0xc4,0x08,0x32,0x20,0x79,0x48,0x2b,0x85,0xf2,0xf8,0x83,0xc4,0x5c,0x3f,0x03,0x78,0xd0,0x81,0xe3,0xc0,0xdf,0x9f,0xcb,0xf3,0x04,0xc6,0x7d,0xfb,0xdf,0x34,0x78,0xd0,0x45,0xe5,0x7e,0x4f,0x97,0xe2,0x09,0x80,0x07,0x88,0xbc,0x61,0x00,0xf3,0xd8,0x2f,0xcb,0xe0,0xcf,0x60,0x68,0xd0,0x30,0x15,0xfa,0xac,0x36,0x3f,0x60,0x77,0xb3,0x80,0x5d,0xe6,0x4b,0x20,0x03,0x03,0xc4,0x01,0xd0,0x10,0x7f,0x40,0x81,0xfc,0xa7,0x10,0x06,0x99,0xd0,0x01,0x51,0x00,0x7f,0x48,0x01,0xfd,0xc0,0x43,0x98,0x00,0x8e,0xfe,0x00,0xf0,};
|
||||
const uint8_t* const _I_IrdaLearnShort_128x31[] = {_I_IrdaLearnShort_128x31_0};
|
||||
const uint8_t _I_InfraredLearnShort_128x31_0[] = {0x01,0x00,0x10,0x01,0x00,0x47,0xfb,0xfe,0x00,0x38,0x38,0x3e,0x20,0x20,0x54,0x84,0x03,0x9f,0xc0,0x06,0x58,0x80,0x3d,0xf2,0x00,0x65,0x90,0x03,0xde,0x90,0x06,0x5a,0x07,0xc0,0x8a,0x70,0x1a,0x04,0x02,0x51,0x80,0x03,0x94,0x02,0x3f,0x40,0x20,0x24,0x0b,0x01,0x00,0x92,0x70,0x35,0x40,0x01,0xe0,0xdf,0xf0,0x10,0x40,0x71,0x58,0x20,0x90,0x88,0x0c,0x4a,0x81,0x55,0x00,0x0f,0x87,0xf7,0x00,0x82,0x43,0x36,0x16,0xdc,0x9c,0x12,0x21,0x01,0x85,0x70,0x3f,0xc1,0xf1,0xf8,0xfc,0x60,0x20,0xf5,0x90,0x40,0xa1,0x34,0x08,0x18,0x7c,0x7e,0x24,0x91,0x07,0x8c,0xc0,0x5e,0x52,0x28,0x14,0x17,0x81,0x01,0x0f,0x8f,0xe7,0xe3,0x03,0x1f,0x8e,0x02,0xdb,0x03,0x8e,0x49,0x20,0x50,0x2e,0x04,0x72,0xbd,0x55,0xdc,0xeb,0xa0,0x7c,0x4f,0x68,0xbc,0x60,0x72,0x40,0x79,0x50,0x23,0x9a,0x6d,0x56,0x66,0x5c,0x0f,0x21,0x78,0x9b,0x04,0x1e,0x28,0x21,0x8e,0x5c,0x43,0xe6,0x2f,0x10,0xf9,0x0b,0xc7,0x04,0x99,0x18,0x06,0xe0,0x7e,0x56,0x32,0x78,0x8f,0xc4,0x08,0x32,0x20,0x79,0x48,0x2b,0x85,0xf2,0xf8,0x83,0xc4,0x5c,0x3f,0x03,0x78,0xd0,0x81,0xe3,0xc0,0xdf,0x9f,0xcb,0xf3,0x04,0xc6,0x7d,0xfb,0xdf,0x34,0x78,0xd0,0x45,0xe5,0x7e,0x4f,0x97,0xe2,0x09,0x80,0x07,0x88,0xbc,0x61,0x00,0xf3,0xd8,0x2f,0xcb,0xe0,0xcf,0x60,0x68,0xd0,0x30,0x15,0xfa,0xac,0x36,0x3f,0x60,0x77,0xb3,0x80,0x5d,0xe6,0x4b,0x20,0x03,0x03,0xc4,0x01,0xd0,0x10,0x7f,0x40,0x81,0xfc,0xa7,0x10,0x06,0x99,0xd0,0x01,0x51,0x00,0x7f,0x48,0x01,0xfd,0xc0,0x43,0x98,0x00,0x8e,0xfe,0x00,0xf0,};
|
||||
const uint8_t* const _I_InfraredLearnShort_128x31[] = {_I_InfraredLearnShort_128x31_0};
|
||||
|
||||
const uint8_t _I_IrdaLearn_128x64_0[] = {0x01,0x00,0xcc,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3f,0x01,0x07,0x82,0x41,0x21,0x20,0x73,0x00,0x8e,0x82,0x0f,0x00,0xa0,0x01,0x46,0x11,0x00,0x07,0xc0,0x28,0x41,0xe5,0xc8,0xba,0x63,0xa7,0x70,0x6b,0x3d,0xbb,0x99,0x19,0xee,0x68,0x71,0x16,0x3f,0x70,0x3c,0x64,0xf9,0x58,0x25,0x26,0x13,0x91,0xc9,0x64,0xa4,0x99,0x2d,0x06,0x1f,0x29,0x42,0x07,0x8c,0x80,0x1e,0x50,0xff,0x88,0x3c,0x67,0x80,0xf1,0xc1,0x03,0xde,0x03,0x11,0x07,0x8c,0x10,0x1e,0x38,0x40,0x79,0xf0,0x32,0x80,0xf1,0x83,0x58,0x72,0x58,0xc8,0xc6,0x73,0x40,0x3f,0x10,0x78,0x9e,0xf1,0x17,0xe9,0xcf,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x02,0x44,0x18,0xa3,0x80,0x82,0x32,0x06,0x44,0x0f,0xf0,0x73,0x5d,0xe3,0x92,0x7e,0xcf,0x06,0x3b,0xc3,0xa4,0xdd,0xfc,0xc8,0x35,0xca,0x44,0xa5,0x34,0x5c,0x16,0x92,0x89,0x4a,0x91,0x4a,0x60,0x20,0xf7,0xa4,0x83,0xc6,0x8e,0x0f,0xba,0x88,0x3c,0x68,0x00,0xf7,0x80,0x65,0xe3,0x9c,0x7a,0x6e,0x0a,0x49,0xc3,0xb8,0xc8,0xa4,0xc0,0xf5,0x00,0x08,0x1d,0xc0,0x0e,0x0f,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x2f,0xfb,0xfe,0x00,0x38,0x39,0x97,0xa1,0x00,0xe7,0xf0,0x3b,0x1c,0x00,0xd9,0x00,0x32,0xc8,0x01,0xef,0x48,0x03,0x2d,0x03,0xe0,0x45,0x38,0x0d,0x02,0x01,0x28,0xc0,0x01,0xca,0x01,0x1f,0xa0,0x10,0x12,0x05,0x80,0x80,0x49,0x38,0x1a,0xa0,0x00,0xf0,0x6f,0xf8,0x08,0x20,0x38,0xac,0x10,0x48,0x44,0x06,0x25,0x40,0xaa,0x80,0x07,0xc3,0xfb,0x80,0x41,0x21,0x9b,0x0b,0x6e,0x4e,0x09,0x10,0x80,0xc2,0xb8,0x1f,0xe0,0xf8,0xfc,0x7e,0x30,0x10,0x7a,0xc8,0x20,0x50,0x9a,0x04,0x0c,0x3e,0x3f,0x12,0x48,0x83,0xc6,0x60,0x2f,0x29,0x14,0x0a,0x0b,0xc0,0x80,0x87,0xc7,0xf3,0xf1,0x81,0x8f,0xc7,0x01,0x6d,0x81,0xc7,0x24,0x90,0x28,0x17,0x02,0x39,0x5e,0xaa,0xee,0x75,0xd0,0x3e,0x27,0xb4,0x5e,0x30,0x39,0x20,0x3c,0xa8,0x11,0xcd,0x36,0xab,0x33,0x2e,0x07,0x90,0xbc,0x4d,0x82,0x0f,0x14,0x10,0xc7,0x2e,0x21,0xf3,0x17,0x88,0x7c,0x85,0xe3,0x82,0x4c,0x8c,0x03,0x70,0x3f,0x2b,0x19,0x3c,0x47,0xe2,0x04,0x19,0x10,0x3c,0xa4,0x15,0xc2,0xf9,0x7c,0x41,0xe2,0x2e,0x1f,0x81,0xbc,0x68,0x40,0xf1,0xe0,0x6f,0xcf,0xe5,0xf9,0x82,0x63,0x3e,0xfd,0xef,0x9a,0x3c,0x68,0x22,0xf2,0xbf,0x27,0xcb,0xf1,0x04,0xc0,0x03,0xc4,0x5e,0x30,0x80,0x79,0xec,0x17,0xe5,0xf0,0x67,0xb0,0x34,0x68,0x18,0x0a,0xfd,0x56,0x1b,0x1f,0xb0,0x3b,0xd9,0xc0,0x2e,0xf3,0x25,0x90,0x01,0x81,0xe2,0x00,0xe8,0x08,0x3f,0xa0,0x40,0xfe,0x53,0x88,0x03,0x4c,0xe8,0x00,0xa8,0x80,0x3f,0xa4,0x00,0xfe,0xe0,0x21,0xcc,0x00,0x47,0x7f,0x00,0x78,};
|
||||
const uint8_t* const _I_IrdaLearn_128x64[] = {_I_IrdaLearn_128x64_0};
|
||||
const uint8_t _I_InfraredLearn_128x64_0[] = {0x01,0x00,0xcc,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3f,0x01,0x07,0x82,0x41,0x21,0x20,0x73,0x00,0x8e,0x82,0x0f,0x00,0xa0,0x01,0x46,0x11,0x00,0x07,0xc0,0x28,0x41,0xe5,0xc8,0xba,0x63,0xa7,0x70,0x6b,0x3d,0xbb,0x99,0x19,0xee,0x68,0x71,0x16,0x3f,0x70,0x3c,0x64,0xf9,0x58,0x25,0x26,0x13,0x91,0xc9,0x64,0xa4,0x99,0x2d,0x06,0x1f,0x29,0x42,0x07,0x8c,0x80,0x1e,0x50,0xff,0x88,0x3c,0x67,0x80,0xf1,0xc1,0x03,0xde,0x03,0x11,0x07,0x8c,0x10,0x1e,0x38,0x40,0x79,0xf0,0x32,0x80,0xf1,0x83,0x58,0x72,0x58,0xc8,0xc6,0x73,0x40,0x3f,0x10,0x78,0x9e,0xf1,0x17,0xe9,0xcf,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x02,0x44,0x18,0xa3,0x80,0x82,0x32,0x06,0x44,0x0f,0xf0,0x73,0x5d,0xe3,0x92,0x7e,0xcf,0x06,0x3b,0xc3,0xa4,0xdd,0xfc,0xc8,0x35,0xca,0x44,0xa5,0x34,0x5c,0x16,0x92,0x89,0x4a,0x91,0x4a,0x60,0x20,0xf7,0xa4,0x83,0xc6,0x8e,0x0f,0xba,0x88,0x3c,0x68,0x00,0xf7,0x80,0x65,0xe3,0x9c,0x7a,0x6e,0x0a,0x49,0xc3,0xb8,0xc8,0xa4,0xc0,0xf5,0x00,0x08,0x1d,0xc0,0x0e,0x0f,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x2f,0xfb,0xfe,0x00,0x38,0x39,0x97,0xa1,0x00,0xe7,0xf0,0x3b,0x1c,0x00,0xd9,0x00,0x32,0xc8,0x01,0xef,0x48,0x03,0x2d,0x03,0xe0,0x45,0x38,0x0d,0x02,0x01,0x28,0xc0,0x01,0xca,0x01,0x1f,0xa0,0x10,0x12,0x05,0x80,0x80,0x49,0x38,0x1a,0xa0,0x00,0xf0,0x6f,0xf8,0x08,0x20,0x38,0xac,0x10,0x48,0x44,0x06,0x25,0x40,0xaa,0x80,0x07,0xc3,0xfb,0x80,0x41,0x21,0x9b,0x0b,0x6e,0x4e,0x09,0x10,0x80,0xc2,0xb8,0x1f,0xe0,0xf8,0xfc,0x7e,0x30,0x10,0x7a,0xc8,0x20,0x50,0x9a,0x04,0x0c,0x3e,0x3f,0x12,0x48,0x83,0xc6,0x60,0x2f,0x29,0x14,0x0a,0x0b,0xc0,0x80,0x87,0xc7,0xf3,0xf1,0x81,0x8f,0xc7,0x01,0x6d,0x81,0xc7,0x24,0x90,0x28,0x17,0x02,0x39,0x5e,0xaa,0xee,0x75,0xd0,0x3e,0x27,0xb4,0x5e,0x30,0x39,0x20,0x3c,0xa8,0x11,0xcd,0x36,0xab,0x33,0x2e,0x07,0x90,0xbc,0x4d,0x82,0x0f,0x14,0x10,0xc7,0x2e,0x21,0xf3,0x17,0x88,0x7c,0x85,0xe3,0x82,0x4c,0x8c,0x03,0x70,0x3f,0x2b,0x19,0x3c,0x47,0xe2,0x04,0x19,0x10,0x3c,0xa4,0x15,0xc2,0xf9,0x7c,0x41,0xe2,0x2e,0x1f,0x81,0xbc,0x68,0x40,0xf1,0xe0,0x6f,0xcf,0xe5,0xf9,0x82,0x63,0x3e,0xfd,0xef,0x9a,0x3c,0x68,0x22,0xf2,0xbf,0x27,0xcb,0xf1,0x04,0xc0,0x03,0xc4,0x5e,0x30,0x80,0x79,0xec,0x17,0xe5,0xf0,0x67,0xb0,0x34,0x68,0x18,0x0a,0xfd,0x56,0x1b,0x1f,0xb0,0x3b,0xd9,0xc0,0x2e,0xf3,0x25,0x90,0x01,0x81,0xe2,0x00,0xe8,0x08,0x3f,0xa0,0x40,0xfe,0x53,0x88,0x03,0x4c,0xe8,0x00,0xa8,0x80,0x3f,0xa4,0x00,0xfe,0xe0,0x21,0xcc,0x00,0x47,0x7f,0x00,0x78,};
|
||||
const uint8_t* const _I_InfraredLearn_128x64[] = {_I_InfraredLearn_128x64_0};
|
||||
|
||||
const uint8_t _I_IrdaSendShort_128x34_0[] = {0x01,0x00,0x42,0x01,0xfe,0x7f,0xc0,0x07,0x03,0x07,0xc4,0x10,0x0a,0x90,0x20,0x7f,0x83,0xfc,0x04,0x3c,0x01,0xc2,0x7f,0xf8,0x80,0x43,0x9f,0x83,0xca,0x40,0x1f,0x5e,0x27,0x7e,0xab,0x55,0xee,0x83,0xce,0x38,0x0f,0x6d,0x50,0x00,0xa5,0xc0,0xf2,0x89,0x03,0xda,0xfe,0x1f,0x1f,0xa8,0x7c,0x48,0xc3,0x09,0x07,0xb6,0xae,0x54,0x1f,0x19,0xd4,0x08,0x40,0x30,0x5f,0x81,0x1c,0x63,0xfe,0x08,0x1f,0x12,0xbe,0x3f,0x49,0x0e,0x02,0x09,0x58,0x04,0x0c,0xd7,0xf1,0x0f,0x1f,0x8e,0x2b,0x11,0xaa,0x95,0x40,0xa2,0x34,0x08,0x16,0xa0,0x4e,0x32,0xab,0xe4,0x7f,0x89,0x77,0x0b,0x0d,0xd6,0x7f,0x82,0x84,0x50,0x20,0x3d,0x81,0x48,0xcd,0x67,0xd3,0xe1,0xf8,0xc8,0xb4,0x43,0xf1,0xc1,0x62,0x24,0x10,0x1b,0x46,0x80,0x3e,0x3f,0xe9,0xf8,0xfc,0xfa,0xa1,0xf1,0xa4,0x68,0x20,0x13,0x8a,0x00,0x7c,0x67,0xf7,0xe3,0xfa,0x4a,0x81,0xe3,0x40,0x80,0x66,0x38,0x66,0xa1,0xeb,0xdd,0x47,0xec,0x0f,0x2c,0x47,0x0e,0xa9,0x35,0xe9,0xd9,0x47,0xe2,0x1f,0x21,0xf8,0xd2,0x17,0xc3,0x88,0x91,0xeb,0x83,0xe6,0xbf,0x42,0x78,0xc4,0x20,0x10,0x88,0x05,0x5c,0x7e,0x7a,0xe1,0xfa,0x42,0x01,0xe5,0x84,0x1f,0x89,0x7c,0xbf,0xf7,0x7b,0xaf,0xdd,0x3e,0x31,0x10,0xe8,0xc2,0x3f,0x01,0xf1,0x3f,0x98,0x7c,0xa7,0x6a,0xf1,0x07,0x97,0x03,0x5e,0x9f,0x36,0x28,0xf7,0x7f,0xa1,0xf1,0x81,0x03,0xca,0x01,0x56,0x5f,0x9f,0xb8,0x3c,0x3e,0xa7,0xf8,0xc1,0x01,0xe5,0xf0,0x15,0x0f,0x85,0xbe,0x21,0xf1,0x00,0x08,0x7c,0x60,0x04,0xf1,0x77,0x96,0x7e,0x02,0xff,0x10,0x7c,0x00,0x16,0x08,0x05,0x40,0x78,0xa3,0xc4,0x00,0xb2,0x40,0x7b,0x2b,0xc4,0x00,0xb5,0x48,0x78,0x3d,0x70,0x01,0xf7,0x07,0xb4,0x00,0x94,0x23,0xfc,0x01,0x18,0x00,0xff,0x85,0xf3,0xff,0xc0,0xc3,0x0f,0x00,0xf0,0x09,0xce,0xf0,0x03,0x2f,0xc0,0x61,0x3f,0xe0,0xf8,0x00,0x30,0x3f,0xc0,};
|
||||
const uint8_t* const _I_IrdaSendShort_128x34[] = {_I_IrdaSendShort_128x34_0};
|
||||
const uint8_t _I_InfraredSendShort_128x34_0[] = {0x01,0x00,0x42,0x01,0xfe,0x7f,0xc0,0x07,0x03,0x07,0xc4,0x10,0x0a,0x90,0x20,0x7f,0x83,0xfc,0x04,0x3c,0x01,0xc2,0x7f,0xf8,0x80,0x43,0x9f,0x83,0xca,0x40,0x1f,0x5e,0x27,0x7e,0xab,0x55,0xee,0x83,0xce,0x38,0x0f,0x6d,0x50,0x00,0xa5,0xc0,0xf2,0x89,0x03,0xda,0xfe,0x1f,0x1f,0xa8,0x7c,0x48,0xc3,0x09,0x07,0xb6,0xae,0x54,0x1f,0x19,0xd4,0x08,0x40,0x30,0x5f,0x81,0x1c,0x63,0xfe,0x08,0x1f,0x12,0xbe,0x3f,0x49,0x0e,0x02,0x09,0x58,0x04,0x0c,0xd7,0xf1,0x0f,0x1f,0x8e,0x2b,0x11,0xaa,0x95,0x40,0xa2,0x34,0x08,0x16,0xa0,0x4e,0x32,0xab,0xe4,0x7f,0x89,0x77,0x0b,0x0d,0xd6,0x7f,0x82,0x84,0x50,0x20,0x3d,0x81,0x48,0xcd,0x67,0xd3,0xe1,0xf8,0xc8,0xb4,0x43,0xf1,0xc1,0x62,0x24,0x10,0x1b,0x46,0x80,0x3e,0x3f,0xe9,0xf8,0xfc,0xfa,0xa1,0xf1,0xa4,0x68,0x20,0x13,0x8a,0x00,0x7c,0x67,0xf7,0xe3,0xfa,0x4a,0x81,0xe3,0x40,0x80,0x66,0x38,0x66,0xa1,0xeb,0xdd,0x47,0xec,0x0f,0x2c,0x47,0x0e,0xa9,0x35,0xe9,0xd9,0x47,0xe2,0x1f,0x21,0xf8,0xd2,0x17,0xc3,0x88,0x91,0xeb,0x83,0xe6,0xbf,0x42,0x78,0xc4,0x20,0x10,0x88,0x05,0x5c,0x7e,0x7a,0xe1,0xfa,0x42,0x01,0xe5,0x84,0x1f,0x89,0x7c,0xbf,0xf7,0x7b,0xaf,0xdd,0x3e,0x31,0x10,0xe8,0xc2,0x3f,0x01,0xf1,0x3f,0x98,0x7c,0xa7,0x6a,0xf1,0x07,0x97,0x03,0x5e,0x9f,0x36,0x28,0xf7,0x7f,0xa1,0xf1,0x81,0x03,0xca,0x01,0x56,0x5f,0x9f,0xb8,0x3c,0x3e,0xa7,0xf8,0xc1,0x01,0xe5,0xf0,0x15,0x0f,0x85,0xbe,0x21,0xf1,0x00,0x08,0x7c,0x60,0x04,0xf1,0x77,0x96,0x7e,0x02,0xff,0x10,0x7c,0x00,0x16,0x08,0x05,0x40,0x78,0xa3,0xc4,0x00,0xb2,0x40,0x7b,0x2b,0xc4,0x00,0xb5,0x48,0x78,0x3d,0x70,0x01,0xf7,0x07,0xb4,0x00,0x94,0x23,0xfc,0x01,0x18,0x00,0xff,0x85,0xf3,0xff,0xc0,0xc3,0x0f,0x00,0xf0,0x09,0xce,0xf0,0x03,0x2f,0xc0,0x61,0x3f,0xe0,0xf8,0x00,0x30,0x3f,0xc0,};
|
||||
const uint8_t* const _I_InfraredSendShort_128x34[] = {_I_InfraredSendShort_128x34_0};
|
||||
|
||||
const uint8_t _I_IrdaSend_128x64_0[] = {0x01,0x00,0xe2,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xfe,0x04,0x0e,0x05,0x82,0xd7,0x81,0xca,0x21,0x08,0x01,0x8c,0x10,0x0e,0x54,0x00,0x20,0xe0,0xa4,0x00,0xfb,0xb2,0x4e,0xb0,0xfa,0x0e,0x74,0xc7,0x0f,0x3b,0xce,0x4e,0xec,0xf0,0xe1,0x79,0xe4,0xe9,0x58,0x2d,0x3d,0x4a,0x95,0x41,0x89,0x52,0x31,0x59,0x40,0xfa,0x64,0x01,0xe3,0xa0,0xa9,0x5e,0x81,0xe7,0xf4,0x07,0xcc,0x28,0x1e,0x71,0x40,0x7a,0x58,0x01,0xe4,0x3f,0x1c,0x0c,0x4f,0x11,0x0b,0xb3,0x83,0xcc,0x00,0x94,0x20,0x2a,0x03,0xa0,0x1e,0xd0,0x34,0xdf,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x4c,0xf0,0x17,0x4c,0x81,0xa0,0x18,0x18,0x1f,0x39,0x90,0x6c,0x60,0x27,0x70,0xe9,0x3f,0x67,0x03,0x3c,0x80,0x83,0xde,0x81,0x4a,0x84,0xca,0x68,0xb8,0x2b,0xf0,0x3f,0x29,0x20,0xfe,0xa8,0xe0,0x85,0xf3,0x80,0xa5,0xc3,0xb8,0xf4,0xd8,0x11,0x3e,0x40,0x04,0x1b,0x23,0x7d,0x83,0xcd,0x1f,0x60,0x0f,0x00,0x78,0x03,0x7f,0x9f,0xf0,0x01,0xc0,0xc1,0xf1,0x04,0x02,0xa4,0x08,0x1f,0xe0,0xff,0x01,0x0f,0x00,0x70,0x9f,0xfe,0x20,0x10,0xe7,0xe0,0xf2,0x90,0x07,0xd7,0x89,0xdf,0xaa,0xd5,0x7b,0xa0,0xf3,0x8e,0x03,0xdb,0x54,0x00,0x29,0x70,0x3c,0xa2,0x40,0xf6,0xbf,0x87,0xc7,0xea,0x1f,0x12,0x30,0xc2,0x41,0xed,0xab,0x95,0x07,0xc6,0x75,0x02,0x10,0x0c,0x17,0xe0,0x47,0x18,0xff,0x82,0x07,0xc4,0xaf,0x8f,0xd2,0x43,0x80,0x82,0x56,0x01,0x03,0x35,0xfc,0x43,0xc7,0xe3,0x8a,0xc4,0x6a,0xa5,0x50,0x28,0x8d,0x02,0x05,0xa8,0x13,0x8c,0xaa,0xf9,0x1f,0xe2,0x5d,0xc2,0xc3,0x75,0x9f,0xe0,0xa1,0x14,0x08,0x0f,0x60,0x52,0x33,0x59,0xf4,0xf8,0x7e,0x32,0x2d,0x10,0xfc,0x70,0x58,0x89,0x04,0x06,0xd1,0xa0,0x0f,0x8f,0xfa,0x7e,0x3f,0x3e,0xa8,0x7c,0x69,0x1a,0x08,0x04,0xe2,0x80,0x1f,0x19,0xfd,0xf8,0xfe,0x92,0xa0,0x78,0xd0,0x20,0x19,0x8e,0x19,0xa8,0x7a,0xf7,0x51,0xfb,0x03,0xcb,0x11,0xc3,0xaa,0x4d,0x7a,0x76,0x51,0xf8,0x87,0xc8,0x7e,0x34,0x85,0xf0,0xe2,0x24,0x7a,0xe0,0xf9,0xaf,0xd0,0x9e,0x31,0x08,0x04,0x22,0x01,0x57,0x1f,0x9e,0xb8,0x7e,0x90,0x80,0x79,0x61,0x07,0xe2,0x5f,0x2f,0xfd,0xde,0xeb,0xf7,0x4f,0x8c,0x44,0x3a,0x30,0x8f,0xc0,0x7c,0x4f,0xe6,0x1f,0x29,0xda,0xbc,0x41,0xe5,0xc0,0xd7,0xa7,0xcd,0x8a,0x3d,0xdf,0xe8,0x7c,0x60,0x40,0xf2,0x80,0x55,0x97,0xe7,0xee,0x0f,0x0f,0xa9,0xfe,0x30,0x40,0x79,0x7c,0x05,0x43,0xe1,0x6f,0x88,0x7c,0x40,0x02,0x1f,0x18,0x01,0x3c,0x5d,0xe5,0x9f,0x80,0xbf,0xc4,0x1f,0x00,0x05,0x82,0x01,0x50,0x1e,0x28,0xf1,0x00,0x2c,0x90,0x1e,0xca,0xf1,0x00,0x2d,0x52,0x1e,0x0f,0x5c,0x00,0x7d,0xc1,0xed,0x00,0x25,0x08,0xff,0x00,0x46,0x00,0x3f,0xe1,0x7c,0xff,0xf0,0x30,0xc3,0xc0,0x3c,0x02,0x73,0xbc,0x00,0xcb,0xf0,0x18,0x4f,0xf8,0x3e,0x00,0x0c,0x0f,0xf0,};
|
||||
const uint8_t* const _I_IrdaSend_128x64[] = {_I_IrdaSend_128x64_0};
|
||||
const uint8_t _I_InfraredSend_128x64_0[] = {0x01,0x00,0xe2,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xfe,0x04,0x0e,0x05,0x82,0xd7,0x81,0xca,0x21,0x08,0x01,0x8c,0x10,0x0e,0x54,0x00,0x20,0xe0,0xa4,0x00,0xfb,0xb2,0x4e,0xb0,0xfa,0x0e,0x74,0xc7,0x0f,0x3b,0xce,0x4e,0xec,0xf0,0xe1,0x79,0xe4,0xe9,0x58,0x2d,0x3d,0x4a,0x95,0x41,0x89,0x52,0x31,0x59,0x40,0xfa,0x64,0x01,0xe3,0xa0,0xa9,0x5e,0x81,0xe7,0xf4,0x07,0xcc,0x28,0x1e,0x71,0x40,0x7a,0x58,0x01,0xe4,0x3f,0x1c,0x0c,0x4f,0x11,0x0b,0xb3,0x83,0xcc,0x00,0x94,0x20,0x2a,0x03,0xa0,0x1e,0xd0,0x34,0xdf,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x4c,0xf0,0x17,0x4c,0x81,0xa0,0x18,0x18,0x1f,0x39,0x90,0x6c,0x60,0x27,0x70,0xe9,0x3f,0x67,0x03,0x3c,0x80,0x83,0xde,0x81,0x4a,0x84,0xca,0x68,0xb8,0x2b,0xf0,0x3f,0x29,0x20,0xfe,0xa8,0xe0,0x85,0xf3,0x80,0xa5,0xc3,0xb8,0xf4,0xd8,0x11,0x3e,0x40,0x04,0x1b,0x23,0x7d,0x83,0xcd,0x1f,0x60,0x0f,0x00,0x78,0x03,0x7f,0x9f,0xf0,0x01,0xc0,0xc1,0xf1,0x04,0x02,0xa4,0x08,0x1f,0xe0,0xff,0x01,0x0f,0x00,0x70,0x9f,0xfe,0x20,0x10,0xe7,0xe0,0xf2,0x90,0x07,0xd7,0x89,0xdf,0xaa,0xd5,0x7b,0xa0,0xf3,0x8e,0x03,0xdb,0x54,0x00,0x29,0x70,0x3c,0xa2,0x40,0xf6,0xbf,0x87,0xc7,0xea,0x1f,0x12,0x30,0xc2,0x41,0xed,0xab,0x95,0x07,0xc6,0x75,0x02,0x10,0x0c,0x17,0xe0,0x47,0x18,0xff,0x82,0x07,0xc4,0xaf,0x8f,0xd2,0x43,0x80,0x82,0x56,0x01,0x03,0x35,0xfc,0x43,0xc7,0xe3,0x8a,0xc4,0x6a,0xa5,0x50,0x28,0x8d,0x02,0x05,0xa8,0x13,0x8c,0xaa,0xf9,0x1f,0xe2,0x5d,0xc2,0xc3,0x75,0x9f,0xe0,0xa1,0x14,0x08,0x0f,0x60,0x52,0x33,0x59,0xf4,0xf8,0x7e,0x32,0x2d,0x10,0xfc,0x70,0x58,0x89,0x04,0x06,0xd1,0xa0,0x0f,0x8f,0xfa,0x7e,0x3f,0x3e,0xa8,0x7c,0x69,0x1a,0x08,0x04,0xe2,0x80,0x1f,0x19,0xfd,0xf8,0xfe,0x92,0xa0,0x78,0xd0,0x20,0x19,0x8e,0x19,0xa8,0x7a,0xf7,0x51,0xfb,0x03,0xcb,0x11,0xc3,0xaa,0x4d,0x7a,0x76,0x51,0xf8,0x87,0xc8,0x7e,0x34,0x85,0xf0,0xe2,0x24,0x7a,0xe0,0xf9,0xaf,0xd0,0x9e,0x31,0x08,0x04,0x22,0x01,0x57,0x1f,0x9e,0xb8,0x7e,0x90,0x80,0x79,0x61,0x07,0xe2,0x5f,0x2f,0xfd,0xde,0xeb,0xf7,0x4f,0x8c,0x44,0x3a,0x30,0x8f,0xc0,0x7c,0x4f,0xe6,0x1f,0x29,0xda,0xbc,0x41,0xe5,0xc0,0xd7,0xa7,0xcd,0x8a,0x3d,0xdf,0xe8,0x7c,0x60,0x40,0xf2,0x80,0x55,0x97,0xe7,0xee,0x0f,0x0f,0xa9,0xfe,0x30,0x40,0x79,0x7c,0x05,0x43,0xe1,0x6f,0x88,0x7c,0x40,0x02,0x1f,0x18,0x01,0x3c,0x5d,0xe5,0x9f,0x80,0xbf,0xc4,0x1f,0x00,0x05,0x82,0x01,0x50,0x1e,0x28,0xf1,0x00,0x2c,0x90,0x1e,0xca,0xf1,0x00,0x2d,0x52,0x1e,0x0f,0x5c,0x00,0x7d,0xc1,0xed,0x00,0x25,0x08,0xff,0x00,0x46,0x00,0x3f,0xe1,0x7c,0xff,0xf0,0x30,0xc3,0xc0,0x3c,0x02,0x73,0xbc,0x00,0xcb,0xf0,0x18,0x4f,0xf8,0x3e,0x00,0x0c,0x0f,0xf0,};
|
||||
const uint8_t* const _I_InfraredSend_128x64[] = {_I_InfraredSend_128x64_0};
|
||||
|
||||
const uint8_t _I_Mute_25x27_0[] = {0x01,0x00,0x51,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x31,0x81,0xc0,0x64,0x38,0x08,0xa4,0x06,0x83,0x40,0x86,0x40,0x70,0x32,0x08,0x20,0x3c,0x63,0xf0,0x60,0x38,0xc0,0xa0,0xa0,0x31,0xc2,0x02,0xc7,0x03,0x48,0x01,0x94,0xc0,0x06,0xc0,0xb3,0x09,0x98,0x6c,0x84,0x68,0x2b,0x21,0x99,0x8e,0xcc,0x86,0x64,0xb3,0x81,0x94,0xc6,0x03,0x06,0x80,0x70,0x20,0x1f,0xcf,0xfd,0xfc,0xce,0x80,};
|
||||
const uint8_t* const _I_Mute_25x27[] = {_I_Mute_25x27_0};
|
||||
|
@ -286,6 +265,27 @@ const uint8_t* const _I_Vol_up_25x27[] = {_I_Vol_up_25x27_0};
|
|||
const uint8_t _I_Vol_up_hvr_25x27_0[] = {0x01,0x00,0x28,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x38,0xf7,0x80,0xfc,0x06,0xa2,0xd1,0xfc,0x00,0xd0,0x2f,0xe0,0x38,0x21,0xd8,0x0c,0x8a,0xe6,0x5f,0x33,0x39,0x80,};
|
||||
const uint8_t* const _I_Vol_up_hvr_25x27[] = {_I_Vol_up_hvr_25x27_0};
|
||||
|
||||
const uint8_t _I_Back3_45x8_0[] = {0x00,0x04,0x00,0x10,0x00,0x40,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x7F,0x00,0xFC,0x01,0xF0,0x07,0x86,0x20,0x18,0x82,0x60,0x08,0x04,0x71,0x10,0xC4,0x41,0x10,0x00,0x21,0x00,0x84,0x00,0x10,0x80,0x00,0x00,0x02,0x00,0x08,0x7E,0x00,0xF8,0x01,0xE0,0x07,};
|
||||
const uint8_t* const _I_Back3_45x8[] = {_I_Back3_45x8_0};
|
||||
|
||||
const uint8_t _I_DoorLeft_70x55_0[] = {0x01,0x00,0x19,0x01,0x00,0x2c,0x32,0x01,0x03,0x04,0x2c,0x18,0x10,0xf0,0x40,0x47,0x82,0x06,0x81,0x03,0xff,0x80,0x08,0x1a,0x20,0x82,0x15,0x28,0x21,0x87,0x82,0x08,0x6f,0xc0,0xb1,0xe6,0x10,0x10,0x8b,0x46,0x20,0x43,0x55,0x8f,0x82,0x10,0x32,0x73,0x0a,0x09,0x89,0x6c,0x1e,0x09,0x00,0x18,0x60,0xf0,0x0c,0x84,0x93,0x82,0x03,0x18,0x0c,0x02,0x1d,0x00,0x90,0x52,0x70,0x50,0x1e,0x00,0x58,0x63,0x90,0x0a,0x06,0x4a,0x09,0x03,0xb0,0x02,0x06,0x70,0x62,0x49,0xf8,0x0c,0x66,0x3f,0xf0,0x41,0x63,0x04,0x43,0x00,0x99,0x60,0x00,0x85,0xc8,0x06,0x14,0xd0,0x80,0x3f,0xc8,0x0d,0xb8,0x10,0x70,0xf8,0x34,0x13,0x03,0x39,0x04,0x1c,0x42,0x19,0xf8,0xa0,0xc2,0x01,0x07,0xef,0x02,0x8c,0x80,0x10,0x9d,0x00,0x43,0xec,0x00,0xa3,0x10,0x04,0x25,0xce,0x19,0xfc,0x88,0x82,0x12,0x0c,0x35,0x10,0x42,0x4c,0xa1,0x90,0x3f,0xc0,0x21,0x22,0x39,0x82,0xc8,0x88,0xd2,0x11,0xf0,0x01,0x88,0xd5,0x18,0xe2,0x08,0x68,0x10,0x0c,0xa8,0x00,0x83,0x81,0xcc,0xd5,0xc3,0x80,0x84,0x82,0x0e,0xcc,0xc0,0x15,0x79,0x02,0x0b,0x98,0xf8,0x11,0x88,0x82,0x0f,0x31,0x19,0x02,0x08,0x2c,0x9f,0x6a,0x1d,0x20,0x41,0x31,0x4c,0x10,0x8d,0x73,0x04,0x23,0xa4,0xc4,0x6c,0xde,0x20,0x42,0xcc,0x01,0x07,0x07,0xff,0x80,0x06,0x3e,0x08,0x38,0x70,0x20,0xa1,0xe0,0x83,0x8e,0x01,0x0c,0xf0,0x73,0x80,0x43,0x70,0x05,0x08,0x00,0x2c,0x04,0xc4,0x46,0x53,0x09,0x98,0x24,0x80,0x65,0x80,0xb0,0xd9,0x84,0x65,0x32,0x06,0x17,0x0f,0x98,0x23,0x63,0xe1,0x88,0xc4,0x08,0x5f,0xc1,0x30,0x9d,0x84,0x4e,0x66,0x94,0x11,0x98,0x75,0x26,0x00,};
|
||||
const uint8_t* const _I_DoorLeft_70x55[] = {_I_DoorLeft_70x55_0};
|
||||
|
||||
const uint8_t _I_DoorLocked_10x56_0[] = {0x01,0x00,0x4e,0x00,0x86,0x40,0x25,0xb0,0x0b,0x6c,0x03,0x9b,0x00,0xc6,0xc0,0x65,0x90,0x10,0x3a,0xc3,0x20,0x31,0xc8,0x04,0xe2,0x01,0x70,0x80,0x78,0x20,0x1c,0x48,0x07,0x22,0x01,0xd0,0x00,0xf0,0x44,0x68,0x90,0x09,0x04,0x02,0x21,0x00,0x84,0x40,0x25,0x80,0x12,0x1e,0x88,0x14,0xc0,0x2e,0x0d,0x11,0xca,0xf8,0x60,0x1c,0x38,0x07,0x1a,0x05,0xcc,0x80,0x72,0x60,0x5c,0x38,0x10,0x1c,0xf9,0x10,0x2e,0x00,0x05,0x60,0x00,0x11,};
|
||||
const uint8_t* const _I_DoorLocked_10x56[] = {_I_DoorLocked_10x56_0};
|
||||
|
||||
const uint8_t _I_DoorRight_70x55_0[] = {0x01,0x00,0x16,0x01,0x81,0xcc,0x01,0x0f,0x60,0x04,0x3f,0x00,0x10,0xf8,0x08,0x0c,0x02,0x05,0x01,0x84,0x02,0x06,0x26,0x0a,0x10,0x8a,0xcc,0xe0,0x1d,0x68,0xe0,0x18,0xab,0xd0,0x0b,0x18,0x10,0x46,0xe6,0x16,0x1e,0x18,0x10,0x46,0xe4,0x28,0x2c,0x98,0x14,0x68,0x00,0x21,0x1d,0x10,0x8c,0x40,0x02,0x0e,0x10,0xa1,0x08,0xc8,0x40,0x42,0x62,0x11,0x94,0x03,0xfd,0xff,0x00,0x0c,0xff,0x0c,0x08,0x28,0x60,0xe4,0xc0,0x85,0x00,0x83,0x00,0x87,0xf1,0x00,0x8c,0x02,0x0b,0x07,0x24,0x84,0xff,0x04,0xc7,0x80,0xa0,0xe4,0xa0,0x81,0x41,0x04,0x17,0x02,0x41,0x49,0x81,0x0e,0x10,0xb2,0xa0,0x82,0x0e,0x9f,0xfc,0x0a,0x62,0xf2,0xc0,0x03,0x92,0xf0,0x08,0x2d,0x78,0x20,0xff,0x02,0x01,0x08,0xae,0x60,0x64,0x38,0x0d,0xb0,0x8d,0x08,0x82,0x11,0x58,0xc4,0x13,0xc0,0x35,0x68,0x62,0x68,0x81,0x09,0x08,0x84,0x40,0x81,0x0d,0x18,0x69,0x10,0x47,0x44,0x66,0x5f,0x21,0xa9,0x29,0x94,0x10,0x2f,0x23,0x53,0x14,0x60,0x42,0x3c,0x08,0xfc,0x02,0x2c,0x62,0x23,0x58,0xd0,0x22,0x00,0x83,0x3e,0x98,0x44,0x43,0x46,0x22,0x30,0x89,0xce,0x01,0x0f,0x70,0x04,0x3f,0x81,0x8a,0x3c,0x21,0xaa,0x70,0x1a,0xe3,0x44,0x1a,0xa6,0x01,0xd2,0x38,0x90,0x8a,0x40,0x20,0xe5,0x96,0x80,0x43,0x81,0x06,0x6b,0x28,0x07,0xf3,0xfe,0x00,0x19,0xf9,0x34,0xc1,0x08,0x8f,0x20,0xf1,0x3e,0x16,0x00,0xa8,0x19,0x00,0x10,0x76,0x03,0xe2,0x3e,0x90,0x45,0x38,0x01,0x42,0x05,0x88,0x44,0x67,0x15,0x70,0x41,0x38,0x04,0x10,0x24,0x03,0x00,0x10,0x20,0x4a,0x46,0xe9,0x46,0xe1,0x04,0x50,0x66,0x40,0x85,0x19,0x98,0x00,0xc0,};
|
||||
const uint8_t* const _I_DoorRight_70x55[] = {_I_DoorRight_70x55_0};
|
||||
|
||||
const uint8_t _I_PassportBottom_128x17_0[] = {0x01,0x00,0x5e,0x00,0x96,0x01,0x97,0xe1,0xff,0x00,0x2e,0x3e,0x68,0x0f,0x5a,0xc5,0x54,0x00,0xb9,0x50,0xfb,0x6a,0x35,0x40,0x05,0xcd,0x4e,0x03,0xfd,0x30,0x0f,0xf8,0x7f,0xa0,0x81,0xfe,0xf9,0x1b,0xfb,0xf3,0x01,0x47,0x66,0x02,0x1b,0x03,0x07,0xe7,0x02,0x0b,0x02,0x07,0xe5,0x82,0x0b,0xf2,0x1c,0xb0,0x01,0x67,0xf0,0x5f,0xd0,0x3f,0x23,0xf0,0x9b,0xc9,0xe5,0x80,0x03,0xd5,0xc0,0x00,0x86,0x01,0xf3,0xe6,0x1e,0x58,0x00,0x36,0xa8,0x06,0xac,0x04,0x30,0x6c,0x30,0xee,0x60,0x1f,0xe0,0x10,0xff,0x0d,0xfb,0x00,};
|
||||
const uint8_t* const _I_PassportBottom_128x17[] = {_I_PassportBottom_128x17_0};
|
||||
|
||||
const uint8_t _I_PassportLeft_6x47_0[] = {0x01,0x00,0x1c,0x00,0x9e,0x40,0xa3,0x32,0x59,0x2c,0x66,0x03,0x01,0x82,0xc2,0x62,0x32,0x50,0x16,0xc8,0x60,0x30,0x28,0x24,0x32,0x39,0x3c,0x9e,0x4d,0x25,0x80,0x1a,};
|
||||
const uint8_t* const _I_PassportLeft_6x47[] = {_I_PassportLeft_6x47_0};
|
||||
|
||||
const uint8_t _I_WarningDolphin_45x42_0[] = {0x01,0x00,0xc6,0x00,0x00,0x1c,0x22,0x04,0x05,0x7f,0xfc,0x1e,0x20,0x05,0x1e,0x04,0x02,0x30,0x05,0x29,0x84,0x02,0xc1,0x20,0x02,0x8c,0x22,0x01,0x80,0x02,0x94,0x10,0x32,0x30,0x10,0x10,0x87,0xca,0x84,0x03,0x10,0x42,0x81,0x48,0x28,0x38,0x08,0x04,0x3e,0x01,0x84,0x83,0xe0,0x30,0x11,0x08,0x05,0xa2,0x11,0x40,0xa0,0x4b,0xc6,0xc5,0x40,0xd0,0x56,0xe0,0x10,0x60,0x29,0x54,0xf0,0x10,0x18,0xf0,0x14,0x6b,0xf6,0x0c,0x04,0x3e,0x40,0x05,0x12,0x80,0xc1,0xe4,0x01,0xd2,0xf8,0x40,0xe4,0x18,0x09,0xf4,0x03,0xf1,0x01,0x90,0x40,0x28,0x30,0x0f,0xe4,0x00,0x16,0x24,0x11,0xbf,0x01,0x44,0xee,0x53,0xf0,0x29,0xf0,0x3e,0x02,0x91,0x3b,0x8c,0xc3,0x81,0x13,0x90,0x48,0x20,0x3f,0xf9,0xfc,0x42,0x60,0x05,0x10,0x98,0x81,0x56,0x11,0x38,0x02,0x9c,0x1a,0x31,0x1e,0x02,0x8f,0x02,0x03,0x1c,0x90,0xc0,0x7c,0x02,0xf1,0xce,0x02,0x07,0x01,0x1f,0x80,0x63,0xa8,0x08,0x71,0x3c,0x8e,0x39,0x24,0x40,0x51,0xc7,0x81,0x53,0x0f,0x3c,0x02,0x9d,0x1e,0x38,0x29,0x10,0x29,0x17,0xc8,0x0a,0x32,0x3a,0x00,0x14,0x4b,0xa2,0x05,0x58,0x98,0x15,0x22,0x20,0x54,0x84,0x81,0x50,};
|
||||
const uint8_t* const _I_WarningDolphin_45x42[] = {_I_WarningDolphin_45x42_0};
|
||||
|
||||
const uint8_t _I_KeyBackspaceSelected_16x9_0[] = {0x00,0xFE,0x7F,0xFF,0xFF,0xEF,0xFF,0xE7,0xFF,0x03,0xC0,0xE7,0xFF,0xEF,0xFF,0xFF,0xFF,0xFE,0x7F,};
|
||||
const uint8_t* const _I_KeyBackspaceSelected_16x9[] = {_I_KeyBackspaceSelected_16x9_0};
|
||||
|
||||
|
@ -718,24 +718,17 @@ const Icon I_ArrowDownEmpty_14x15 = {.width=14,.height=15,.frame_count=1,.frame_
|
|||
const Icon I_ArrowDownFilled_14x15 = {.width=14,.height=15,.frame_count=1,.frame_rate=0,.frames=_I_ArrowDownFilled_14x15};
|
||||
const Icon I_ArrowUpEmpty_14x15 = {.width=14,.height=15,.frame_count=1,.frame_rate=0,.frames=_I_ArrowUpEmpty_14x15};
|
||||
const Icon I_ArrowUpFilled_14x15 = {.width=14,.height=15,.frame_count=1,.frame_rate=0,.frames=_I_ArrowUpFilled_14x15};
|
||||
const Icon I_Back3_45x8 = {.width=45,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Back3_45x8};
|
||||
const Icon I_DoorLeft_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorLeft_70x55};
|
||||
const Icon I_DoorLocked_10x56 = {.width=10,.height=56,.frame_count=1,.frame_rate=0,.frames=_I_DoorLocked_10x56};
|
||||
const Icon I_DoorRight_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorRight_70x55};
|
||||
const Icon I_PassportBottom_128x17 = {.width=128,.height=17,.frame_count=1,.frame_rate=0,.frames=_I_PassportBottom_128x17};
|
||||
const Icon I_PassportLeft_6x47 = {.width=6,.height=47,.frame_count=1,.frame_rate=0,.frames=_I_PassportLeft_6x47};
|
||||
const Icon I_WarningDolphin_45x42 = {.width=45,.height=42,.frame_count=1,.frame_rate=0,.frames=_I_WarningDolphin_45x42};
|
||||
const Icon I_Back_15x10 = {.width=15,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Back_15x10};
|
||||
const Icon I_DolphinReadingSuccess_59x63 = {.width=59,.height=63,.frame_count=1,.frame_rate=0,.frames=_I_DolphinReadingSuccess_59x63};
|
||||
const Icon I_Down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_25x27};
|
||||
const Icon I_Down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_hvr_25x27};
|
||||
const Icon I_Fill_marker_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_Fill_marker_7x7};
|
||||
const Icon I_IrdaArrowDown_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowDown_4x8};
|
||||
const Icon I_IrdaArrowUp_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowUp_4x8};
|
||||
const Icon I_IrdaLearnShort_128x31 = {.width=128,.height=31,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearnShort_128x31};
|
||||
const Icon I_IrdaLearn_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearn_128x64};
|
||||
const Icon I_IrdaSendShort_128x34 = {.width=128,.height=34,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSendShort_128x34};
|
||||
const Icon I_IrdaSend_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSend_128x64};
|
||||
const Icon I_InfraredArrowDown_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_InfraredArrowDown_4x8};
|
||||
const Icon I_InfraredArrowUp_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_InfraredArrowUp_4x8};
|
||||
const Icon I_InfraredLearnShort_128x31 = {.width=128,.height=31,.frame_count=1,.frame_rate=0,.frames=_I_InfraredLearnShort_128x31};
|
||||
const Icon I_InfraredLearn_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_InfraredLearn_128x64};
|
||||
const Icon I_InfraredSendShort_128x34 = {.width=128,.height=34,.frame_count=1,.frame_rate=0,.frames=_I_InfraredSendShort_128x34};
|
||||
const Icon I_InfraredSend_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_InfraredSend_128x64};
|
||||
const Icon I_Mute_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_25x27};
|
||||
const Icon I_Mute_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_hvr_25x27};
|
||||
const Icon I_Power_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_25x27};
|
||||
|
@ -746,6 +739,13 @@ const Icon I_Vol_down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0
|
|||
const Icon I_Vol_down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_hvr_25x27};
|
||||
const Icon I_Vol_up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_25x27};
|
||||
const Icon I_Vol_up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_hvr_25x27};
|
||||
const Icon I_Back3_45x8 = {.width=45,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Back3_45x8};
|
||||
const Icon I_DoorLeft_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorLeft_70x55};
|
||||
const Icon I_DoorLocked_10x56 = {.width=10,.height=56,.frame_count=1,.frame_rate=0,.frames=_I_DoorLocked_10x56};
|
||||
const Icon I_DoorRight_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorRight_70x55};
|
||||
const Icon I_PassportBottom_128x17 = {.width=128,.height=17,.frame_count=1,.frame_rate=0,.frames=_I_PassportBottom_128x17};
|
||||
const Icon I_PassportLeft_6x47 = {.width=6,.height=47,.frame_count=1,.frame_rate=0,.frames=_I_PassportLeft_6x47};
|
||||
const Icon I_WarningDolphin_45x42 = {.width=45,.height=42,.frame_count=1,.frame_rate=0,.frames=_I_WarningDolphin_45x42};
|
||||
const Icon I_KeyBackspaceSelected_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspaceSelected_16x9};
|
||||
const Icon I_KeyBackspace_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspace_16x9};
|
||||
const Icon I_KeySaveSelected_24x11 = {.width=24,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_KeySaveSelected_24x11};
|
||||
|
|
|
@ -59,24 +59,17 @@ extern const Icon I_ArrowDownEmpty_14x15;
|
|||
extern const Icon I_ArrowDownFilled_14x15;
|
||||
extern const Icon I_ArrowUpEmpty_14x15;
|
||||
extern const Icon I_ArrowUpFilled_14x15;
|
||||
extern const Icon I_Back3_45x8;
|
||||
extern const Icon I_DoorLeft_70x55;
|
||||
extern const Icon I_DoorLocked_10x56;
|
||||
extern const Icon I_DoorRight_70x55;
|
||||
extern const Icon I_PassportBottom_128x17;
|
||||
extern const Icon I_PassportLeft_6x47;
|
||||
extern const Icon I_WarningDolphin_45x42;
|
||||
extern const Icon I_Back_15x10;
|
||||
extern const Icon I_DolphinReadingSuccess_59x63;
|
||||
extern const Icon I_Down_25x27;
|
||||
extern const Icon I_Down_hvr_25x27;
|
||||
extern const Icon I_Fill_marker_7x7;
|
||||
extern const Icon I_IrdaArrowDown_4x8;
|
||||
extern const Icon I_IrdaArrowUp_4x8;
|
||||
extern const Icon I_IrdaLearnShort_128x31;
|
||||
extern const Icon I_IrdaLearn_128x64;
|
||||
extern const Icon I_IrdaSendShort_128x34;
|
||||
extern const Icon I_IrdaSend_128x64;
|
||||
extern const Icon I_InfraredArrowDown_4x8;
|
||||
extern const Icon I_InfraredArrowUp_4x8;
|
||||
extern const Icon I_InfraredLearnShort_128x31;
|
||||
extern const Icon I_InfraredLearn_128x64;
|
||||
extern const Icon I_InfraredSendShort_128x34;
|
||||
extern const Icon I_InfraredSend_128x64;
|
||||
extern const Icon I_Mute_25x27;
|
||||
extern const Icon I_Mute_hvr_25x27;
|
||||
extern const Icon I_Power_25x27;
|
||||
|
@ -87,6 +80,13 @@ extern const Icon I_Vol_down_25x27;
|
|||
extern const Icon I_Vol_down_hvr_25x27;
|
||||
extern const Icon I_Vol_up_25x27;
|
||||
extern const Icon I_Vol_up_hvr_25x27;
|
||||
extern const Icon I_Back3_45x8;
|
||||
extern const Icon I_DoorLeft_70x55;
|
||||
extern const Icon I_DoorLocked_10x56;
|
||||
extern const Icon I_DoorRight_70x55;
|
||||
extern const Icon I_PassportBottom_128x17;
|
||||
extern const Icon I_PassportLeft_6x47;
|
||||
extern const Icon I_WarningDolphin_45x42;
|
||||
extern const Icon I_KeyBackspaceSelected_16x9;
|
||||
extern const Icon I_KeyBackspace_16x9;
|
||||
extern const Icon I_KeySaveSelected_24x11;
|
||||
|
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
@ -34,8 +34,8 @@ const GpioPin gpio_rfid_pull = {.port = RFID_PULL_GPIO_Port, .pin = RFID_PULL_Pi
|
|||
const GpioPin gpio_rfid_carrier_out = {.port = RFID_OUT_GPIO_Port, .pin = RFID_OUT_Pin};
|
||||
const GpioPin gpio_rfid_data_in = {.port = RFID_RF_IN_GPIO_Port, .pin = RFID_RF_IN_Pin};
|
||||
|
||||
const GpioPin gpio_irda_rx = {.port = IR_RX_GPIO_Port, .pin = IR_RX_Pin};
|
||||
const GpioPin gpio_irda_tx = {.port = IR_TX_GPIO_Port, .pin = IR_TX_Pin};
|
||||
const GpioPin gpio_infrared_rx = {.port = IR_RX_GPIO_Port, .pin = IR_RX_Pin};
|
||||
const GpioPin gpio_infrared_tx = {.port = IR_TX_GPIO_Port, .pin = IR_TX_Pin};
|
||||
|
||||
const GpioPin gpio_usart_tx = {.port = USART1_TX_Port, .pin = USART1_TX_Pin};
|
||||
const GpioPin gpio_usart_rx = {.port = USART1_RX_Port, .pin = USART1_RX_Pin};
|
||||
|
|
|
@ -59,8 +59,8 @@ extern const GpioPin gpio_rfid_pull;
|
|||
extern const GpioPin gpio_rfid_carrier_out;
|
||||
extern const GpioPin gpio_rfid_data_in;
|
||||
|
||||
extern const GpioPin gpio_irda_rx;
|
||||
extern const GpioPin gpio_irda_tx;
|
||||
extern const GpioPin gpio_infrared_rx;
|
||||
extern const GpioPin gpio_infrared_tx;
|
||||
|
||||
extern const GpioPin gpio_usart_tx;
|
||||
extern const GpioPin gpio_usart_rx;
|
||||
|
|
|
@ -34,8 +34,8 @@ const GpioPin gpio_rfid_pull = {.port = RFID_PULL_GPIO_Port, .pin = RFID_PULL_Pi
|
|||
const GpioPin gpio_rfid_carrier_out = {.port = RFID_OUT_GPIO_Port, .pin = RFID_OUT_Pin};
|
||||
const GpioPin gpio_rfid_data_in = {.port = RFID_RF_IN_GPIO_Port, .pin = RFID_RF_IN_Pin};
|
||||
|
||||
const GpioPin gpio_irda_rx = {.port = IR_RX_GPIO_Port, .pin = IR_RX_Pin};
|
||||
const GpioPin gpio_irda_tx = {.port = IR_TX_GPIO_Port, .pin = IR_TX_Pin};
|
||||
const GpioPin gpio_infrared_rx = {.port = IR_RX_GPIO_Port, .pin = IR_RX_Pin};
|
||||
const GpioPin gpio_infrared_tx = {.port = IR_TX_GPIO_Port, .pin = IR_TX_Pin};
|
||||
|
||||
const GpioPin gpio_usart_tx = {.port = USART1_TX_Port, .pin = USART1_TX_Pin};
|
||||
const GpioPin gpio_usart_rx = {.port = USART1_RX_Port, .pin = USART1_RX_Pin};
|
||||
|
|
|
@ -59,8 +59,8 @@ extern const GpioPin gpio_rfid_pull;
|
|||
extern const GpioPin gpio_rfid_carrier_out;
|
||||
extern const GpioPin gpio_rfid_data_in;
|
||||
|
||||
extern const GpioPin gpio_irda_rx;
|
||||
extern const GpioPin gpio_irda_tx;
|
||||
extern const GpioPin gpio_infrared_rx;
|
||||
extern const GpioPin gpio_infrared_tx;
|
||||
|
||||
extern const GpioPin gpio_usart_tx;
|
||||
extern const GpioPin gpio_usart_rx;
|
||||
|
|