diff options
author | Georgii Surkov <37121527+gsurkov@users.noreply.github.com> | 2022-07-17 12:21:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 12:21:56 +0300 |
commit | 80629de01ecc6cee5a811ba647479117f17b8374 (patch) | |
tree | 0f972b62182791306f8c01d32f8bea407a2a34e0 /applications | |
parent | 877c5c812236337756bd8dba8694ac0ccf53da66 (diff) |
[FL-2601] Move Infrared unit test data to assets (#1396)
* Move samsung raw data to assets
* Add more assets and fix bugs
* Clean up code
* Implement all raw data as assets
* Remove input data from old test files
* Better signal names
* Better file opening logic
* Implement loading parsed data from files
* Move most of RC5 tests into assets
* Add more test cases
* Add more test cases
* Eliminate RUN_DECODER macro
* Better code structure
* Implement run_encoder function
* More encoder tests
* Move all encoder tests to assets
* Move all test data to assets
* Normalise function names
* Rename code files
* Uncomment other tests
* Swich test order to avoid weird memory leaks
* UnitTests: cleanup output and redirect it into stdout
* UnitTests: selectable tests and better reporting
Co-authored-by: あく <alleteam@gmail.com>
Diffstat (limited to 'applications')
14 files changed, 580 insertions, 2015 deletions
diff --git a/applications/unit_tests/furi_memmgr_test.c b/applications/unit_tests/furi/furi_memmgr_test.c index 732856ec..b0fd060c 100644 --- a/applications/unit_tests/furi_memmgr_test.c +++ b/applications/unit_tests/furi/furi_memmgr_test.c @@ -1,4 +1,4 @@ -#include "minunit.h" +#include "../minunit.h" #include <stdlib.h> #include <string.h> #include <stdbool.h> diff --git a/applications/unit_tests/furi_pubsub_test.c b/applications/unit_tests/furi/furi_pubsub_test.c index 57c970b8..ddaeb746 100644 --- a/applications/unit_tests/furi_pubsub_test.c +++ b/applications/unit_tests/furi/furi_pubsub_test.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <string.h> #include <furi.h> -#include "minunit.h" +#include "../minunit.h" const uint32_t context_value = 0xdeadbeef; const uint32_t notify_value_0 = 0x12345678; diff --git a/applications/unit_tests/furi_record_test.c b/applications/unit_tests/furi/furi_record_test.c index e7eebe4b..512ddfdc 100644 --- a/applications/unit_tests/furi_record_test.c +++ b/applications/unit_tests/furi/furi_record_test.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <string.h> #include <furi.h> -#include "minunit.h" +#include "../minunit.h" void test_furi_create_open() { // 1. Create record diff --git a/applications/unit_tests/minunit_test.c b/applications/unit_tests/furi/furi_test.c index 9d564df6..eed9e420 100644 --- a/applications/unit_tests/minunit_test.c +++ b/applications/unit_tests/furi/furi_test.c @@ -1,6 +1,7 @@ #include <stdio.h> #include <furi.h> -#include "minunit.h" +#include <furi_hal.h> +#include "../minunit.h" // v2 tests void test_furi_create_open(); @@ -55,7 +56,7 @@ MU_TEST_SUITE(test_suite) { MU_RUN_TEST(mu_test_furi_memmgr); } -int run_minunit() { +int run_minunit_test_furi() { MU_RUN_SUITE(test_suite); return MU_EXIT_CODE; diff --git a/applications/unit_tests/furi_valuemutex_test.c b/applications/unit_tests/furi/furi_valuemutex_test.c index 12613239..ed98be32 100644 --- a/applications/unit_tests/furi_valuemutex_test.c +++ b/applications/unit_tests/furi/furi_valuemutex_test.c @@ -3,7 +3,7 @@ #include <furi.h> #include "furi_hal_delay.h" -#include "minunit.h" +#include "../minunit.h" void test_furi_valuemutex() { const int init_value = 0xdeadbeef; diff --git a/applications/unit_tests/infrared/infrared_test.c b/applications/unit_tests/infrared/infrared_test.c new file mode 100644 index 00000000..312305b6 --- /dev/null +++ b/applications/unit_tests/infrared/infrared_test.c @@ -0,0 +1,520 @@ +#include <furi.h> +#include <flipper_format.h> +#include <infrared.h> +#include <common/infrared_common_i.h> +#include "../minunit.h" + +#define IR_TEST_FILES_DIR "/ext/unit_tests/infrared/" +#define IR_TEST_FILE_PREFIX "test_" +#define IR_TEST_FILE_SUFFIX ".irtest" + +typedef struct { + InfraredDecoderHandler* decoder_handler; + InfraredEncoderHandler* encoder_handler; + string_t file_path; + FlipperFormat* ff; +} InfraredTest; + +static InfraredTest* test; + +static void infrared_test_alloc() { + Storage* storage = furi_record_open("storage"); + test = malloc(sizeof(InfraredTest)); + test->decoder_handler = infrared_alloc_decoder(); + test->encoder_handler = infrared_alloc_encoder(); + test->ff = flipper_format_file_alloc(storage); + string_init(test->file_path); +} + +static void infrared_test_free() { + furi_assert(test); + infrared_free_decoder(test->decoder_handler); + infrared_free_encoder(test->encoder_handler); + flipper_format_free(test->ff); + string_clear(test->file_path); + furi_record_close("storage"); + free(test); + test = NULL; +} + +static bool infrared_test_prepare_file(const char* protocol_name) { + string_t file_type; + string_init(file_type); + bool success = false; + + string_printf( + test->file_path, + "%s%s%s%s", + IR_TEST_FILES_DIR, + IR_TEST_FILE_PREFIX, + protocol_name, + IR_TEST_FILE_SUFFIX); + + do { + uint32_t format_version; + if(!flipper_format_file_open_existing(test->ff, string_get_cstr(test->file_path))) break; + if(!flipper_format_read_header(test->ff, file_type, &format_version)) break; + if(string_cmp_str(file_type, "IR tests file") || format_version != 1) break; + success = true; + } while(false); + + string_clear(file_type); + return success; +} + +static bool infrared_test_load_raw_signal( + FlipperFormat* ff, + const char* signal_name, + uint32_t** timings, + uint32_t* timings_count) { + string_t buf; + string_init(buf); + bool success = false; + + do { + bool is_name_found = false; + for(; !is_name_found && flipper_format_read_string(ff, "name", buf); + is_name_found = !string_cmp_str(buf, signal_name)) + ; + + if(!is_name_found) break; + if(!flipper_format_read_string(ff, "type", buf) || string_cmp_str(buf, "raw")) break; + if(!flipper_format_get_value_count(ff, "data", timings_count)) break; + if(!*timings_count) break; + + *timings = malloc(*timings_count * sizeof(uint32_t*)); + if(!flipper_format_read_uint32(ff, "data", *timings, *timings_count)) { + free(*timings); + break; + } + success = true; + } while(false); + + string_clear(buf); + return success; +} + +static bool infrared_test_read_message(FlipperFormat* ff, InfraredMessage* message) { + string_t buf; + string_init(buf); + bool success = false; + + do { + if(!flipper_format_read_string(ff, "protocol", buf)) break; + message->protocol = infrared_get_protocol_by_name(string_get_cstr(buf)); + if(!infrared_is_protocol_valid(message->protocol)) break; + if(!flipper_format_read_hex(ff, "address", (uint8_t*)&message->address, sizeof(uint32_t))) + break; + if(!flipper_format_read_hex(ff, "command", (uint8_t*)&message->command, sizeof(uint32_t))) + break; + if(!flipper_format_read_bool(ff, "repeat", &message->repeat, 1)) break; + success = true; + } while(false); + + string_clear(buf); + return success; +} + +static bool infrared_test_load_messages( + FlipperFormat* ff, + const char* signal_name, + InfraredMessage** messages, + uint32_t* messages_count) { + string_t buf; + string_init(buf); + bool success = false; + + do { + bool is_name_found = false; + for(; !is_name_found && flipper_format_read_string(ff, "name", buf); + is_name_found = !string_cmp_str(buf, signal_name)) + ; + + if(!is_name_found) break; + if(!flipper_format_read_string(ff, "type", buf) || string_cmp_str(buf, "parsed_array")) + break; + if(!flipper_format_read_uint32(ff, "count", messages_count, 1)) break; + if(!*messages_count) break; + + *messages = malloc(*messages_count * sizeof(InfraredMessage)); + uint32_t i; + for(i = 0; i < *messages_count; ++i) { + if(!infrared_test_read_message(ff, (*messages) + i)) { + break; + } + } + if(*messages_count != i) { + free(*messages); + break; + } + success = true; + } while(false); + + string_clear(buf); + return success; +} + +static void infrared_test_compare_message_results( + 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 == InfraredProtocolSIRC) || + (message_expected->protocol == InfraredProtocolSIRC15) || + (message_expected->protocol == InfraredProtocolSIRC20)) { + mu_check(message_decoded->repeat == false); + } else { + mu_check(message_decoded->repeat == message_expected->repeat); + } +} + +/* Encodes signal and merges same levels (high+high, low+low) */ +static void infrared_test_run_encoder_fill_array( + InfraredEncoderHandler* handler, + uint32_t* timings, + uint32_t* timings_len, + bool* start_level) { + uint32_t duration = 0; + bool level = false; + bool level_read; + InfraredStatus status = InfraredStatusError; + size_t i = 0; + bool first = true; + + while(1) { + status = infrared_encode(handler, &duration, &level_read); + if(first) { + if(start_level) *start_level = level_read; + first = false; + timings[0] = 0; + } else if(level_read != level) { + ++i; + furi_check(i < *timings_len); + timings[i] = 0; + } + level = level_read; + timings[i] += duration; + + furi_check((status == InfraredStatusOk) || (status == InfraredStatusDone)); + if(status == InfraredStatusDone) break; + } + + *timings_len = i + 1; +} + +// messages in input array for encoder should have one protocol +static void infrared_test_run_encoder(InfraredProtocol protocol, uint32_t test_index) { + uint32_t* timings; + uint32_t timings_count = 200; + uint32_t* expected_timings; + uint32_t expected_timings_count; + InfraredMessage* input_messages; + uint32_t input_messages_count; + + string_t buf; + string_init(buf); + + const char* protocol_name = infrared_get_protocol_name(protocol); + mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file"); + + string_printf(buf, "encoder_input%d", test_index); + mu_assert( + infrared_test_load_messages( + test->ff, string_get_cstr(buf), &input_messages, &input_messages_count), + "Failed to load messages from file"); + + string_printf(buf, "encoder_expected%d", test_index); + mu_assert( + infrared_test_load_raw_signal( + test->ff, string_get_cstr(buf), &expected_timings, &expected_timings_count), + "Failed to load raw signal from file"); + + flipper_format_file_close(test->ff); + string_clear(buf); + + uint32_t j = 0; + timings = malloc(sizeof(uint32_t) * timings_count); + + for(uint32_t message_counter = 0; message_counter < input_messages_count; ++message_counter) { + const InfraredMessage* message = &input_messages[message_counter]; + if(!message->repeat) { + infrared_reset_encoder(test->encoder_handler, message); + } + + timings_count = 200; + infrared_test_run_encoder_fill_array(test->encoder_handler, timings, &timings_count, NULL); + furi_check(timings_count <= 200); + + for(size_t i = 0; i < timings_count; ++i, ++j) { + mu_check(MATCH_TIMING(timings[i], expected_timings[j], 120)); + mu_assert(j < expected_timings_count, "encoded more timings than expected"); + } + } + + free(input_messages); + free(expected_timings); + free(timings); + + mu_assert(j == expected_timings_count, "encoded less timings than expected"); +} + +static void infrared_test_run_encoder_decoder(InfraredProtocol protocol, uint32_t test_index) { + uint32_t* timings = 0; + uint32_t timings_count = 200; + InfraredMessage* input_messages; + uint32_t input_messages_count; + bool level = false; + + string_t buf; + string_init(buf); + + timings = malloc(sizeof(uint32_t) * timings_count); + + const char* protocol_name = infrared_get_protocol_name(protocol); + mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file"); + + string_printf(buf, "encoder_decoder_input%d", test_index); + mu_assert( + infrared_test_load_messages( + test->ff, string_get_cstr(buf), &input_messages, &input_messages_count), + "Failed to load messages from file"); + + flipper_format_file_close(test->ff); + string_clear(buf); + + for(uint32_t message_counter = 0; message_counter < input_messages_count; ++message_counter) { + const InfraredMessage* message_encoded = &input_messages[message_counter]; + if(!message_encoded->repeat) { + infrared_reset_encoder(test->encoder_handler, message_encoded); + } + + timings_count = 200; + infrared_test_run_encoder_fill_array( + test->encoder_handler, timings, &timings_count, &level); + furi_check(timings_count <= 200); + + const InfraredMessage* message_decoded = 0; + for(size_t i = 0; i < timings_count; ++i) { + message_decoded = infrared_decode(test->decoder_handler, level, timings[i]); + if((i == timings_count - 2) && level && message_decoded) { + /* In case we end with space timing - message can be decoded at last mark */ + break; + } else if(i < timings_count - 1) { + mu_check(!message_decoded); + } else { + if(!message_decoded) { + message_decoded = infrared_check_decoder_ready(test->decoder_handler); + } + mu_check(message_decoded); + } + level = !level; + } + if(message_decoded) { + infrared_test_compare_message_results(message_decoded, message_encoded); + } else { + mu_check(0); + } + } + free(input_messages); + free(timings); +} + +static void infrared_test_run_decoder(InfraredProtocol protocol, uint32_t test_index) { + uint32_t* timings; + uint32_t timings_count; + InfraredMessage* messages; + uint32_t messages_count; + + string_t buf; + string_init(buf); + + mu_assert( + infrared_test_prepare_file(infrared_get_protocol_name(protocol)), + "Failed to prepare test file"); + + string_printf(buf, "decoder_input%d", test_index); + mu_assert( + infrared_test_load_raw_signal(test->ff, string_get_cstr(buf), &timings, &timings_count), + "Failed to load raw signal from file"); + + string_printf(buf, "decoder_expected%d", test_index); + mu_assert( + infrared_test_load_messages(test->ff, string_get_cstr(buf), &messages, &messages_count), + "Failed to load messages from file"); + + flipper_format_file_close(test->ff); + string_clear(buf); + + InfraredMessage message_decoded_check_local; + bool level = 0; + uint32_t message_counter = 0; + const InfraredMessage* message_decoded = 0; + + for(uint32_t i = 0; i < timings_count; ++i) { + const InfraredMessage* message_decoded_check = 0; + + if(timings[i] > INFRARED_RAW_RX_TIMING_DELAY_US) { + message_decoded_check = infrared_check_decoder_ready(test->decoder_handler); + if(message_decoded_check) { + /* 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 = infrared_decode(test->decoder_handler, level, timings[i]); + + if(message_decoded_check || message_decoded) { + mu_assert( + !(message_decoded_check && message_decoded), + "both messages decoded: check_ready() and infrared_decode()"); + + if(message_decoded_check) { + message_decoded = message_decoded_check; + } + + mu_assert(message_counter < messages_count, "decoded more than expected"); + infrared_test_compare_message_results(message_decoded, &messages[message_counter]); + + ++message_counter; + } + level = !level; + } + + message_decoded = infrared_check_decoder_ready(test->decoder_handler); + if(message_decoded) { + infrared_test_compare_message_results(message_decoded, &messages[message_counter]); + ++message_counter; + } + + free(timings); + free(messages); + + mu_assert(message_counter == messages_count, "decoded less than expected"); +} + +MU_TEST(infrared_test_decoder_samsung32) { + infrared_test_run_decoder(InfraredProtocolSamsung32, 1); +} + +MU_TEST(infrared_test_decoder_mixed) { + infrared_test_run_decoder(InfraredProtocolRC5, 2); + infrared_test_run_decoder(InfraredProtocolSIRC, 1); + infrared_test_run_decoder(InfraredProtocolNECext, 1); + infrared_test_run_decoder(InfraredProtocolRC6, 2); + infrared_test_run_decoder(InfraredProtocolSamsung32, 1); + infrared_test_run_decoder(InfraredProtocolRC6, 1); + infrared_test_run_decoder(InfraredProtocolSamsung32, 1); + infrared_test_run_decoder(InfraredProtocolRC5, 1); + infrared_test_run_decoder(InfraredProtocolSIRC, 2); + infrared_test_run_decoder(InfraredProtocolNECext, 1); + infrared_test_run_decoder(InfraredProtocolSIRC, 4); + infrared_test_run_decoder(InfraredProtocolNEC, 2); + infrared_test_run_decoder(InfraredProtocolRC6, 1); + infrared_test_run_decoder(InfraredProtocolNECext, 1); + infrared_test_run_decoder(InfraredProtocolSIRC, 5); + infrared_test_run_decoder(InfraredProtocolNEC, 3); + infrared_test_run_decoder(InfraredProtocolRC5, 5); + infrared_test_run_decoder(InfraredProtocolSamsung32, 1); + infrared_test_run_decoder(InfraredProtocolSIRC, 3); +} + +MU_TEST(infrared_test_decoder_nec) { + infrared_test_run_decoder(InfraredProtocolNEC, 1); + infrared_test_run_decoder(InfraredProtocolNEC, 2); + infrared_test_run_decoder(InfraredProtocolNEC, 3); +} + +MU_TEST(infrared_test_decoder_unexpected_end_in_sequence) { + infrared_test_run_decoder(InfraredProtocolNEC, 1); + infrared_test_run_decoder(InfraredProtocolNEC, 1); + infrared_test_run_decoder(InfraredProtocolNEC, 2); + infrared_test_run_decoder(InfraredProtocolNEC, 2); +} + +MU_TEST(infrared_test_decoder_necext1) { + infrared_test_run_decoder(InfraredProtocolNECext, 1); + infrared_test_run_decoder(InfraredProtocolNECext, 1); +} + +MU_TEST(infrared_test_decoder_long_packets_with_nec_start) { + infrared_test_run_decoder(InfraredProtocolNEC42ext, 1); + infrared_test_run_decoder(InfraredProtocolNEC42ext, 2); +} + +MU_TEST(infrared_test_encoder_sirc) { + infrared_test_run_encoder(InfraredProtocolSIRC, 1); + infrared_test_run_encoder(InfraredProtocolSIRC, 2); +} + +MU_TEST(infrared_test_decoder_sirc) { + infrared_test_run_decoder(InfraredProtocolSIRC, 3); + infrared_test_run_decoder(InfraredProtocolSIRC, 1); + infrared_test_run_decoder(InfraredProtocolSIRC, 2); + infrared_test_run_decoder(InfraredProtocolSIRC, 4); + infrared_test_run_decoder(InfraredProtocolSIRC, 5); +} + +MU_TEST(infrared_test_decoder_rc5) { + infrared_test_run_decoder(InfraredProtocolRC5X, 1); + infrared_test_run_decoder(InfraredProtocolRC5, 1); + infrared_test_run_decoder(InfraredProtocolRC5, 2); + infrared_test_run_decoder(InfraredProtocolRC5, 3); + infrared_test_run_decoder(InfraredProtocolRC5, 4); + infrared_test_run_decoder(InfraredProtocolRC5, 5); + infrared_test_run_decoder(InfraredProtocolRC5, 6); + infrared_test_run_decoder(InfraredProtocolRC5, 7); +} + +MU_TEST(infrared_test_encoder_rc5x) { + infrared_test_run_encoder(InfraredProtocolRC5X, 1); +} + +MU_TEST(infrared_test_encoder_rc5) { + infrared_test_run_encoder(InfraredProtocolRC5, 1); +} + +MU_TEST(infrared_test_decoder_rc6) { + infrared_test_run_decoder(InfraredProtocolRC6, 1); +} + +MU_TEST(infrared_test_encoder_rc6) { + infrared_test_run_encoder(InfraredProtocolRC6, 1); +} + +MU_TEST(infrared_test_encoder_decoder_all) { + infrared_test_run_encoder_decoder(InfraredProtocolNEC, 1); + infrared_test_run_encoder_decoder(InfraredProtocolNECext, 1); + infrared_test_run_encoder_decoder(InfraredProtocolNEC42, 1); + infrared_test_run_encoder_decoder(InfraredProtocolNEC42ext, 1); + infrared_test_run_encoder_decoder(InfraredProtocolSamsung32, 1); + infrared_test_run_encoder_decoder(InfraredProtocolRC6, 1); + infrared_test_run_encoder_decoder(InfraredProtocolRC5, 1); + infrared_test_run_encoder_decoder(InfraredProtocolSIRC, 1); +} + +MU_TEST_SUITE(infrared_test) { + MU_SUITE_CONFIGURE(&infrared_test_alloc, &infrared_test_free); + + MU_RUN_TEST(infrared_test_encoder_sirc); + MU_RUN_TEST(infrared_test_decoder_sirc); + MU_RUN_TEST(infrared_test_encoder_rc5x); + MU_RUN_TEST(infrared_test_encoder_rc5); + MU_RUN_TEST(infrared_test_decoder_rc5); + MU_RUN_TEST(infrared_test_decoder_rc6); + MU_RUN_TEST(infrared_test_encoder_rc6); + MU_RUN_TEST(infrared_test_decoder_unexpected_end_in_sequence); + MU_RUN_TEST(infrared_test_decoder_long_packets_with_nec_start); + MU_RUN_TEST(infrared_test_decoder_nec); + MU_RUN_TEST(infrared_test_decoder_samsung32); + MU_RUN_TEST(infrared_test_decoder_necext1); + MU_RUN_TEST(infrared_test_decoder_mixed); + MU_RUN_TEST(infrared_test_encoder_decoder_all); +} + +int run_minunit_test_infrared() { + MU_RUN_SUITE(infrared_test); + return MU_EXIT_CODE; +} diff --git a/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c b/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c deleted file mode 100644 index 0c3e685d..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c +++ /dev/null @@ -1,331 +0,0 @@ -#include <furi.h> -#include "../minunit.h" -#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)) - -#define RUN_DECODER(data, expected) \ - run_decoder((data), COUNT_OF(data), (expected), COUNT_OF(expected)) - -#define RUN_ENCODER_DECODER(data) run_encoder_decoder((data), COUNT_OF(data)) - -static InfraredDecoderHandler* decoder_handler; -static InfraredEncoderHandler* encoder_handler; - -static void test_setup(void) { - decoder_handler = infrared_alloc_decoder(); - encoder_handler = infrared_alloc_encoder(); -} - -static void test_teardown(void) { - infrared_free_decoder(decoder_handler); - infrared_free_encoder(encoder_handler); -} - -static void compare_message_results( - 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 == InfraredProtocolSIRC) || - (message_expected->protocol == InfraredProtocolSIRC15) || - (message_expected->protocol == InfraredProtocolSIRC20)) { - mu_check(message_decoded->repeat == false); - } else { - mu_check(message_decoded->repeat == message_expected->repeat); - } -} - -/* Encodes signal and merges same levels (high+high, low+low) */ -static void run_encoder_fill_array( - InfraredEncoderHandler* handler, - uint32_t* timings, - uint32_t* timings_len, - bool* start_level) { - uint32_t duration = 0; - bool level = false; - bool level_read; - InfraredStatus status = InfraredStatusError; - size_t i = 0; - bool first = true; - - while(1) { - status = infrared_encode(handler, &duration, &level_read); - if(first) { - if(start_level) *start_level = level_read; - first = false; - timings[0] = 0; - } else if(level_read != level) { - ++i; - furi_check(i < *timings_len); - timings[i] = 0; - } - level = level_read; - timings[i] += duration; - - furi_check((status == InfraredStatusOk) || (status == InfraredStatusDone)); - if(status == InfraredStatusDone) break; - } - - *timings_len = i + 1; -} - -// messages in input array for encoder should have one protocol -static void run_encoder( - const InfraredMessage input_messages[], - uint32_t input_messages_len, - const uint32_t expected_timings[], - uint32_t expected_timings_len) { - uint32_t* timings = 0; - uint32_t timings_len = 200; - uint32_t j = 0; - timings = malloc(sizeof(uint32_t) * timings_len); - - for(uint32_t message_counter = 0; message_counter < input_messages_len; ++message_counter) { - const InfraredMessage* message = &input_messages[message_counter]; - if(!message->repeat) { - infrared_reset_encoder(encoder_handler, message); - } - - timings_len = 200; - run_encoder_fill_array(encoder_handler, timings, &timings_len, NULL); - furi_check(timings_len <= 200); - - for(size_t i = 0; i < timings_len; ++i, ++j) { - mu_check(MATCH_TIMING(timings[i], expected_timings[j], 120)); - mu_assert(j < expected_timings_len, "encoded more timings than expected"); - } - } - free(timings); - mu_assert(j == expected_timings_len, "encoded less timings than expected"); -} - -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 InfraredMessage* message_encoded = &input_messages[message_counter]; - if(!message_encoded->repeat) { - 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 InfraredMessage* message_decoded = 0; - for(size_t i = 0; i < timings_len; ++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; - } else if(i < timings_len - 1) { - mu_check(!message_decoded); - } else { - if(!message_decoded) { - message_decoded = infrared_check_decoder_ready(decoder_handler); - } - mu_check(message_decoded); - } - level = !level; - } - if(message_decoded) { - compare_message_results(message_decoded, message_encoded); - } else { - mu_check(0); - } - } - free(timings); -} - -static void run_decoder( - const uint32_t* input_delays, - uint32_t input_delays_len, - const InfraredMessage* message_expected, - uint32_t message_expected_len) { - InfraredMessage message_decoded_check_local; - bool level = 0; - uint32_t message_counter = 0; - const InfraredMessage* message_decoded = 0; - - for(uint32_t i = 0; i < input_delays_len; ++i) { - const InfraredMessage* message_decoded_check = 0; - - if(input_delays[i] > INFRARED_RAW_RX_TIMING_DELAY_US) { - message_decoded_check = infrared_check_decoder_ready(decoder_handler); - if(message_decoded_check) { - /* 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 = 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 infrared_decode()"); - - if(message_decoded_check) { - message_decoded = message_decoded_check; - } - - mu_assert(message_counter < message_expected_len, "decoded more than expected"); - compare_message_results(message_decoded, &message_expected[message_counter]); - - ++message_counter; - } - level = !level; - } - - message_decoded = infrared_check_decoder_ready(decoder_handler); - if(message_decoded) { - compare_message_results(message_decoded, &message_expected[message_counter]); - ++message_counter; - } - - mu_assert(message_counter == message_expected_len, "decoded less than expected"); -} - -MU_TEST(test_decoder_samsung32) { - RUN_DECODER(test_decoder_samsung32_input1, test_decoder_samsung32_expected1); -} - -MU_TEST(test_mix) { - RUN_DECODER(test_decoder_rc5_input2, test_decoder_rc5_expected2); - RUN_DECODER(test_decoder_sirc_input1, test_decoder_sirc_expected1); - RUN_DECODER(test_decoder_necext_input1, test_decoder_necext_expected1); - // can use encoder data for decoding, but can't do opposite - RUN_DECODER(test_encoder_rc6_expected1, test_encoder_rc6_input1); - RUN_DECODER(test_decoder_samsung32_input1, test_decoder_samsung32_expected1); - RUN_DECODER(test_decoder_rc6_input1, test_decoder_rc6_expected1); - RUN_DECODER(test_decoder_samsung32_input1, test_decoder_samsung32_expected1); - RUN_DECODER(test_decoder_rc5_input1, test_decoder_rc5_expected1); - RUN_DECODER(test_decoder_sirc_input2, test_decoder_sirc_expected2); - RUN_DECODER(test_decoder_necext_input1, test_decoder_necext_expected1); - RUN_DECODER(test_decoder_sirc_input4, test_decoder_sirc_expected4); - RUN_DECODER(test_decoder_nec_input2, test_decoder_nec_expected2); - RUN_DECODER(test_decoder_rc6_input1, test_decoder_rc6_expected1); - RUN_DECODER(test_decoder_necext_input1, test_decoder_necext_expected1); - RUN_DECODER(test_decoder_sirc_input5, test_decoder_sirc_expected5); - RUN_DECODER(test_decoder_nec_input3, test_decoder_nec_expected3); - RUN_DECODER(test_decoder_rc5_input5, test_decoder_rc5_expected5); - RUN_DECODER(test_decoder_samsung32_input1, test_decoder_samsung32_expected1); - RUN_DECODER(test_decoder_sirc_input3, test_decoder_sirc_expected3); -} - -MU_TEST(test_decoder_nec) { - RUN_DECODER(test_decoder_nec_input1, test_decoder_nec_expected1); - RUN_DECODER(test_decoder_nec_input2, test_decoder_nec_expected2); - RUN_DECODER(test_decoder_nec_input3, test_decoder_nec_expected3); -} - -MU_TEST(test_decoder_unexpected_end_in_sequence) { - // test_decoder_nec_input1 and test_decoder_nec_input2 shuts unexpected - RUN_DECODER(test_decoder_nec_input1, test_decoder_nec_expected1); - RUN_DECODER(test_decoder_nec_input1, test_decoder_nec_expected1); - RUN_DECODER(test_decoder_nec_input2, test_decoder_nec_expected2); - RUN_DECODER(test_decoder_nec_input2, test_decoder_nec_expected2); -} - -MU_TEST(test_decoder_necext1) { - RUN_DECODER(test_decoder_necext_input1, test_decoder_necext_expected1); - RUN_DECODER(test_decoder_necext_input1, test_decoder_necext_expected1); -} - -MU_TEST(test_decoder_long_packets_with_nec_start) { - RUN_DECODER(test_decoder_nec42ext_input1, test_decoder_nec42ext_expected1); - RUN_DECODER(test_decoder_nec42ext_input2, test_decoder_nec42ext_expected2); -} - -MU_TEST(test_encoder_sirc) { - RUN_ENCODER(test_encoder_sirc_input1, test_encoder_sirc_expected1); - RUN_ENCODER(test_encoder_sirc_input2, test_encoder_sirc_expected2); -} - -MU_TEST(test_decoder_sirc) { - RUN_DECODER(test_decoder_sirc_input3, test_decoder_sirc_expected3); - RUN_DECODER(test_decoder_sirc_input1, test_decoder_sirc_expected1); - RUN_DECODER(test_decoder_sirc_input2, test_decoder_sirc_expected2); - RUN_DECODER(test_decoder_sirc_input4, test_decoder_sirc_expected4); - RUN_DECODER(test_decoder_sirc_input5, test_decoder_sirc_expected5); - RUN_ENCODER_DECODER(test_sirc); -} - -MU_TEST(test_decoder_rc5) { - RUN_DECODER(test_decoder_rc5x_input1, test_decoder_rc5x_expected1); - RUN_DECODER(test_decoder_rc5_input1, test_decoder_rc5_expected1); - RUN_DECODER(test_decoder_rc5_input2, test_decoder_rc5_expected2); - RUN_DECODER(test_decoder_rc5_input3, test_decoder_rc5_expected3); - RUN_DECODER(test_decoder_rc5_input4, test_decoder_rc5_expected4); - RUN_DECODER(test_decoder_rc5_input5, test_decoder_rc5_expected5); - RUN_DECODER(test_decoder_rc5_input6, test_decoder_rc5_expected6); - RUN_DECODER(test_decoder_rc5_input_all_repeats, test_decoder_rc5_expected_all_repeats); -} - -MU_TEST(test_encoder_rc5x) { - RUN_ENCODER(test_decoder_rc5x_expected1, test_decoder_rc5x_input1); -} - -MU_TEST(test_encoder_rc5) { - RUN_ENCODER(test_decoder_rc5_expected_all_repeats, test_decoder_rc5_input_all_repeats); -} - -MU_TEST(test_decoder_rc6) { - RUN_DECODER(test_decoder_rc6_input1, test_decoder_rc6_expected1); -} - -MU_TEST(test_encoder_rc6) { - RUN_ENCODER(test_encoder_rc6_input1, test_encoder_rc6_expected1); -} - -MU_TEST(test_encoder_decoder_all) { - RUN_ENCODER_DECODER(test_nec); - RUN_ENCODER_DECODER(test_necext); - RUN_ENCODER_DECODER(test_nec42); - RUN_ENCODER_DECODER(test_nec42ext); - RUN_ENCODER_DECODER(test_samsung32); - RUN_ENCODER_DECODER(test_rc6); - RUN_ENCODER_DECODER(test_rc5); - RUN_ENCODER_DECODER(test_sirc); -} - -MU_TEST_SUITE(test_infrared_decoder_encoder) { - MU_SUITE_CONFIGURE(&test_setup, &test_teardown); - - MU_RUN_TEST(test_encoder_sirc); - MU_RUN_TEST(test_decoder_sirc); - MU_RUN_TEST(test_encoder_rc5x); - MU_RUN_TEST(test_encoder_rc5); - MU_RUN_TEST(test_decoder_rc5); - MU_RUN_TEST(test_decoder_rc6); - MU_RUN_TEST(test_encoder_rc6); - MU_RUN_TEST(test_decoder_unexpected_end_in_sequence); - MU_RUN_TEST(test_decoder_long_packets_with_nec_start); - MU_RUN_TEST(test_decoder_nec); - MU_RUN_TEST(test_decoder_samsung32); - MU_RUN_TEST(test_decoder_necext1); - MU_RUN_TEST(test_mix); - MU_RUN_TEST(test_encoder_decoder_all); -} - -int run_minunit_test_infrared_decoder_encoder() { - MU_RUN_SUITE(test_infrared_decoder_encoder); - - return MU_EXIT_CODE; -} diff --git a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_nec_test_data.srcdata b/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_nec_test_data.srcdata deleted file mode 100644 index ec9a86a6..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_nec_test_data.srcdata +++ /dev/null @@ -1,341 +0,0 @@ -const uint32_t test_decoder_nec_input1[] = { -/* message */ -2640671, 9071, 4445, 601, 497, 578, 500, 604, 501, 603, 502, 581, 496, 615, 498, 606, 499, 584, 493, 610, 1630, 576, 1640, 601, 1615, 605, 1638, 581, 1634, 606, 1610, 610, 1633, 577, 1639, 601, 504, 580, 498, 604, 501, 603, 500, 582, 496, 607, 498, 606, 499, 585, 485, 610, 1633, 576, 1640, 596, 1615, 605, 1638, 582, 1634, 605, 1610, 609, 1634, 586, 1630, 600, -/* repeat */ -40015, 9077, 2208, 593, - -/* message */ -1457713, 9076, 4440, 607, 508, 585, 493, 610, 494, 598, 506, 577, 501, 603, 502, 601, 504, 580, 498, 605, 1638, 582, 1634, 606, 1610, 610, 1633, 577, 1639, 600, 1616, 605, 1638, 582, 1634, 606, 499, 585, 493, 609, 495, 608, 496, 586, 502, 612, 493, 601, 504, 579, 498, 605, 1638, 582, 1633, 606, 1610, 610, 1633, 577, 1639, 602, 1614, 574, 1668, 582, 1634, 606, - -/* 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 InfraredMessage test_decoder_nec_expected1[] = { - {InfraredProtocolNEC, 0x00, 0, false}, - {InfraredProtocolNEC, 0x00, 0, true}, - {InfraredProtocolNEC, 0x00, 0, false}, -}; - -const uint32_t test_decoder_nec_input2[] = { -18372093,9030,4495,559,524,585,526,613,496,560,522,595,524,605,504,553,530,578,524,608,1614,581,1668,557,1665,581,1641,585,1664,551,1671,605,1616,578,1670,555,528,581,1668,553,526,582,528,612,498,559,524,585,526,604,507,552,1670,597,504,553,1667,608,1613,582,1667,559,1663,613,1608,586,1662,552, -40067,9026,2219,579, - - -3060767,9079,4445,606,505,554,530,578,532,608,502,555,528,581,530,610,500,588,495,614,1635,580,1641,604,1617,618,1621,584,1637,608,1612,612,1636,589,1637,602,507,581,1641,605,505,582,501,609,502,607,503,585,498,611,499,609,1612,613,498,612,1610,615,1633,561,1661,606,1615,609,1639,585,1636,610, -40011,9072,2200,588, -96480,9075,2198,560, -96509,9047,2226,552, -96517,9049,2224,555, -96514,9042,2222,556, -96512,9053,2220,558, -96511,9045,2227,561, -96507,9048,2225,554, -96515,9061,2231,565, -96522,9053,2219,559, -96510,9044,2229,560, -96508,9046,2226,562, -96506,9027,2245,553, -96511,9030,2243,555, -96513,9031,2237,557, -96512,9054,2219,559, - - -570349,9027,4495,608,476,583,529,580,529,558,525,584,527,582,528,560,523,596,524,584,1636,578,1669,555,1667,578,1643,581,1666,558,1663,582,1639,586,1662,552,531,577,1670,554,1667,578,532,563,527,582,528,580,529,558,525,584,1665,561,523,586,525,584,1637,577,1670,554,1668,578,1642,582,1667,558, -40062,9021,2233,585, - - -172411,9020,4502,559,524,585,526,583,527,551,532,586,523,575,535,553,530,579,532,577,1643,581,1668,557,1664,581,1639,585,1664,552,1670,575,1637,579,1669,556,527,581,529,580,1642,584,536,581,528,560,523,585,524,584,526,552,1670,576,1645,579,530,578,1643,582,1667,558,1663,582,1639,586,1662,545, -40068,9026,2220,578, - - -226896,9054,4468,578,500,608,502,607,503,585,498,611,500,610,501,588,496,612,497,602,1610,615,1633,581,1640,606,1616,609,1639,585,1635,610,1612,614,1635,580,504,615,495,604,506,582,1639,606,503,585,499,610,501,609,502,587,1635,610,1610,614,1634,581,502,616,1632,582,1648,606,1615,610,1638,587, -40033,9050,2195,614, - -249594,9020,4502,560,524,594,525,603,506,552,532,587,521,606,504,554,529,579,532,609,1612,582,1667,557,1654,612,1608,585,1663,552,1670,606,1615,579,1669,554,527,582,529,611,500,558,1663,612,497,560,523,585,524,598,505,552,1670,606,1614,580,1668,557,526,582,1665,558,1662,603,1618,587,1661,553, -40067,9058,2187,621, - - -97567,9054,4467,584,500,609,501,601,502,586,497,611,499,610,501,588,496,614,497,612,1609,615,1632,582,1640,606,1615,609,1639,586,1636,611,1611,614,1634,581,503,608,493,605,505,583,1639,607,503,586,498,611,500,609,501,588,1634,611,1609,615,1634,582,502,608,1641,553,1668,608,1613,581,1668,558, - -112307,9078,4443,608,502,606,504,584,498,610,501,608,502,587,497,612,498,610,499,589,1633,603,1619,607,1642,583,1638,607,1614,611,1638,597,1634,611,1610,615,495,603,506,581,502,607,1642,584,500,609,501,607,503,585,498,611,1637,588,1634,611,1610,615,495,603,1618,607,1641,584,1638,607,1605,611, - - -112281,9076,4445,606,505,584,499,610,501,608,502,586,497,612,498,610,500,581,494,614,1635,581,1641,604,1617,608,1640,585,1637,609,1610,613,1636,589,1632,603,507,581,503,607,504,604,1617,608,502,607,503,585,498,611,500,609,1613,613,1636,590,1632,603,507,581,1641,605,1616,609,1640,585,1636,609, - - -94207,9075,4446,605,506,582,501,607,502,606,504,584,500,610,501,608,502,587,497,611,1636,588,1633,612,1610,616,1633,583,1639,604,1615,610,1638,587,1635,610,500,588,495,606,496,602,1619,616,495,605,506,583,501,609,502,606,1614,610,1638,587,1635,611,499,590,1632,603,1618,607,1641,583,1638,608, - - -103762,9076,4446,605,505,553,531,579,532,607,503,555,528,580,530,609,500,557,527,583,1666,559,1662,603,1609,587,1661,553,1669,608,1614,580,1659,557,1665,612,498,580,504,585,526,604,1617,607,503,606,504,584,499,610,500,609,1613,612,1636,588,1633,602,507,573,1641,605,1617,608,1640,585,1636,619, - - -76134,9056,4466,585,525,604,506,552,532,577,533,606,504,553,529,579,531,608,501,556,1665,611,1611,584,1665,561,1661,605,1616,578,1671,555,1667,609,1612,582,528,611,499,559,525,584,1664,551,533,586,524,605,505,553,530,578,1670,555,1667,610,1612,582,528,611,1610,584,1664,551,1671,606,1616,578, - - -112997,9073,4447,603,507,560,523,586,524,605,505,552,531,578,533,607,503,555,529,580,1668,548,1665,611,1611,584,1665,551,1671,615,1616,578,1670,555,1667,610,501,556,527,582,528,611,1609,584,518,604,506,551,533,586,524,606,1615,579,1669,555,1666,610,500,558,1664,612,1609,585,1663,551,1670,606, - - -84870,9053,4470,582,529,611,500,559,525,583,526,602,507,560,523,586,525,574,536,543,1669,608,1614,580,1668,556,1665,620,1610,585,1664,550,1671,605,1616,578,533,608,503,555,529,580,1677,557,526,582,528,612,498,559,525,585,1664,551,1671,605,1615,578,531,608,1614,581,1668,558,1664,611,1609,585, - - -76184,9025,4496,555,529,579,531,609,502,556,528,582,529,610,500,559,525,583,526,603,1619,586,1663,552,1669,606,1614,580,1668,556,1665,611,1610,584,1664,550,533,586,524,605,504,553,1669,608,503,555,529,580,530,609,501,557,1664,605,1609,585,1664,551,532,586,1661,553,1668,608,1614,581,1666,558, - - -96145,9073,4449,612,499,559,524,584,526,603,506,552,532,587,523,606,504,584,499,570,1669,556,1666,610,1611,614,1634,580,1641,605,1617,608,1640,584,1636,609,501,587,497,612,498,611,1611,615,496,602,508,580,503,595,535,614,1627,617,1650,594,1646,604,502,586,1635,611,1618,614,1634,581,1641,604, - - -86183,9080,4442,610,501,607,502,586,498,611,499,610,501,588,496,613,497,611,498,579,1642,604,1617,608,1641,583,1637,608,1613,611,1637,588,1634,611,1608,615,494,604,506,582,501,617,1641,584,499,610,493,608,502,586,497,612,1636,588,1633,602,1619,615,494,604,1617,608,1640,585,1637,608,1613,613, - - -234570,9078,4437,607,503,606,505,584,500,608,501,614,502,585,497,611,499,610,509,588,1634,612,1609,616,1633,582,1639,606,1616,610,1639,587,1635,610,1611,614,1634,581,503,606,504,604,1617,608,502,607,503,585,498,611,500,609,501,597,1634,611,1610,615,495,603,1618,607,1642,584,1638,607,1614,611, - - -112281,9076,4446,605,505,583,501,609,493,606,503,585,498,610,500,609,501,587,497,613,1636,579,1643,602,1618,606,1641,583,1639,607,1614,610,1638,554,1665,611,1611,584,526,603,507,551,1671,597,504,583,500,578,532,607,502,555,528,581,1668,556,1664,611,498,559,1663,604,1618,587,1662,553,1668,608, - - -130332,9076,4446,615,496,605,507,582,502,608,503,605,512,584,499,609,501,608,502,586,1636,610,1611,613,1635,579,1641,604,1617,608,1641,584,1637,608,1613,611,1636,588,495,614,497,613,1609,616,494,604,506,590,500,608,502,607,503,585,1635,609,1613,612,498,610,1610,614,1634,581,1641,604,1617,608, - - -886079,9020,4501,560,523,585,525,583,527,552,532,587,523,576,534,554,529,580,531,577,1644,582,1667,559,1663,582,1639,586,1663,553,1669,576,1645,581,1668,557,521,582,529,581,530,559,1663,582,527,551,532,587,523,575,535,553,1669,577,1644,581,1667,557,526,584,1665,560,1662,582,1637,588,1661,554, - - -76188,9053,4469,583,528,560,523,586,524,585,525,552,531,578,533,576,534,554,528,581,1668,557,1665,581,1631,585,1664,551,1670,575,1646,579,1678,555,1666,579,531,558,1664,581,528,559,1662,584,527,552,532,588,523,575,535,553,1668,578,532,556,1666,580,531,567,1663,582,1639,585,1662,552,1670,575, - - -76165,9054,4468,583,527,581,529,559,524,585,525,583,526,547,531,587,524,576,535,554,1668,577,1644,581,1667,558,1664,582,1640,586,1663,551,1670,576,1645,579,531,578,533,556,527,582,1666,559,525,583,526,582,528,560,523,586,1663,553,1669,576,1645,580,522,578,1642,582,1666,559,1663,582,1639,586, -40034,9049,2224,585, - - -114557,9051,4471,581,529,558,525,584,527,582,528,561,522,586,524,585,525,552,531,578,1670,555,1667,579,1643,577,1666,559,1662,583,1638,587,1662,563,1678,587,543,565,537,591,539,589,1651,592,537,591,539,569,533,595,535,593,1647,597,1670,563,1678,587,542,565,1675,589,1651,593,1675,569,1671,593, -40045,9047,2225,553, - - -114589,9029,4492,559,525,585,526,582,528,550,533,586,524,575,535,553,530,578,532,577,1645,581,1668,557,1664,581,1640,585,1664,552,1670,575,1646,579,1669,556,527,582,529,580,531,557,1663,582,528,560,523,586,524,585,525,552,1669,576,1645,580,1668,556,526,582,1667,559,1663,582,1639,593,1662,553, - - -40067,9026,4495,556,528,581,529,579,531,557,526,575,527,581,528,561,523,585,525,584,1638,588,1661,554,1667,578,1644,582,1667,559,1663,582,1639,586,1663,552,530,578,1671,555,529,581,1668,556,526,582,529,581,529,559,524,584,1664,550,533,587,1662,553,530,578,1669,555,1667,578,1642,582,1668,559, - - -58109,9049,4473,578,533,576,534,555,529,580,531,578,532,556,527,582,528,580,529,559,1663,583,1639,586,1662,553,1669,580,1644,581,1668,558,1664,581,1640,582,525,584,527,552,531,588,1670,554,529,579,531,578,532,556,527,582,1666,558,1663,582,1639,587,524,584,1636,578,1671,564,1676,588,1652,592, - - -263241,9028,4503,557,526,582,528,581,529,559,523,594,526,584,527,552,532,588,527,575,1646,579,1670,556,1666,579,1642,583,1665,560,1662,584,1638,578,1671,554,529,580,1669,559,527,582,1667,559,525,584,526,582,528,560,523,586,1662,552,530,578,1671,555,529,580,1668,556,1665,581,1640,584,1664,551, -40069,9025,2221,588 -}; - -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[] = { -200000, 8862, 4452, 562, 563, 559, 1681, 563, 1646, 567, 586, 556, 569, 563, 583, 559, 571, 561, 1675, 559, 565, 567, 1673, 561, 561, 561, 592, 561, 565, 567, 579, 563, 567, 565, 584, 558, 1652, 561, 592, 561, 561, 561, 1679, 565, 560, 562, 584, 558, 1659, 564, 585, 557, 566, 566, 1675, 559, 1649, 564, 589, 564, 1649, 564, 1668, 566, 565, 567, 1669, 565, - 43470, 8896, 4432, 561, 561, 561, 1679, 565, 1648, 565, 581, 561, 568, 564, 586, 567, 558, 564, 1676, 558, 564, 558, 1681, 563, 563, 559, 587, 566, 565, 567, 582, 561, 564, 558, 595, 558, 1650, 563, 590, 563, 563, 559, 1674, 560, 570, 562, 587, 566, 1645, 568, 586, 556, 565, 567, 1672, 562, 1651, 562, 584, 558, 1658, 566, 1671, 563, 561, 561, 1679, 565, -200000, 8881, 4383, 569, 549, 573, 548, 574, 541, 571, 550, 572, 547, 575, 539, 573, 551, 571, 1651, 573, 545, 567, 554, 568, 548, 574, 1652, 572, 547, 575, 1645, 568, 1661, 573, 545, 567, 1657, 567, 554, 568, 547, 575, 1652, 572, 547, 575, 539, 573, 1657, 567, 550, 572, 545, 577, 1651, 573, 1648, 576, 545, 567, 1659, 575, 1645, 568, 555, 567, 1657, 567, - 38995, 8883, 4369, 573, 543, 569, 552, 570, 549, 573, 541, 571, 553, 569, 548, 574, 543, 569, 1658, 566, 550, 572, 548, 574, 546, 566, 1653, 571, 553, 569, 1654, 570, 1654, 570, 551, 571, 1651, 573, 547, 575, 545, 567, 1653, 571, 552, 570, 547, 575, 1649, 564, 556, 566, 550, 572, 1655, 569, 1656, 568, 546, 566, 1664, 570, 1653, 571, 547, 565, 1663, 571, -200000, 8987, 4504, 561, 593, 539, 589, 533, 596, 515, 586, 536, 592, 540, 588, 534, 595, 517, 1713, 541, 1664, 570, 1686, 558, 596, 515, 587, 535, 593, 539, 1691, 543, 1689, 565, 588, 513, 1691, 563, 1668, 617, 1613, 641, 1615, 567, 587, 535, 593, 519, 610, 512, 590, 542, 1714, 510, 593, 539, 1691, 563, 591, 510, 1720, 535, 594, 518, 584, 538, 591, 541, - 39546, 8990, 4501, 565, 590, 542, 586, 536, 593, 508, 593, 539, 589, 543, 585, 537, 592, 509, 1720, 545, 1660, 615, 1642, 561, 567, 534, 594, 538, 590, 542, 1688, 535, 1696, 558, 595, 517, 1687, 567, 1664, 621, 1635, 619, 1611, 561, 594, 538, 590, 511, 617, 515, 586, 536, 1721, 513, 589, 543, 1687, 568, 587, 514, 1691, 563, 590, 511, 591, 541, 587, 535, -200000, 8986, 4505, 560, 594, 538, 590, 542, 586, 515, 586, 536, 593, 539, 589, 533, 595, 517, 1714, 540, 587, 535, 594, 518, 1713, 542, 586, 515, 587, 535, 1722, 543, 1662, 562, 592, 540, 1664, 570, 585, 537, 591, 541, 1689, 545, 584, 538, 590, 542, 1688, 536, 593, 539, 589, 512, 590, 542, 586, 536, 1720, 514, 588, 544, 585, 537, 591, 541, 587, 514, - 40671, 8986, 4505, 560, 594, 538, 590, 542, 586, 515, 587, 535, 593, 539, 589, 533, 595, 516, 1714, 541, 587, 535, 594, 518, 1712, 542, 586, 515, 587, 535, 1722, 543, 1662, 561, 592, 540, 1664, 570, 585, 537, 591, 541, 1689, 545, 584, 538, 590, 542, 1688, 536, 593, 539, 589, 512, 590, 542, 586, 536, 1720, 514, 588, 544, 585, 537, 591, 541, 587, 514, -200000, 8990, 4500, 566, 1692, 562, 1668, 566, 588, 534, 594, 518, 584, 538, 591, 541, 587, 535, 1669, 565, 589, 543, 1688, 536, 592, 540, 1691, 563, 1667, 567, 1664, 621, 1635, 568, 586, 515, 587, 535, 593, 539, 589, 543, 1662, 562, 592, 540, 588, 534, 594, 518, 585, 537, 591, 541, 587, 514, 587, 535, 594, 538, 590, 542, 586, 515, 586, 536, 593, 539, - 39544, 8993, 4498, 567, 1690, 564, 1666, 568, 586, 536, 593, 508, 593, 539, 589, 543, 585, 537, 1668, 566, 588, 544, 1687, 537, 591, 541, 1690, 564, 1666, 568, 1663, 561, 1696, 569, 585, 516, 586, 536, 593, 539, 589, 543, 1661, 562, 592, 540, 588, 534, 594, 517, 584, 538, 591, 541, 587, 514, 587, 535, 593, 539, 589, 543, 585, 516, 586, 536, 592, 540, -200000, 8894, 4456, 589, 1676, 589, 571, 582, 574, 589, 571, 582, 1683, 582, 1677, 588, 1682, 583, 574, 589, 568, 585, 1682, 583, 1678, 587, 1680, 585, 574, 589, 565, 588, 575, 588, 1675, 590, 567, 586, 1681, 584, 571, 582, 1685, 590, 568, 585, 569, 584, 1685, 590, 567, 586, 1678, 587, 574, 589, 1672, 582, 578, 585, 1679, 586, 1674, 591, 572, 591, 1672, 582, - 39632, 8912, 4464, 560, 1703, 562, 598, 565, 594, 559, 594, 559, 1711, 564, 1698, 567, 1697, 568, 593, 560, 595, 568, 1698, 567, 1698, 567, 1693, 561, 602, 561, 596, 567, 590, 563, 1704, 561, 594, 559, 1707, 568, 591, 562, 1697, 568, 596, 567, 590, 563, 1700, 565, 596, 567, 1693, 561, 599, 564, 1701, 564, 589, 564, 1706, 559, 1704, 561, 597, 566, 1700, 565, -200000, 9018, 4500, 565, 1666, 568, 1689, 565, 588, 513, 1691, 615, 1616, 618, 1639, 564, 1667, 567, 587, 535, 594, 538, 563, 538, 590, 542, 586, 536, 593, 508, 593, 539, 589, 543, 1688, 535, 592, 540, 588, 544, 585, 537, 591, 510, 1694, 560, 1670, 564, 1693, 562, 1669, 565, 1692, 542, 1689, 565, 588, 534, 595, 517, 585, 537, 591, 541, 587, 535, 568, 544, 584, 538, 591, 541, 1663, 560, 1696, 569, 1662, 562, 1695, 539, 1692, 614, 1616, 566, 1691, 563, 1667, 567, - 23184, 9012, 4505, 560, 1697, 537, 1693, 561, 593, 508, 1696, 569, 1662, 562, 1695, 560, 1671, 563, 591, 541, 587, 535, 594, 518, 584, 538, 590, 542, 586, 515, 613, 509, 593, 539, 1692, 542, 585, 537, 592, 540, 588, 534, 594, 518, 1687, 567, 1663, 560, 1697, 568, 1662, 562, 1695, 539, 1692, 563, 591, 541, 587, 514, 588, 544, 584, 538, 590, 542, 586, 515, 587, 535, 593, 539, 1666, 568, 1689, 565, 1665, 569, 1688, 536, 1695, 570, 1661, 562, 1694, 561, 1670, 564, -200000, 8835, 4446, 537, 562, 539, 562, 539, 1663, 540, 1667, 536, 1669, 534, 560, 531, 573, 539, 559, 532, 1672, 531, 570, 531, 564, 537, 563, 538, 561, 540, 1660, 533, 1677, 536, 561, 540, 557, 534, 567, 534, 1668, 535, 1672, 531, 1675, 538, 555, 536, 1674, 539, 1665, 538, 1666, 537, 1671, 532, 563, 538, 1669, 534, 566, 535, 558, 533, 1677, 536, 562, 539, 558, 533, 568, 533, 1668, 535, 566, 535, 1670, 533, 1667, 536, 568, 533, 1671, 532, 1672, 531, 1676, 537, - 22779, 8870, 4437, 535, - 92592, 8861, 4414, 538, -}; - -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 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}, - - {InfraredProtocolNEC, 0xAA, 0xAA, false}, - {InfraredProtocolNEC, 0xAA, 0xAA, true}, - {InfraredProtocolNEC, 0xAA, 0xAA, true}, - - {InfraredProtocolNEC, 0x55, 0x55, false}, - {InfraredProtocolNEC, 0x55, 0x55, true}, - {InfraredProtocolNEC, 0x55, 0x55, true}, - {InfraredProtocolNEC, 0x55, 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 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[] = { -2000000, 9000, 4500, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 8 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 16 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 24 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 32 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 40 - 560, 560, 560, 560, 560, // 42 -}; - -const uint32_t test_decoder_nec42ext_input2[] = { -2000000, 9000, 4500, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 8 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 16 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 24 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 32 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 40 - 560, 560, 560, 560, 560, 560, 560, // 43 - failed - -2000000, 9000, 4500, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 8 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 16 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 24 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 32 - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 40 - 560, 560, 560, 560, 560, 10000, 560, // 42 OK + 1 failed -}; - -const InfraredMessage test_decoder_nec42ext_expected1[] = { - {InfraredProtocolNEC42ext, 0x00, 0, false}, -}; - -const InfraredMessage test_decoder_nec42ext_expected2[] = { - {InfraredProtocolNEC42ext, 0x00, 0, false}, -}; - diff --git a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_necext_test_data.srcdata b/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_necext_test_data.srcdata deleted file mode 100644 index 22ccf40b..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_necext_test_data.srcdata +++ /dev/null @@ -1,255 +0,0 @@ -const uint32_t test_decoder_necext_input1[] = { -1915384, 8967, 4463, 587, 527, 590, 524, 584, 1647, 590, 524, 583, 531, 586, 527, 590, 524, 583, 1646, 589, 1640, 586, 527, 590, 524, 583, 1647, 590, 1640, 587, 1644, 582, 1647, 589, 524, 583, 531, 586, 1644, 593, 521, 586, 527, 589, 1641, 586, 528, 589, 525, 592, 521, 585, 1644, 592, 522, 585, 1645, 592, 1638, 589, 524, 592, 1637, 588, 1641, 585, 1645, 592, -41082, 8965, 2220, 591, -409594, 8972, 4458, 591, 523, 584, 530, 587, 1642, 584, 529, 588, 526, 591, 522, 583, 530, 587, 1643, 584, 1646, 590, 523, 584, 530, 587, 1643, 584, 1647, 590, 1640, 586, 1643, 583, 531, 586, 527, 589, 1641, 586, 528, 589, 524, 593, 1637, 589, 524, 593, 521, 586, 529, 589, 1641, 585, 528, 589, 1640, 586, 1644, 592, 521, 585, 1645, 592, 1638, 588, 1641, 585, -41088, 8968, 2218, 582, -95791, 8971, 2214, 587, -95787, 8965, 2220, 591, -95783, 8971, 2215, 585, -95787, 8964, 2221, 590, -95783, 8971, 2215, 586, -95788, 8965, 2220, 591, -95783, 8969, 2216, 585, -95789, 8965, 2220, 590, -95782, 8970, 2215, 586, -95788, 9047, 2139, 591, -95782, 8970, 2216, 585, -95788, 8966, 2220, 591, -95782, 8972, 2214, 588, -95786, 8964, 2222, 590, -95784, 8971, 2214, 586, -95787, 8967, 2218, 583, -95791, 8964, 2222, 588, -95785, 8969, 2217, 584, -333740, 8967, 4464, 586, 528, 590, 524, 592, 1637, 589, 525, 592, 521, 586, 528, 589, 525, 593, 1637, 588, 1640, 585, 528, 589, 525, 592, 1638, 589, 1641, 586, 1644, 592, 1638, 588, 525, 592, 522, 585, 1644, 592, 522, 585, 528, 588, 1642, 585, 529, 588, 526, 591, 522, 585, 1645, 591, 522, 584, 1646, 591, 1639, 587, 526, 591, 1639, 588, 1642, 583, 1646, 590, -41082, 8963, 2223, 588, -95785, 8967, 2219, 591, -95782, 8968, 2217, 584, -246369, 8972, 4459, 591, 523, 583, 530, 587, 1643, 583, 530, 587, 527, 590, 523, 584, 530, 586, 1643, 583, 1647, 590, 524, 583, 530, 586, 1643, 583, 1646, 589, 1641, 586, 1644, 583, 531, 586, 528, 589, 1640, 585, 528, 588, 525, 592, 1638, 588, 525, 592, 522, 585, 529, 589, 1641, 584, 529, 588, 1642, 585, 1645, 591, 522, 585, 1645, 590, 1639, 587, 1642, 584, -41090, 8966, 2220, 591, -95782, 8966, 2220, 592, -95782, 8967, 2218, 583, -165604, 9017, 4413, 586, 527, 590, 524, 583, 1647, 589, 523, 582, 531, 586, 528, 589, 525, 593, 1637, 589, 1640, 585, 527, 588, 525, 592, 1638, 589, 1641, 585, 1644, 592, 1638, 588, 525, 591, 523, 585, 1645, 591, 522, 584, 529, 588, 1642, 584, 530, 587, 527, 591, 523, 584, 1646, 591, 523, 584, 1646, 591, 1640, 586, 527, 590, 1640, 586, 1643, 583, 1646, 589, -41084, 8972, 2214, 587, -95787, 8967, 2219, 581, -95792, 8971, 2215, 586, -208929, 9016, 4414, 584, 529, 588, 526, 591, 1638, 588, 525, 591, 522, 584, 529, 587, 526, 591, 1639, 587, 1642, 584, 529, 588, 526, 591, 1638, 587, 1643, 584, 1646, 591, 1639, 587, 526, 590, 523, 584, 1646, 590, 524, 583, 530, 587, 1643, 583, 530, 587, 527, 590, 524, 583, 1647, 590, 524, 583, 1647, 590, 1640, 586, 527, 589, 1640, 586, 1644, 592, 1637, 589, -41085, 8972, 2214, 587, -95787, 8964, 2221, 590, -95784, 8965, 2221, 590, -167378, 8969, 4460, 589, 525, 582, 532, 586, 1644, 592, 521, 586, 528, 589, 524, 592, 522, 585, 1645, 592, 1638, 589, 525, 592, 522, 585, 1644, 591, 1639, 588, 1642, 585, 1645, 591, 522, 585, 529, 587, 1641, 584, 530, 587, 526, 591, 1639, 588, 526, 591, 522, 584, 530, 587, 1643, 584, 530, 587, 1642, 584, 1646, 591, 523, 584, 1647, 590, 1640, 587, 1643, 583, -41090, 9017, 2169, 591, -95781, 8969, 2216, 585, -95788, 8964, 2223, 588, -192781, 8969, 4461, 589, 525, 592, 522, 586, 1644, 592, 521, 586, 528, 589, 525, 592, 522, 585, 1644, 592, 1638, 589, 524, 592, 521, 586, 1645, 591, 1638, 588, 1642, 585, 1645, 590, 522, 584, 530, 587, 1642, 584, 530, 587, 526, 591, 1639, 588, 526, 590, 524, 583, 530, 587, 1643, 584, 530, 587, 1643, 584, 1646, 590, 524, 583, 1646, 590, 1640, 587, 1643, 583, -41090, 8967, 2219, 591, -95782, 8970, 2215, 586, -95788, 8963, 2222, 589, -179978, 8967, 4464, 586, 528, 589, 524, 593, 1637, 588, 525, 592, 522, 585, 529, 589, 525, 592, 1638, 589, 1641, 585, 529, 588, 526, 591, 1638, 588, 1641, 585, 1645, 590, 1639, 587, 527, 590, 523, 584, 1646, 591, 523, 584, 530, 587, 1643, 583, 530, 586, 527, 590, 524, 583, 1646, 590, 523, 584, 1646, 589, 1640, 586, 528, 589, 1640, 586, 1644, 593, 1638, 589, -41084, 8971, 2214, 587, -95787, 8964, 2221, 589, -95785, 8966, 2219, 592, -196616, 8967, 4463, 585, 527, 590, 525, 592, 1637, 589, 525, 592, 521, 586, 528, 589, 524, 592, 1638, 588, 1641, 585, 528, 589, 525, 592, 1637, 589, 1641, 585, 1645, 591, 1638, 588, 526, 591, 522, 585, 1645, 591, 522, 584, 530, 587, 1642, 584, 529, 588, 526, 591, 523, 583, 1645, 590, 523, 584, 1646, 590, 1639, 587, 527, 590, 1639, 586, 1644, 583, 1647, 589, -41084, 8971, 2214, 587, -95787, 8964, 2222, 589, -2112164, 8969, 4462, 588, 525, 592, 522, 585, 1645, 591, 523, 584, 529, 588, 526, 591, 523, 584, 1645, 591, 1639, 587, 527, 590, 524, 583, 1646, 590, 1639, 587, 1643, 584, 1673, 563, 524, 583, 531, 586, 1643, 593, 521, 586, 528, 589, 1641, 585, 528, 589, 525, 592, 521, 585, 1644, 592, 522, 584, 1645, 591, 1639, 588, 526, 591, 1639, 588, 1642, 583, 1646, 590, -41082, 8962, 2223, 588, -95785, 8965, 2220, 591, -95783, 8968, 2217, 583, -164778, 8969, 4462, 588, 525, 591, 522, 585, 1645, 591, 522, 585, 530, 587, 527, 591, 523, 584, 1646, 591, 1639, 588, 526, 591, 523, 583, 1646, 590, 1639, 587, 1643, 584, 1672, 564, 523, 584, 531, 586, 1643, 583, 530, 587, 527, 590, 1639, 587, 527, 589, 524, 583, 531, 586, 1644, 583, 531, 586, 1643, 583, 1647, 590, 525, 582, 1647, 589, 1639, 586, 1644, 593, -41081, 8965, 2220, 590, -95784, 8968, 2217, 583, -95790, 8970, 2215, 586, -161053, 8963, 4468, 592, 521, 586, 528, 589, 1641, 585, 529, 588, 526, 591, 522, 585, 529, 588, 1642, 585, 1645, 591, 523, 584, 530, 587, 1642, 584, 1646, 591, 1639, 586, 1669, 557, 531, 586, 527, 590, 1640, 586, 527, 590, 525, 592, 1638, 589, 525, 592, 522, 585, 528, 588, 1641, 585, 528, 588, 1642, 584, 1645, 591, 523, 584, 1645, 591, 1639, 587, 1643, 583, -41090, 8964, 2221, 590, -95784, 8963, 2222, 589, -95785, 8965, 2220, 590, -139334, 8968, 4463, 587, 527, 590, 523, 584, 1646, 590, 523, 583, 531, 586, 527, 589, 524, 583, 1647, 590, 1640, 586, 527, 590, 525, 592, 1637, 589, 1641, 585, 1644, 592, 1665, 562, 524, 591, 522, 584, 1645, 591, 523, 584, 529, 588, 1642, 584, 529, 587, 527, 590, 523, 584, 1646, 590, 523, 584, 1646, 590, 1639, 587, 527, 589, 1640, 586, 1644, 592, 1637, 589, -41085, 8970, 2217, 584, -95789, 8972, 2213, 586, -95787, 8965, 2221, 590, -141444, 8969, 4461, 589, 525, 592, 522, 584, 1644, 591, 522, 585, 529, 588, 526, 591, 522, 585, 1645, 592, 1638, 587, 526, 591, 523, 584, 1646, 591, 1639, 588, 1642, 583, 1672, 564, 523, 584, 530, 587, 1643, 584, 530, 587, 527, 590, 1640, 587, 527, 590, 524, 584, 530, 587, 1643, 584, 530, 586, 1644, 583, 1647, 589, 524, 583, 1647, 590, 1640, 586, 1645, 592, -41081, 8964, 2222, 589, -95784, 8968, 2218, 583, -95790, 8971, 2214, 586, -154119, 8969, 4462, 588, 526, 591, 522, 585, 1645, 592, 522, 585, 529, 589, 526, 591, 522, 584, 1646, 591, 1639, 588, 526, 591, 523, 583, 1645, 590, 1639, 587, 1642, 584, 1671, 564, 523, 584, 529, 587, 1643, 583, 530, 587, 527, 590, 1639, 587, 526, 590, 523, 583, 530, 586, 1643, 583, 529, 586, 1643, 583, 1646, 590, 524, 583, 1648, 589, 1641, 586, 1644, 592, -41081, 8965, 2220, 590, -95784, 8969, 2216, 585, -95790, 8964, 2221, 590, -147134, 8966, 4464, 586, 528, 589, 525, 593, 1637, 589, 524, 593, 522, 585, 529, 589, 525, 592, 1638, 589, 1641, 586, 528, 589, 525, 591, 1638, 588, 1641, 585, 1645, 592, 1664, 561, 525, 592, 523, 584, 1646, 591, 523, 584, 530, 588, 1642, 585, 526, 587, 527, 590, 523, 584, 1646, 591, 523, 584, 1646, 591, 1639, 586, 526, 590, 1640, 587, 1643, 583, 1646, 590, -41083, 8963, 2223, 587, -95786, 8965, 2221, 590, -95784, 8968, 2217, 584, -158330, 8965, 4465, 585, 529, 588, 526, 590, 1639, 587, 526, 590, 523, 584, 530, 586, 526, 590, 1639, 587, 1643, 583, 530, 587, 527, 590, 1639, 587, 1643, 584, 1647, 590, 1666, 561, 527, 589, 523, 583, 1646, 590, 523, 583, 531, 586, 1643, 583, 530, 586, 527, 590, 524, 582, 1646, 590, 525, 582, 1647, 589, 1640, 586, 528, 589, 1640, 586, 1644, 592, 1638, 589, -41085, 8971, 2214, 586, -95787, 8962, 2223, 588, -95786, 8965, 2222, 589, -206063, 8962, 4467, 591, 521, 585, 529, 588, 1642, 585, 529, 588, 525, 591, 522, 584, 530, 587, 1642, 584, 1646, 591, 523, 584, 529, 588, 1642, 583, 1646, 590, 1640, 587, 1668, 558, 530, 587, 526, 589, 1639, 586, 528, 589, 524, 583, 1647, 589, 524, 593, 521, 585, 528, 589, 1641, 585, 529, 589, 1641, 585, 1645, 592, 522, 585, 1644, 591, 1639, 587, 1642, 584, -41090, 8965, 2221, 590, -95784, 8963, 2223, 588, -95785, 8964, 2222, 589, -183026, 8970, 4460, 590, 524, 583, 531, 586, 1643, 583, 530, 587, 528, 589, 525, 592, 522, 586, 1644, 592, 1637, 588, 525, 591, 522, 585, 1645, 592, 1638, 588, 1641, 585, 1672, 565, 522, 584, 530, 588, 1642, 584, 529, 588, 526, 591, 1639, 587, 527, 590, 523, 584, 530, 587, 1642, 584, 530, 587, 1642, 583, 1647, 590, 524, 583, 1647, 590, 1640, 587, 1643, 582, -41090, 8965, 2221, 590, -95783, 8970, 2216, 584, -95789, 8962, 2223, 587, -184104, 8964, 4467, 583, 530, 587, 527, 590, 1640, 587, 527, 590, 523, 582, 531, 586, 528, 589, 1640, 586, 1644, 593, 521, 586, 528, 589, 1640, 585, 1644, 592, 1638, 589, 1667, 558, 528, 589, 526, 591, 1638, 588, 526, 591, 522, 585, 1645, 591, 522, 585, 530, 587, 527, 591, 1639, 587, 526, 591, 1639, 587, 1642, 584, 530, 587, 1643, 583, 1646, 590, 1639, 587, -41087, 9020, 2166, 584, -95790, 8972, 2213, 587, -95787, 8963, 2222, 589, -169833, 8964, 4465, 583, 529, 587, 527, 590, 1639, 587, 527, 591, 523, 584, 530, 586, 527, 590, 1640, 587, 1643, 583, 531, 587, 527, 590, 1640, 586, 1644, 583, 1647, 590, 1666, 560, 527, 590, 524, 582, 1647, 589, 525, 592, 521, 586, 1644, 592, 521, 586, 528, 589, 526, 592, 1638, 588, 525, 592, 1638, 589, 1641, 585, 528, 589, 1641, 585, 1645, 591, 1638, 588, -41086, 8971, 2215, 585, -95789, 8964, 2222, 588, -95785, 8967, 2218, 583, -185701, 8971, 4460, 590, 523, 584, 530, 587, 1642, 584, 530, 587, 527, 590, 524, 583, 531, 586, 1644, 583, 1647, 590, 524, 592, 521, 585, 1644, 592, 1638, 589, 1641, 585, 1671, 565, 522, 586, 529, 588, 1642, 585, 529, 588, 526, 591, 1638, 588, 525, 590, 523, 584, 530, 587, 1642, 584, 530, 587, 1642, 584, 1646, 590, 524, 583, 1646, 590, 1640, 586, 1643, 583, -41091, 8965, 2222, 589, -95784, 8965, 2221, 589, -95784, 8968, 2217, 583, -146332, 8969, 4461, 669, 445, 591, 522, 584, 1644, 591, 523, 584, 529, 588, 526, 591, 522, 585, 1645, 591, 1638, 587, 527, 590, 524, 584, 1646, 590, 1639, 587, 1642, 583, 1673, 564, 524, 583, 531, 586, 1643, 583, 531, 586, 528, 589, 1641, 585, 528, 589, 525, 592, 522, 585, 1644, 591, 521, 585, 1645, 592, 1638, 588, 525, 592, 1638, 588, 1641, 584, 1646, 591, -41083, 8963, 2222, 589, -95785, 8966, 2220, 592, -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 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 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}, - - {InfraredProtocolNECext, 0xAAAA, 0xAAAA, false}, - {InfraredProtocolNECext, 0xAAAA, 0xAAAA, true}, - {InfraredProtocolNECext, 0xAAAA, 0xAAAA, true}, - - {InfraredProtocolNECext, 0x5555, 0x5555, false}, - {InfraredProtocolNECext, 0x5555, 0x5555, true}, - {InfraredProtocolNECext, 0x5555, 0x5555, true}, - {InfraredProtocolNECext, 0x5555, 0x5555, true}, -}; - - diff --git a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_rc5_test_data.srcdata b/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_rc5_test_data.srcdata deleted file mode 100644 index 07241555..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_rc5_test_data.srcdata +++ /dev/null @@ -1,160 +0,0 @@ -/* -_______----__--____----__--____--__----____----__--__--__--__ - | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5x_expected1[] = { - {InfraredProtocolRC5X, 0x13, 0x10, false}, // toggle 0 -}; - -/* -_______--__----____----__--____--__----____----__--__--__--__ - | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5_expected1[] = { - {InfraredProtocolRC5, 0x13, 0x10, false}, // toggle 0 -}; - - -/* -_______--__--__--__----__--____--__----____----__--__--__--__ - | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5_expected2[] = { - {InfraredProtocolRC5, 0x13, 0x10, false}, // toggle 1 -}; - -/* -_______--__----____----__--____--__----____----__--__--____-- - | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5_expected3[] = { - {InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 0 -}; - - -/* -_______--__--__--__----__--____--__----____----__--__--____-- - | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5_expected4[] = { - {InfraredProtocolRC5, 0x13, 0x11, false}, // toggle 1 -}; - -/* -_______--__----____--__--__--__--__--__--__--__--__--__--__-- - | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5_expected5[] = { - {InfraredProtocolRC5, 0x1F, 0x3F, false}, // toggle 0 -}; - -/* -_______--__--__--__--__--__--__--__--__--__--__--__--__--__-- - | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | - s1 s2 t | address | command | -*/ - -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 InfraredMessage test_decoder_rc5_expected6[] = { - {InfraredProtocolRC5, 0x1F, 0x3F, false}, // toggle 1 -}; - - -const uint32_t test_decoder_rc5_input_all_repeats[] = { -27000 + 888, 888, 888, 1776, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888, -27000 + 888, 888, 888, 888, 888, 888, 888, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888, -27000 + 888, 888, 888, 888, 888, 888, 888, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888, -27000 + 888, 888, 888, 888, 888, 888, 888, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888, -27000 + 888, 888, 888, 1776, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 1776, 888, -27000 + 888, 888, 888, 888, 888, 888, 888, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 888, 888, -27000 + 888, 888, 888, 1776, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 888, 888, -27000 + 888, 888, 888, 1776, 1776, 1776, 888, 888, 1776, 888, 888, 1776, 1776, 1776, 888, 888, 888, 888, 888, 888, -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, -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, -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 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 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}, - - {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}, -}; - diff --git a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_rc6_test_data.srcdata b/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_rc6_test_data.srcdata deleted file mode 100644 index 94b9be5a..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_rc6_test_data.srcdata +++ /dev/null @@ -1,162 +0,0 @@ -/* -_____---------______--____--__--__--____------____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 93 A0 0 - s m2 m1 m0 T | address | command | -// 93 A0 0 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, -// --__----__--__-- -// 0 | 0 | 1 | 1 | 1 -//444, 444, 888, 444, 444, 444, 444, -//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - -_____---------______--____--__--__------____--____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 93 A0 1 -// 93 A0 1 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, -//444, 444, 888, 444, 444, 444, 444, -//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - -_____---------______--____--__--__--____------____--__----____----____--__----____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 94 A0 0 -// 94 A0 0 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, -//----____--__---- -//0 | 1 | 0 | 0 | 1 -//888, 888, 444, 444, 888, -//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - -_____---------______--____--__--__------____--____--__----____----____--__----____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 94 A0 1 -// 94 A0 1 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, -//888, 888, 444, 444, 888, -//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - -_____---------______--____--__--__--____------____--__----____----____----__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 95 A0 0 -// 95 A0 0 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, -//----____----__-- -//0 | 1 | 0 | 1 | 1 -//888, 888, 888, 444, 444, -//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - -_____---------______--____--__--__------____--____--__----____----____----__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 95 A0 1 -// 95 A0 1 -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, -//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 uint32_t test_decoder_rc6_input1[] = { -// 94 A0 0 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -// 93 A0 1 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - // failed 95 - 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, 888, -// 93 A0 0 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -// 94 A0 1 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -// 95 A0 0 -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, - // failed 93 + 1 sample - 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - // failed 93 - 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, 444, 444, - // failed 93 - 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, -// 95 A0 1 -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 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 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[] = { -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 888, 888+444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 888, 888+444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444+888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 888, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444+888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 888, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444+888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 888, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 888, 888+444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444+888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444+888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -}; - - -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 - {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 - - {InfraredProtocolRC6, 0x93, 0xA0, false}, // t 0 - {InfraredProtocolRC6, 0x93, 0xA1, false}, // t 1 -}; - diff --git a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_samsung_test_data.srcdata b/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_samsung_test_data.srcdata deleted file mode 100644 index aea867b9..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_samsung_test_data.srcdata +++ /dev/null @@ -1,254 +0,0 @@ -const uint32_t test_decoder_samsung32_input1[] = { - 3129767, 4513, 4483, 565, 530, 586, 1670, 563, 1664, 588, 1666, 566, 530, 586, - 535, 560, 535, 591, 531, 565, 531, 585, 1669, 563, 1666, 587, 1640, 593, - 531, 566, 530, 587, 536, 559, 562, 564, 531, 585, 537, 558, 1670, 562, - 1665, 587, 534, 561, 534, 592, 530, 566, 529, 587, 1668, 564, 1664, 589, - 533, 563, 533, 594, 1661, 560, 1667, 565, 1661, 591, 1664, 558, 46325, 4517, - 4480, 558, 1668, 595, - - 679127, 4511, 4485, 562, 532, 584, 1671, 561, 1666, 587, 1668, 564, 532, 585, - 537, 559, 537, 589, 533, 562, 533, 593, 1661, 561, 1667, 586, 1642, 590, - 532, 563, 531, 585, 537, 559, 564, 563, 1666, 567, 528, 588, 535, 613, - 483, 593, 530, 586, 536, 559, 536, 590, 1637, 584, 537, 558, 1669, 594, - 1661, 561, 1667, 586, 1642, 591, 1664, 559, 1670, 583, 534, 567, 46429, 4515, - 4480, 558, 1671, 593, - - 618571, 4508, 4488, 560, 561, 566, 1663, 559, 1667, 583, 1670, 562, 534, 582, - 540, 565, 531, 587, 536, 560, 536, 590, 1664, 558, 1670, 583, 1644, 588, - 535, 561, 534, 592, 530, 566, 557, 610, 1616, 616, 479, 585, 537, 558, - 537, 589, 534, 584, 539, 567, 529, 587, 534, 561, 534, 592, 1663, 559, - 1668, 564, 1664, 588, 1666, 566, 1661, 581, 1646, 585, 1669, 563, 46106, 4511, - 4485, 563, 1664, 589, - - 514897, 4514, 4482, 556, 564, 614, 1616, 565, 1664, 589, 1666, 557, 538, 588, - 534, 562, 534, 592, 529, 566, 529, 587, 1667, 565, 1663, 590, 1638, 584, - 538, 568, 527, 590, 534, 562, 562, 566, 530, 587, 1642, 590, 532, 563, - 530, 586, 537, 589, 533, 563, 533, 583, 539, 566, 1661, 561, 561, 566, - 1663, 559, 1668, 584, 1671, 563, 1666, 556, 1671, 591, 1663, 559, 46210, 4508, - 4488, 560, 1668, 585, - - 683922, 4509, 4487, 561, 560, 565, 1662, 559, 1669, 585, 1670, 562, 534, 583, - 540, 566, 529, 586, 535, 560, 535, 591, 1663, 559, 1669, 584, 1644, 588, - 534, 561, 533, 593, 529, 556, 567, 561, 1668, 564, 1664, 590, 534, 563, - 532, 584, 538, 557, 537, 589, 534, 562, 534, 593, 530, 566, 555, 561, - 1667, 564, 1662, 589, 1665, 557, 1671, 581, 1647, 586, 1669, 564, 46686, 4514, - 4481, 556, 1672, 592, - - 1088255, 4514, 4481, 557, 564, 562, 1667, 565, 1663, 591, 1665, 558, 538, 590, - 533, 564, 532, 583, 539, 567, 528, 588, 1666, 566, 1663, 580, 1648, 585, - 537, 559, 537, 589, 533, 562, 560, 618, 478, 589, 535, 562, 1667, 565, - 1662, 588, 531, 565, 531, 585, 537, 558, 536, 590, 1666, 566, 1661, 592, - 530, 566, 530, 586, 1669, 564, 1664, 558, 1669, 594, 1662, 560, 46291, 4510, - 4485, 563, 1663, 589, 97349, 4510, 4487, 561, 1666, 586, 97560, 4513, 4482, 566, - 1662, 591, 97123, 4510, 4485, 563, 1664, 588, 97605, 4508, 4487, 561, 1666, 586, - 97371, 4518, 4478, 560, 1668, 595, 97514, 4518, 4478, 560, 1667, 586, 97014, 4515, - 4480, 568, 1660, 593, 96719, 4516, 4481, 567, 1660, 593, 97528, 4515, 4480, 568, - 1659, 593, 97453, 4510, 4485, 563, 1665, 587, 97351, 4518, 4477, 561, 1668, 585, - 97216, 4511, 4484, 564, 1664, 589, 97708, 4518, 4477, 561, 1667, 586, 96718, 4516, - 4479, 559, 1669, 594, 97070, 4515, 4480, 568, 1660, 593, 97500, 4511, 4484, 564, - 1662, 590, 97425, 4515, 4481, 567, 1660, 593, 97025, 4515, 4482, 566, 1660, 592, - 96796, 4509, 4487, 561, 1666, 587, 97399, 4512, 4484, 565, 1662, 591, 97486, 4516, - 4480, 567, 1658, 594, 97425, 4515, 4481, 567, 1659, 593, 97511, 4510, 4485, 563, - 1664, 650, 96969, 4511, 4485, 562, 1665, 588, 97243, 4512, 4484, 564, 1663, 590, - 97031, 4519, 4478, 560, 1666, 586, 97548, 4514, 4482, 566, 1661, 591, 97302, 4515, - 4480, 568, 1659, 593, 97726, 4510, 4486, 562, 1665, 588, 97396, 4514, 4482, 566, - 1661, 592, 97301, 4515, 4480, 568, 1661, 593, 97453, 4518, 4477, 560, 1667, 585, - 97430, 4518, 4477, 561, 1665, 587, 97521, 4511, 4484, 564, 1664, 589, 97182, 4512, - 4484, 564, 1663, 590, 97760, 4516, 4479, 559, 1668, 595, 97268, 4516, 4479, 559, - 1668, 595, 97243, 4512, 4485, 563, 1663, 589, 97695, 4510, 4486, 562, 1664, 588, - 374205, 4513, 4483, 565, 530, 586, 1669, 564, 1665, 589, 1667, 567, 529, 587, - 535, 560, 535, 591, 531, 565, 530, 585, 1669, 563, 1664, 588, 1639, 593, - 529, 566, 529, 587, 536, 560, 563, 565, 532, 585, 537, 560, 1669, 563, - 1664, 587, 534, 561, 534, 592, 529, 566, 529, 586, 1668, 564, 1663, 589, - 532, 563, 534, 593, 1661, 562, 1666, 566, 1662, 591, 1664, 558, - - 149343, 4512, 4483, 565, 530, 586, 1669, 563, 1664, 588, 1667, 565, 530, 586, - 536, 560, 536, 590, 532, 563, 531, 586, 1670, 563, 1666, 567, 1660, 592, - 530, 565, 529, 586, 537, 558, 563, 563, 532, 584, 538, 568, 1661, 561, - 1665, 587, 535, 560, 535, 592, 532, 565, 531, 587, 1669, 563, 1665, 587, - 534, 561, 534, 592, 1663, 559, 1668, 564, 1662, 590, 1666, 566, - - 116399, 4514, 4482, 566, 531, 587, 1669, 564, 1664, 589, 1666, 566, 529, 587, - 535, 561, 535, 592, 531, 565, 529, 587, 1668, 564, 1664, 558, 1670, 595, - 529, 566, 528, 589, 535, 560, 562, 565, 531, 585, 536, 559, 1668, 564, - 1664, 589, 534, 561, 533, 593, 530, 565, 528, 588, 1668, 564, 1665, 590, - 533, 564, 532, 594, 1661, 561, 1666, 566, 1661, 592, 1663, 558, - - 121946, 4517, 4478, 559, 537, 590, 1664, 568, 1660, 593, 1661, 560, 536, 590, - 531, 564, 531, 585, 537, 559, 536, 590, 1665, 568, 1661, 561, 1666, 587, - 537, 559, 529, 591, 531, 564, 558, 558, 537, 588, 533, 562, 1665, 567, - 1659, 593, 530, 565, 529, 587, 536, 561, 535, 592, 1664, 559, 1671, 593, - 530, 566, 528, 587, 1667, 565, 1662, 558, 1668, 595, 1660, 561, 46509, 4516, - 4479, 558, 1668, 594, - - 88785, 4512, 4484, 564, 530, 585, 1669, 563, 1664, 588, 1666, 566, 530, 587, - 536, 560, 535, 592, 532, 565, 531, 585, 1669, 563, 1665, 557, 1669, 594, - 530, 566, 530, 586, 535, 560, 562, 564, 530, 585, 537, 558, 1669, 563, - 1664, 589, 535, 561, 534, 593, 529, 566, 529, 586, 1668, 564, 1664, 589, - 533, 562, 532, 594, 1661, 561, 1666, 565, 1662, 591, 1665, 558, - - 289651, 4512, 4483, 564, 531, 586, 1669, 563, 1665, 588, 1667, 565, 529, 587, - 536, 560, 536, 590, 531, 563, 531, 584, 1670, 562, 1666, 556, 1671, 592, - 529, 566, 531, 586, 536, 561, 562, 564, 532, 585, 537, 558, 1669, 563, - 1665, 588, 535, 561, 536, 590, 530, 565, 531, 585, 1669, 563, 1664, 587, - 534, 561, 533, 593, 1662, 561, 1669, 564, 1663, 590, 1665, 567, 46302, 4509, - 4487, 561, 1667, 585, - - 97097, 4513, 4483, 565, 529, 587, 1668, 564, 1663, 589, 1666, 567, 529, 587, - 536, 560, 535, 591, 530, 565, 529, 587, 1669, 563, 1664, 558, 1669, 594, - 529, 566, 527, 587, 535, 561, 561, 563, 530, 586, 537, 560, 1669, 563, - 1663, 589, 534, 561, 532, 594, 529, 566, 528, 587, 1668, 564, 1663, 589, - 532, 563, 532, 594, 1660, 561, 1667, 566, 1661, 592, 1663, 558, 46311, 4510, - 4485, 562, 1665, 589, - - 99001, 4514, 4481, 566, 528, 587, 1667, 565, 1662, 589, 1664, 568, 528, 588, - 535, 561, 535, 593, 529, 567, 528, 589, 1668, 564, 1663, 559, 1668, 595, - 528, 567, 527, 589, 534, 562, 561, 565, 530, 586, 536, 560, 1668, 564, - 1663, 590, 533, 563, 532, 595, 524, 567, 527, 588, 1667, 565, 1662, 590, - 532, 563, 531, 595, 1659, 562, 1666, 566, 1661, 593, 1664, 559, - - 300259, 4514, 4482, 556, 565, 561, 1668, 564, 1663, 589, 1664, 556, 539, 588, - 535, 561, 535, 643, 478, 568, 530, 587, 1668, 564, 1664, 589, 1636, 594, - 529, 567, 528, 588, 534, 561, 561, 565, 1662, 560, 536, 590, 532, 564, - 531, 586, 537, 589, 532, 564, 533, 584, 538, 568, 528, 588, 1667, 565, - 1662, 560, 1669, 584, 1670, 562, 1666, 587, 1641, 591, 1664, 559, 46271, 4561, - 4435, 562, 1666, 586, - - 81421, 4514, 4482, 556, 565, 561, 1667, 565, 1662, 589, 1664, 558, 538, 588, - 534, 562, 534, 593, 530, 567, 530, 587, 1669, 564, 1663, 589, 1637, 594, - 529, 567, 528, 588, 534, 561, 560, 566, 1663, 559, 535, 591, 531, 565, - 530, 587, 538, 589, 533, 563, 533, 583, 539, 567, 529, 587, 1667, 565, - 1662, 560, 1669, 584, 1669, 563, 1666, 587, 1640, 592, 1663, 560, 46296, 4516, - 4480, 558, 1669, 594, - - 80690, 4508, 4489, 560, 561, 565, 1663, 558, 1670, 593, 1660, 561, 534, 592, - 530, 565, 530, 586, 537, 560, 536, 591, 1664, 558, 1670, 583, 1644, 587, - 535, 560, 534, 592, 530, 566, 556, 559, 1669, 563, 532, 584, 538, 558, - 537, 588, 534, 582, 540, 567, 530, 588, 535, 562, 535, 591, 1663, 559, - 1669, 564, 1665, 588, 1666, 566, 1662, 560, 1668, 585, 1669, 563, - - 136483, 4511, 4485, 563, 531, 585, 1671, 561, 1666, 587, 1668, 564, 531, 585, - 536, 559, 537, 589, 532, 563, 532, 584, 1670, 562, 1666, 587, 1642, 591, - 531, 566, 531, 585, 536, 559, 563, 563, 1665, 567, 528, 588, 535, 561, - 534, 593, 529, 567, 556, 560, 535, 591, 530, 565, 531, 585, 1670, 563, - 1665, 568, 1660, 593, 1662, 560, 1668, 564, 1663, 590, 1666, 566, - - 129038, 4511, 4484, 564, 533, 583, 1670, 562, 1666, 587, 1668, 565, 532, 586, - 537, 559, 536, 591, 532, 564, 532, 594, 1660, 562, 1666, 566, 1660, 593, - 531, 565, 530, 586, 537, 558, 563, 563, 1664, 568, 528, 589, 535, 562, - 533, 595, 530, 567, 556, 560, 535, 591, 531, 565, 531, 584, 1669, 563, - 1664, 567, 1661, 592, 1662, 559, 1668, 564, 1663, 590, 1666, 566, 46187, 4511, - 4486, 562, 1665, 589, - - 110663, 4517, 4478, 558, 536, 590, 1665, 568, 1660, 593, 1661, 560, 536, 590, - 531, 564, 531, 584, 537, 558, 536, 590, 1665, 567, 1661, 561, 1666, 587, - 536, 560, 535, 591, 532, 564, 559, 557, 1670, 562, 532, 594, 529, 567, - 528, 649, 473, 561, 561, 565, 531, 585, 536, 559, 536, 589, 1665, 567, - 1660, 562, 1666, 587, 1668, 564, 1663, 558, 1669, 594, 1661, 561, - - 143736, 4517, 4479, 559, 536, 591, 1664, 558, 1670, 593, 1661, 559, 536, 590, - 531, 564, 531, 585, 536, 559, 537, 589, 1665, 567, 1661, 561, 1666, 587, - 536, 560, 536, 590, 530, 564, 557, 558, 1669, 562, 533, 593, 528, 568, - 530, 586, 534, 561, 560, 566, 530, 586, 536, 560, 536, 591, 1664, 558, - 1671, 562, 1666, 587, 1667, 565, 1663, 559, 1668, 594, 1660, 562, 46234, 4514, - 4482, 566, 1661, 591, - - 120661, 4564, 4432, 565, 530, 586, 1669, 563, 1665, 587, 1666, 566, 531, 585, - 536, 559, 536, 591, 532, 564, 532, 586, 1670, 563, 1666, 557, 1666, 592, - 530, 565, 530, 586, 536, 560, 562, 563, 1664, 558, 538, 588, 533, 562, - 533, 593, 528, 558, 565, 561, 534, 582, 541, 566, 530, 586, 1670, 563, - 1664, 567, 1660, 593, 1662, 560, 1668, 564, 1663, 590, 1665, 567, 46472, 4513, - 4484, 564, 1664, 588, - - 125301, 4511, 4484, 564, 532, 584, 1670, 562, 1666, 587, 1668, 565, 531, 586, - 537, 560, 537, 591, 532, 565, 533, 584, 1671, 562, 1666, 566, 1661, 591, - 530, 565, 532, 584, 536, 559, 562, 564, 1665, 567, 529, 587, 534, 563, - 535, 593, 529, 568, 556, 561, 535, 592, 531, 565, 531, 585, 1669, 563, - 1665, 567, 1660, 593, 1663, 559, 1668, 564, 1664, 589, 1666, 567, - - 200253, 4517, 4479, 558, 562, 615, 1613, 558, 1670, 592, 1661, 560, 536, 591, - 531, 616, 480, 585, 537, 559, 537, 641, 1613, 568, 1661, 582, 1646, 586, - 536, 559, 535, 591, 532, 564, 558, 558, 1670, 562, 533, 592, 530, 566, - 529, 588, 536, 581, 542, 617, 479, 587, 537, 560, 536, 590, 1665, 557, - 1670, 562, 1666, 587, 1668, 564, 1664, 558, 1669, 593, 1662, 561, 46230, 4570, - 4426, 561, 1667, 586, - - 115418, 4514, 4483, 565, 557, 561, 1669, 563, 1664, 589, 1666, 566, 529, 587, - 534, 561, 534, 592, 530, 566, 530, 586, 1668, 564, 1664, 589, 1639, 594, - 529, 567, 528, 587, 534, 561, 561, 565, 1663, 559, 535, 590, 532, 563, - 532, 584, -}; - -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 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}, - - {InfraredProtocolSamsung32, 0xAA, 0xAA, false}, - {InfraredProtocolSamsung32, 0xAA, 0xAA, true}, - {InfraredProtocolSamsung32, 0xAA, 0xAA, true}, - - {InfraredProtocolSamsung32, 0x55, 0x55, false}, - {InfraredProtocolSamsung32, 0x55, 0x55, true}, - {InfraredProtocolSamsung32, 0x55, 0x55, true}, - {InfraredProtocolSamsung32, 0x55, 0x55, true}, -}; - diff --git a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_sirc_test_data.srcdata b/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_sirc_test_data.srcdata deleted file mode 100644 index 52cc1533..00000000 --- a/applications/unit_tests/infrared_decoder_encoder/test_data/infrared_sirc_test_data.srcdata +++ /dev/null @@ -1,479 +0,0 @@ -const uint32_t test_decoder_sirc_input1[] = { /* 121 timings */ -1000000, 2420, 608, 1194, 608, 596, 604, 1198, 603, 591, 610, 1192, 609, 596, 605, 599, 601, 593, 607, 597, 604, 590, 610, 594, 606, 1196, - 25957, 2426, 603, 1199, 603, 591, 610, 1192, 610, 594, 606, 1196, 606, 599, 603, 591, 609, 595, 606, 598, 602, 592, 609, 596, 605, 1197, - 25960, 2423, 606, 1196, 606, 599, 602, 1200, 602, 592, 609, 1193, 609, 596, 606, 599, 602, 592, 609, 595, 605, 600, 601, 593, 608, 1194, -1000000, 2422, 607, 1195, 607, 598, 603, 1199, 604, 590, 610, 1192, 610, 594, 606, 598, 603, 591, 609, 595, 605, 600, 601, 593, 607, 1195, - 25955, 2418, 610, 1192, 610, 594, 606, 1196, 606, 599, 602, 1200, 602, 592, 608, 596, 604, 590, 611, 594, 607, 597, 603, 591, 609, 1193, - 25959, 2424, 604, 1198, 604, 590, 610, 1192, 610, 594, 606, 1196, 605, 600, 601, 593, 608, 597, 603, 591, 610, 595, 606, 598, 602, 1200, -1000000, 2424, 605, 599, 601, 593, 607, 597, 603, 591, 610, 594, 606, 1196, 606, 1196, 605, 600, 601, 593, 608, 597, 604, 590, 611, 1191, - 26586, 2425, 604, 590, 611, 593, 607, 598, 603, 591, 610, 595, 606, 1196, 606, 1196, 606, 599, 602, 592, 608, 596, 604, 590, 611, 1191, - 26586, 2424, 604, 590, 611, 593, 607, 598, 603, 591, 609, 595, 605, 1197, 605, 1197, 604, 590, 611, 593, 607, 597, 603, 591, 610, 1192, -1000000, 2424, 604, 1198, 604, 590, 611, 1191, 610, 594, 606, 598, 603, 1199, 602, 1200, 602, 592, 609, 595, 605, 600, 601, 593, 608, 1194, - 25386, 2419, 610, 1192, 610, 594, 606, 1196, 607, 597, 603, 591, 610, 1192, 609, 1193, 610, 594, 606, 598, 602, 592, 609, 595, 605, 1197, - 25385, 2421, 608, 1194, 608, 596, 605, 1197, 605, 599, 601, 593, 608, 1194, 608, 1194, 608, 596, 605, 589, 611, 594, 607, 597, 604, 1198, -1000000, 2426, 603, 1199, 602, 1200, 602, 1200, 602, 592, 608, 1194, 608, 596, 604, 590, 611, 594, 607, 597, 603, 591, 610, 594, 606, 1196, 605, 600, 601, 593, 608, 596, 604, 590, 610, 594, 607, 1195, 606, 598, 603, 591, - 15078, 2419, 610, 1192, 610, 1192, 610, 1192, 610, 594, 606, 1196, 605, 600, 601, 593, 608, 597, 604, 590, 610, 595, 606, 598, 602, 1200, 602, 592, 608, 597, 604, 590, 611, 594, 607, 597, 603, 1199, 603, 591, 609, 595, - 15075, 2422, 607, 1195, 607, 1195, 607, 1195, 607, 597, 604, 1198, 603, 591, 610, 594, 606, 598, 603, 591, 609, 595, 605, 600, 601, 1191, 611, 594, 607, 597, 603, 591, 610, 594, 606, 598, 602, 1200, 602, 592, 608, 596, -1000000, 2422, 607, 1195, 606, 599, 602, 592, 608, 596, 604, 590, 610, 1192, 610, 594, 606, 599, 602, 592, 608, 596, 604, 590, 610, 1192, - 26585, 2426, 602, 1200, 602, 592, 608, 596, 604, 590, 611, 594, 607, 1195, 607, 598, 603, 591, 610, 594, 606, 598, 603, 591, 609, 1193, - 26586, 2425, 604, 1198, 603, 591, 610, 594, 606, 598, 602, 592, 609, 1193, 608, 597, 605, 600, 601, 593, 607, 597, 604, 590, 610, 1192, -1000000, 2418, 610, 594, 606, 598, 603, 1199, 603, 1199, 603, 1199, 603, 1199, 603, 1199, 603, 591, 610, 1192, 610, 594, 606, 1196, 606, 1196, 606, 1196, 606, 598, 602, 592, 609, 1193, 609, 1193, 609, 1193, 609, 595, 605, 599, - 11557, 2418, 611, 594, 607, 598, 603, 1199, 603, 1199, 603, 1199, 602, 1200, 602, 1200, 601, 593, 608, 1194, 607, 597, 604, 1198, 603, 1199, 603, 1199, 602, 592, 608, 596, 604, 1198, 603, 1199, 603, 1199, 603, 591, 609, 595, - 11561, 2424, 604, 590, 610, 594, 607, 1195, 606, 1196, 606, 1196, 606, 1196, 606, 1196, 605, 600, 601, 1191, 611, 594, 607, 1195, 607, 1195, 607, 1195, 607, 597, 603, 591, 610, 1192, 610, 1192, 610, 1192, 610, 594, 606, 598, -1000000, 2424, 604, 590, 611, 594, 607, 1195, 607, 1195, 607, 1195, 607, 1195, 607, 1195, 606, 598, 603, 1199, 602, 592, 609, 1193, 608, 1194, 608, 1194, 608, 596, 604, 590, 611, 1191, 611, 1191, 611, 1191, 611, 594, 607, 598, - 11559, 2427, 602, 592, 608, 596, 605, 1197, 604, 1198, 604, 1198, 604, 1198, 604, 1198, 604, 590, 610, 1192, 610, 595, 606, 1196, 606, 1196, 606, 1196, 606, 599, 603, 591, 609, 1193, 609, 1193, 609, 1193, 608, 597, 605, 589, - 11567, 2418, 610, 595, 607, 597, 603, 1199, 603, 1199, 602, 1200, 602, 1200, 601, 1201, 601, 593, 608, 1194, 607, 598, 603, 1199, 603, 1199, 603, 1199, 603, 591, 609, 595, 605, 1197, 605, 1197, 605, 1197, 604, 590, 611, 594, -1000000, 2421, 608, 597, 604, 590, 610, 1192, 610, 1192, 609, 1193, 609, 1193, 609, 1193, 608, 596, 605, 1197, 604, 590, 610, 1192, 611, 1191, 610, 1192, 610, 594, 606, 598, 603, 1199, 603, 1199, 602, 1200, 602, 592, 608, 596, - 11561, 2424, 604, 590, 610, 594, 606, 1196, 606, 1196, 606, 1196, 606, 1196, 605, 1197, 605, 600, 601, 1201, 601, 593, 607, 1195, 607, 1195, 606, 1196, 606, 598, 602, 592, 608, 1194, 608, 1194, 607, 1195, 607, 597, 603, 591, - 11564, 2421, 607, 597, 604, 590, 610, 1192, 610, 1192, 610, 1192, 610, 1192, 610, 1192, 609, 595, 606, 1196, 606, 598, 602, 1200, 601, 1201, 601, 1201, 601, 593, 607, 598, 603, 1199, 603, 1199, 602, 1200, 602, 592, 608, 596, -1000000, 2420, 609, 595, 606, 598, 602, 1200, 602, 1200, 602, 1200, 602, 1200, 602, 1200, 602, 592, 608, 1194, 608, 596, 604, 1198, 603, 1199, 603, 1199, 603, 591, 610, 594, 606, 1196, 606, 1196, 606, 1196, 606, 598, 602, 592, - 11565, 2420, 609, 595, 605, 600, 601, 1201, 601, 1201, 601, 1201, 601, 1201, 601, 1201, 601, 593, 607, 1195, 607, 597, 603, 1199, 603, 1199, 603, 1199, 603, 591, 609, 595, 605, 1197, 605, 1197, 605, 1197, 605, 599, 601, 593, - 11563, 2422, 607, 597, 603, 591, 609, 1193, 609, 1193, 608, 1194, 608, 1194, 608, 1194, 582, 623, 603, 1199, 603, 591, 610, 1202, 599, 1203, 599, 1203, 599, 595, 581, 623, 577, 1225, 601, 1201, 601, 1201, 601, 593, 582, 623, -1000000, 2425, 602, 1200, 602, 1200, 602, 592, 608, 1194, 608, 1194, 607, 1195, 607, 1195, 607, 597, 603, 1199, 602, 592, 609, 1193, 608, 1194, 608, 1194, 607, 597, 603, 601, 575, 1227, 599, 1203, 599, 1203, 573, 621, 580, 625, - 10931, 2426, 578, 1224, 578, 1224, 578, 616, 585, 1217, 585, 1217, 585, 1217, 585, 1217, 585, 620, 580, 1222, 580, 624, 577, 1225, 577, 1225, 577, 1225, 577, 617, 583, 622, 580, 1222, 580, 1222, 579, 1223, 579, 625, 576, 618, - 10936, 2421, 583, 1219, 583, 1219, 582, 622, 579, 1223, 578, 1224, 578, 1224, 578, 1224, 578, 616, 584, 1218, 584, 621, 580, 1222, 579, 1223, 579, 1223, 579, 625, 576, 618, 583, 1219, 582, 1220, 582, 1220, 582, 622, 578, 616, -1000000, 2419, 584, 620, 580, 1222, 580, 624, 576, 1226, 576, 1226, 576, 1226, 576, 1226, 576, 618, 582, 1220, 582, 622, 579, 1223, 578, 1224, 579, 1223, 578, 616, 585, 619, 581, 1221, 581, 1221, 581, 1221, 580, 624, 576, 618, - 11563, 2422, 582, 622, 579, 1223, 578, 616, 585, 1217, 585, 1217, 584, 1218, 584, 1218, 583, 622, 579, 1223, 579, 625, 575, 1216, 585, 1217, 585, 1217, 585, 619, 581, 623, 577, 1225, 577, 1225, 577, 1225, 576, 618, 583, 621, - 11558, 2427, 577, 617, 584, 1218, 583, 621, 579, 1223, 579, 1223, 578, 1224, 578, 1224, 578, 647, 553, 1249, 553, 651, 549, 1253, 548, 1254, 549, 1253, 549, 645, 555, 649, 551, 1251, 551, 1251, 551, 1251, 550, 654, 546, 648, -1000000, 2456, 548, 646, 554, 650, 551, 653, 547, 1255, 547, 1255, 547, 1255, 547, 1255, 547, 647, 554, 1248, 554, 650, 551, 1251, 551, 1251, 551, 1251, 551, 653, 547, 647, 554, 1248, 554, 1248, 554, 1248, 553, 651, 550, 644, - 12112, 2449, 555, 649, 551, 654, 547, 647, 554, 1248, 554, 1248, 553, 1249, 553, 1249, 553, 651, 549, 1253, 549, 645, 555, 1247, 555, 1247, 555, 1247, 554, 650, 550, 655, 547, 1244, 557, 1224, 578, 1224, 579, 615, 585, 619, - 12139, 2423, 580, 624, 576, 618, 582, 622, 578, 1224, 578, 1224, 578, 1224, 578, 1224, 578, 616, 584, 1218, 584, 620, 580, 1222, 580, 1222, 581, 1221, 580, 624, 577, 617, 584, 1218, 584, 1218, 584, 1218, 584, 620, 581, 623, -1000000, 2422, 582, 1220, 581, 623, 578, 616, 584, 1218, 584, 1218, 584, 1218, 584, 1218, 584, 620, 580, 1222, 580, 624, 576, 1226, 577, 1225, 576, 1226, 576, 618, 583, 622, 579, 1223, 578, 1224, 577, 1225, 577, 617, 585, 619, - 11559, 2426, 577, 1225, 577, 617, 583, 621, 579, 1223, 579, 1223, 578, 1224, 578, 1224, 578, 616, 584, 1218, 584, 620, 580, 1222, 580, 1222, 579, 1223, 579, 625, 575, 650, 550, 1252, 550, 1252, 549, 1253, 549, 645, 556, 648, - 11531, 2453, 549, 1253, 548, 646, 555, 649, 551, 1251, 551, 1251, 550, 1252, 549, 1253, 549, 645, 556, 1246, 555, 649, 552, 1219, 582, 1220, 582, 1220, 582, 622, 578, 616, 585, 1217, 584, 1218, 584, 1218, 584, 620, 581, 623, -1000000, 2428, 576, 618, 582, 1220, 583, 622, 579, 1223, 578, 1224, 578, 1224, 578, 1224, 578, 616, 585, 1217, 585, 619, 582, 1220, 582, 1220, 582, 1220, 582, 622, 578, 616, 585, 1217, 585, 1217, 584, 1218, 584, 620, 581, 623, - 11557, 2427, 577, 617, 584, 1218, 583, 621, 580, 1222, 580, 1222, 580, 1222, 580, 1222, 580, 624, 576, 1246, 555, 649, 552, 1250, 552, 1250, 551, 1251, 551, 653, 548, 646, 554, 1248, 555, 1247, 555, 1247, 555, 649, 551, 653, - 11528, 2447, 556, 648, 552, 1250, 552, 653, 548, 1254, 548, 1254, 547, 1245, 557, 1245, 557, 647, 553, 1249, 552, 652, 549, 1253, 548, 1254, 548, 1254, 548, 646, 555, 649, 551, 1251, 551, 1251, 551, 1251, 551, 643, 557, 647, -1000000, 2418, 610, 594, 606, 598, 603, 1199, 603, 1199, 602, 1200, 602, 1200, 602, 1200, 602, 592, 608, 1194, 608, 596, 604, 1198, 604, 1198, 604, 1198, 603, 591, 610, 594, 606, 1196, 606, 1196, 605, 1197, 605, 599, 601, 593, - 11563, 2422, 606, 598, 602, 592, 608, 1194, 608, 1194, 608, 1194, 607, 1195, 607, 1195, 607, 597, 603, 1199, 603, 591, 609, 1193, 609, 1193, 609, 1193, 608, 596, 605, 599, 601, 1201, 600, 1191, 611, 1191, 611, 593, 606, 598, - 11558, 2427, 601, 593, 607, 597, 603, 1199, 603, 1199, 603, 1199, 602, 1200, 602, 1200, 601, 593, 607, 1195, 607, 597, 603, 1199, 603, 1199, 602, 1200, 602, 592, 608, 596, 604, 1198, 604, 1198, 604, 1198, 603, 591, 609, 595, -1000000, 2424, 605, 1197, 604, 600, 600, 1191, 610, 1192, 610, 1192, 610, 1192, 609, 1193, 609, 595, 605, 1197, 606, 598, 602, 1200, 602, 1200, 601, 1201, 601, 593, 607, 597, 603, 1199, 603, 1199, 603, 1199, 603, 591, 609, 595, - 10937, 2420, 609, 1193, 609, 595, 605, 1197, 605, 1197, 605, 1197, 605, 1197, 605, 1197, 605, 600, 601, 1201, 601, 593, 608, 1194, 608, 1194, 608, 1194, 609, 595, 605, 599, 601, 1201, 601, 1201, 601, 1201, 601, 593, 608, 596, - 10936, 2420, 608, 1194, 608, 596, 604, 1198, 605, 1197, 605, 1197, 605, 1197, 605, 1197, 605, 600, 601, 1201, 601, 593, 607, 1195, 608, 1194, 608, 1194, 608, 596, 604, 600, 600, 1202, 601, 1201, 601, 1201, 601, 593, 607, 597, -1000000, 2420, 609, 1193, 608, 1194, 608, 596, 579, 625, 600, 1202, 600, 1202, 600, 1202, 600, 594, 607, 1195, 607, 597, 603, 1199, 603, 1199, 602, 1200, 602, 592, 609, 595, 605, 1197, 605, 1197, 605, 1197, 604, 600, 600, 594, - 11561, 2423, 605, 1197, 605, 1197, 605, 599, 601, 593, 607, 1195, 607, 1195, 607, 1195, 607, 597, 604, 1198, 603, 591, 610, 1192, 610, 1192, 610, 1192, 610, 594, 607, 597, 603, 1199, 603, 1199, 603, 1199, 603, 591, 610, 594, - 11563, 2421, 608, 1194, 608, 1194, 608, 596, 605, 599, 601, 1201, 602, 1200, 602, 1200, 602, 592, 609, 1193, 609, 595, 605, 1197, 606, 1196, 606, 1196, 606, 598, 602, 592, 609, 1193, 609, 1193, 610, 1192, 610, 594, 607, 597, -1000000, 2428, 576, 1226, 600, 1192, 610, 594, 606, 598, 602, 1200, 602, 592, 609, 595, 605, 600, 601, 593, 607, 597, 603, 591, 609, 1193, - 25955, 2427, 601, 1190, 610, 1192, 610, 594, 606, 598, 602, 1200, 601, 593, 607, 597, 603, 591, 610, 594, 606, 598, 602, 592, 608, 1194, - 25957, 2425, 604, 1198, 603, 1199, 603, 591, 609, 595, 605, 1197, 605, 599, 601, 593, 607, 598, 603, 591, 610, 594, 606, 598, 602, 1200, - 25952, 2420, 608, 1194, 608, 1194, 608, 596, 604, 601, 600, 1191, 610, 594, 606, 598, 603, 591, 609, 595, 605, 599, 601, 593, 608, 1194, -1000000, 2421, 607, 597, 603, 1199, 603, 591, 610, 594, 606, 1196, 605, 600, 576, 618, 583, 621, 604, 601, 575, 619, 606, 598, 603, 1199, - 26576, 2424, 605, 600, 576, 1226, 601, 593, 608, 596, 604, 1198, 604, 600, 600, 594, 607, 597, 603, 591, 609, 595, 606, 598, 602, 1200, - 26579, 2420, 583, 621, 605, 1197, 604, 600, 601, 593, 607, 1195, 607, 597, 604, 590, 610, 594, 607, 597, 603, 591, 610, 594, 606, 1196, - 26584, 2426, 603, 591, 609, 1193, 609, 595, 605, 599, 601, 1201, 601, 593, 607, 597, 603, 591, 610, 594, 606, 598, 603, 591, 609, 1193, -1000000, 2418, 610, 594, 606, 598, 602, 592, 609, 595, 605, 1197, 605, 1197, 605, 600, 602, 592, 608, 1194, 608, 596, 605, 1197, 605, 1197, 604, 1198, 604, 600, 601, 593, 607, 1195, 607, 1195, 607, 1195, 607, 597, 603, 591, - 13368, 2419, 610, 594, 606, 598, 602, 592, 608, 596, 605, 1197, 604, 1198, 604, 600, 601, 593, 607, 1195, 607, 597, 603, 1199, 603, 1199, 603, 1199, 603, 591, 609, 595, 605, 1197, 605, 1197, 605, 1197, 604, 601, 600, 594, - 13362, 2425, 604, 601, 600, 594, 607, 597, 603, 591, 610, 1192, 610, 1192, 610, 594, 606, 598, 603, 1199, 602, 592, 609, 1193, 609, 1193, 608, 1194, 608, 596, 604, 601, 600, 1191, 610, 1192, 610, 1192, 610, 594, 607, 597, -1000000, 2427, 601, 1201, 601, 593, 582, 623, 603, 1199, 578, 1224, 603, 1199, 577, 617, 584, 620, 605, 1197, 605, 600, 601, 1201, 601, 1201, 601, 1201, 601, 593, 582, 622, 603, 1199, 603, 1199, 578, 1224, 603, 591, 610, 594, - 12139, 2423, 605, 1197, 605, 600, 601, 593, 608, 1194, 608, 1194, 607, 1195, 607, 597, 604, 600, 601, 1201, 601, 593, 607, 1195, 608, 1194, 608, 1194, 583, 622, 604, 601, 600, 1202, 575, 1227, 601, 1201, 576, 618, 607, 597, - 12137, 2424, 604, 1198, 604, 590, 610, 594, 607, 1195, 607, 1195, 607, 1195, 607, 597, 604, 601, 600, 1202, 600, 594, 607, 1195, 606, 1196, 581, 1221, 607, 597, 603, 591, 610, 1202, 600, 1202, 576, 1226, 602, 592, 609, 595, -1000000, 2422, 607, 1195, 607, 597, 603, 591, 585, 619, 606, 1196, 606, 1196, 581, 624, 577, 617, 609, 1193, 584, 621, 605, 1197, 604, 1198, 604, 1198, 604, 590, 610, 595, 581, 1221, 605, 1197, 605, 1197, 605, 599, 601, 593, - 12763, 2427, 603, 1199, 603, 591, 609, 595, 605, 599, 577, 1225, 602, 1200, 601, 593, 583, 622, 604, 1198, 604, 590, 610, 1192, 610, 1192, 610, 1192, 610, 594, 606, 598, 603, 1199, 603, 1199, 603, 1199, 603, 591, 610, 594, - 12763, 2427, 602, 1200, 601, 593, 608, 596, 604, 600, 600, 1202, 601, 1201, 601, 593, 607, 597, 604, 1198, 604, 590, 610, 1192, 610, 1192, 611, 1191, 610, 594, 607, 598, 578, 1224, 603, 1199, 603, 1199, 603, 591, 610, 594, -1000000, 2422, 607, 597, 603, 591, 610, 1192, 610, 594, 606, 1196, 580, 1222, 605, 600, 601, 593, 583, 1219, 608, 596, 579, 1223, 604, 1198, 604, 1198, 604, 590, 610, 594, 606, 1196, 606, 1196, 606, 1196, 606, 599, 602, 592, - 12765, 2425, 603, 591, 610, 594, 606, 1196, 606, 598, 602, 1200, 601, 1201, 601, 593, 582, 623, 604, 1198, 604, 590, 610, 1192, 610, 1192, 609, 1193, 609, 596, 605, 599, 601, 1201, 601, 1201, 601, 1201, 600, 594, 607, 597, - 12758, 2421, 607, 597, 603, 591, 609, 1193, 609, 595, 605, 1197, 605, 1197, 605, 599, 601, 593, 607, 1195, 607, 597, 603, 1199, 603, 1199, 603, 1199, 603, 591, 609, 595, 580, 1222, 605, 1197, 605, 1197, 605, 600, 600, 594, -1000000, 2422, 580, 625, 601, 1201, 601, 593, 608, 596, 604, 1198, 604, 1198, 604, 600, 600, 594, 607, 1195, 607, 597, 603, 1199, 603, 1199, 603, 1199, 578, 616, 609, 595, 606, 1196, 606, 1196, 606, 1196, 581, 624, 602, 592, - 12766, 2424, 605, 599, 601, 1201, 601, 593, 608, 596, 604, 1198, 604, 1198, 579, 625, 601, 593, 608, 1194, 608, 596, 604, 1198, 580, 1222, 605, 1197, 605, 599, 602, 592, 608, 1194, 609, 1193, 609, 1193, 609, 596, 605, 599, - 12759, 2420, 608, 597, 604, 1198, 604, 590, 610, 594, 606, 1196, 606, 1196, 606, 598, 602, 592, 608, 1194, 607, 597, 604, 1198, 603, 1199, 603, 1199, 602, 592, 609, 595, 605, 1197, 605, 1197, 605, 1197, 604, 600, 601, 593, -1000000, 2429, 600, 1202, 575, 1227, 599, 595, 606, 598, 602, 1200, 602, 1200, 602, 592, 609, 595, 605, 1197, 605, 599, 601, 1201, 601, 1201, 601, 1201, 601, 593, 607, 597, 603, 1199, 603, 1199, 603, 1199, 603, 591, 609, 595, - 12136, 2425, 603, 1199, 603, 1199, 603, 591, 609, 595, 605, 1197, 605, 1197, 605, 599, 601, 593, 608, 1194, 608, 596, 604, 1198, 604, 1198, 603, 1199, 603, 591, 609, 595, 606, 1196, 606, 1196, 605, 1197, 605, 599, 601, 593, - 12137, 2424, 604, 1198, 603, 1199, 603, 591, 609, 595, 606, 1196, 605, 1197, 605, 599, 601, 593, 607, 1195, 607, 597, 603, 1199, 603, 1199, 603, 1199, 602, 592, 609, 595, 605, 1197, 605, 1197, 604, 1198, 604, 600, 600, 594, -1000000, 2429, 574, 1228, 573, 1229, 573, 1229, 573, 1229, 573, 621, 581, 624, 577, 617, 583, 622, 580, 1222, 579, 625, 576, 1226, 577, 1225, 576, 1226, 577, 617, 584, 620, 581, 1221, 580, 1222, 579, 1223, 579, 625, 577, 617, - 12142, 2419, 584, 1218, 584, 1218, 583, 1219, 583, 1219, 582, 623, 578, 616, 585, 619, 581, 623, 578, 1224, 577, 617, 584, 1218, 584, 1218, 584, 1218, 584, 620, 580, 624, 576, 1226, 575, 1227, 500, 1353, 523, 620, 582, 622, /* failed, noise pollution 500, 1353 timings */ - 12134, 2427, 576, 1226, 576, 1226, 576, 1226, 576, 1226, 576, 618, 583, 622, 579, 625, 576, 618, 583, 1219, 583, 673, 527, 1223, 579, 1223, 579, 1223, 579, 625, 576, 618, 582, 1220, 582, 1220, 582, 1220, 582, 622, 578, 616, - 12140, 2421, 582, 1220, 581, 1221, 581, 1221, 580, 1222, 580, 624, 576, 618, 582, 622, 578, 616, 585, 1217, 584, 620, 581, 1221, 580, 1222, 580, 1222, 580, 624, 576, 618, 582, 1220, 582, 1220, 582, 1220, 582, 623, 578, 616, -1000000, 2419, 584, 672, 528, 625, 577, 617, 583, 1219, 582, 1220, 581, 1221, 582, 622, 578, 616, 585, 1217, 583, 621, 580, 1222, 580, 1222, 580, 1222, 580, 624, 576, 618, 583, 1219, 583, 1219, 582, 1220, 583, 621, 580, 624, - 12732, 2427, 577, 617, 584, 672, 528, 676, 524, 1226, 576, 1226, 576, 1226, 576, 618, 583, 621, 579, 1223, 579, 625, 575, 1227, 575, 1227, 575, 1227, 575, 671, 529, 675, 526, 1224, 578, 1224, 578, 1224, 578, 616, 585, 619, - 12738, 2421, 583, 621, 580, 624, 576, 618, 582, 1220, 582, 1220, 583, 1219, 583, 621, 579, 625, 576, 1226, 576, 670, 530, 1220, 582, 1220, 582, 1220, 581, 624, 577, 617, 584, 1218, 583, 1219, 583, 1219, 583, 622, 580, 624, -1000000, 2430, 599, 1192, 609, 595, 605, 1197, 580, 624, 601, 1201, 601, 593, 607, 597, 603, 591, 610, 594, 606, 598, 602, 592, 608, 1194, - 25958, 2423, 605, 1197, 604, 600, 575, 1227, 600, 594, 606, 1196, 606, 598, 602, 592, 608, 596, 604, 601, 600, 594, 607, 597, 603, 1199, - 25949, 2422, 607, 1195, 606, 598, 603, 1199, 602, 592, 608, 1194, 608, 596, 604, 600, 601, 593, 607, 597, 604, 600, 600, 594, 607, 1195, - 25958, 2423, 606, 1196, 606, 598, 602, 1200, 602, 592, 608, 1194, 608, 596, 605, 600, 601, 593, 607, 597, 603, 591, 610, 594, 606, 1196, - 25957, 2425, 604, 1198, 603, 591, 610, 1192, 610, 594, 606, 1196, 606, 598, 602, 592, 609, 595, 605, 599, 602, 592, 608, 596, 604, 1198, - 25956, 2426, 604, 1198, 603, 591, 610, 1192, 610, 594, 606, 1196, 606, 598, 602, 592, 608, 597, 605, 599, 601, 593, 607, 597, 603, 1199, - 25952, 2420, 609, 1193, 608, 596, 604, 1198, 604, 590, 610, 1192, 610, 594, 606, 598, 602, 592, 608, 596, 605, 599, 601, 593, 607, 1195, -1000000, 2422, 583, 1219, 608, 596, 605, 1197, 580, 624, 601, 1201, 601, 593, 608, 596, 604, 600, 601, 593, 607, 597, 604, 590, 610, 1202, - 25955, 2427, 603, 1199, 603, 591, 609, 1193, 610, 594, 606, 1196, 607, 597, 603, 591, 609, 595, 606, 598, 602, 592, 609, 595, 605, 1197, - 25957, 2425, 604, 1198, 604, 590, 610, 1192, 610, 594, 581, 1221, 606, 598, 602, 592, 608, 596, 605, 599, 601, 593, 607, 597, 604, 1198, - 25954, 2418, 610, 1192, 610, 594, 606, 1196, 605, 599, 601, 1201, 601, 593, 608, 596, 604, 590, 610, 594, 606, 598, 603, 591, 609, 1193, - 25958, 2424, 604, 1198, 604, 590, 610, 1192, 610, 594, 606, 1196, 606, 598, 602, 592, 609, 595, 605, 600, 601, 593, 607, 597, 603, 1199, - 25953, 2419, 610, 1192, 609, 595, 605, 1197, 605, 600, 601, 1201, 600, 594, 607, 597, 603, 591, 609, 595, 605, 599, 601, 593, 608, 1194, - 25954, 2418, 611, 1191, 610, 594, 606, 1196, 606, 598, 602, 1200, 602, 592, 608, 596, 604, 601, 600, 594, 607, 597, 603, 591, 609, 1193, - 25958, 2424, 605, 1197, 605, 599, 601, 1201, 600, 594, 607, 1195, 607, 597, 603, 591, 609, 596, 605, 599, 602, 592, 608, 596, 605, 1197, - 25954, 2428, 601, 1190, 610, 594, 607, 1195, 606, 598, 602, 1200, 602, 592, 608, 596, 604, 590, 610, 594, 606, 598, 603, 591, 609, 1193, - 25960, 2422, 607, 1195, 606, 598, 602, 1200, 602, 592, 609, 1193, 609, 595, 605, 599, 601, 593, 607, 597, 604, 590, 610, 594, 606, 1196, - 25957, 2424, 605, 1197, 604, 600, 600, 1202, 601, 593, 607, 1195, 607, 597, 603, 591, 610, 594, 606, 598, 603, 591, 609, 595, 606, 1196, -1000000, 2421, 608, 1194, 608, 596, 604, 1198, 604, 601, 575, 1227, 601, 593, 607, 598, 604, 600, 600, 594, 607, 598, 604, 601, 600, 1202, - 25953, 2419, 609, 1193, 609, 596, 605, 1197, 605, 600, 601, 1201, 601, 593, 607, 597, 603, 591, 610, 594, 606, 599, 602, 592, 608, 1194, - 25958, 2424, 605, 1197, 605, 600, 601, 1201, 600, 594, 607, 1195, 606, 598, 602, 592, 609, 595, 605, 600, 601, 593, 608, 596, 604, 1198, -1000000, 2423, 606, 1196, 606, 598, 602, 1200, 602, 592, 608, 1194, 608, 597, 604, 590, 610, 594, 607, 597, 603, 591, 610, 594, 606, 1196, - 25958, 2424, 605, 1197, 604, 600, 601, 1201, 601, 593, 607, 1195, 607, 597, 604, 590, 610, 595, 607, 597, 603, 591, 610, 594, 607, 1195, - 25961, 2421, 608, 1194, 608, 596, 605, 1197, 605, 600, 601, 1201, 601, 593, 607, 597, 603, 591, 610, 594, 606, 598, 602, 592, 609, 1193, -1000000, 2429, 601, 1201, 601, 593, 607, 1195, 608, 596, 604, 1198, 604, 600, 601, 593, 607, 597, 604, 590, 611, 593, 607, 597, 604, 1198, - 25959, 2422, 607, 1195, 607, 597, 603, 1199, 603, 591, 609, 1193, 610, 594, 606, 598, 602, 592, 609, 595, 605, 599, 602, 592, 608, 1194, - 25959, 2421, 608, 1194, 607, 597, 603, 1199, 603, 591, 610, 1192, 610, 594, 606, 598, 603, 591, 609, 595, 605, 599, 602, 592, 608, 1194, - 25959, 2422, 608, 1194, 608, 596, 604, 1198, 604, 590, 611, 1201, 601, 593, 607, 597, 604, 590, 610, 594, 607, 597, 603, 591, 609, 1193, - 25962, 2418, 610, 1192, 610, 594, 606, 1196, 607, 597, 603, 1199, 603, 591, 609, 595, 605, 599, 602, 592, 608, 596, 605, 599, 601, 1201, - -1000000, 2357, 610, 1183, 592, 1191, 614, 1179, 595, 1188, 618, 584, 613, 1180, 593, 588, 613, 1190, 612, 590, 605, 587, 613, 589, 605, 587, - 25398, 2355, 623, 1180, 591, 1181, 627, 1186, 589, 1183, 618, 584, 616, 1187, 587, 584, 614, 1189, 615, 587, 605, 587, 615, 587, 609, 593, -1000000, 2383, 609, 1214, 600, 612, 580, 1213, 608, 614, 583, 1210, 605, 607, 586, 616, 611, 1192, 599, 613, 608, 614, 579, 613, 615, 607, - 26670, 2387, 601, 1212, 600, 612, 589, 1214, 603, 609, 586, 1217, 595, 607, 594, 618, 606, 1187, 602, 610, 609, 613, 588, 614, 610, 612, -1000000, 2445, 582, 1221, 603, 548, 602, 1191, 609, 572, 602, 1191, 609, 542, 607, 544, 631, 1172, 603, 568, 606, 545, 605, 566, 608, 543, - 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 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}, -}; - - -// command (0x55) address (0x0A) SIRC -// 1 0 1 0 1 0 1 0 1 0 1 0 -// 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, -// -// command (0x7F) address (0x1F) SIRC -// 1 1 1 1 1 1 1 1 1 1 1 1 -// 2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, -// -// command (0x00) address (0x00) SIRC -// 0 0 0 0 0 0 0 0 0 0 0 0 -// 2400, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, -// -// command (0x53) address (0x0D) SIRC -// 1 1 0 0 1 0 1 1 0 1 1 0 -// 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 uint32_t test_decoder_sirc_input2[] = { -1000000, 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, -1000000, 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, -1000000, 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, -1000000, 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, 600, 600, /* failed - should be skipped */ - -1000000, 2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, -1000000, 2400, 600, 1200, 600, 600, /* failed - should be skipped */ -1000000, 2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, -1000000, 2400, 600, 1200, 600, /* failed - should be skipped */ - 2400, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, 600, 1200, -1000000, 2400, 600, 1200, 600, 600, /* failed - should be skipped */ -1000000, 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, - -1000000, 2400, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, - -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 InfraredMessage test_decoder_sirc_expected2[] = { - {InfraredProtocolSIRC, 0xA, 0x55, false}, - {InfraredProtocolSIRC, 0xA, 0x55, false}, - {InfraredProtocolSIRC, 0xA, 0x55, false}, - /* failed - 13 data bits */ - - {InfraredProtocolSIRC, 0x1F, 0x7F, false}, - /* failed - 2 data bits */ - {InfraredProtocolSIRC, 0x1F, 0x7F, false}, - /* failed - sudden end */ - {InfraredProtocolSIRC, 0x1F, 0x7F, false}, - /* failed */ - {InfraredProtocolSIRC, 0x0A, 0x55, false}, - - {InfraredProtocolSIRC, 0x00, 0x00, false}, - - {InfraredProtocolSIRC, 0x0D, 0x53, false}, -}; - - -// command (0x13) address (0xFD) SIRC15 -// 1 1 0 0 1 0 0 1 0 1 1 1 1 1 1 -// 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, -// -// command (0x53) address (0x7D) SIRC15 -// 1 1 0 0 1 0 1 1 0 1 1 1 1 1 0 -// 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, -// -// command (0x53) address (0x0D) SIRC15 -// 1 1 0 0 1 0 1 1 0 1 1 0 0 0 0 -// 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, 600, 600, 600, 600, 600, - -const uint32_t test_decoder_sirc_input3[] = { -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, 1200, 600, 1200, 600, 1200, 600, 600, - 10000, 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, - 10000, 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, - -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, 600, 600, 600, 600, 600, - 10000, 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, 600, 600, 600, 600, 600, - 10000, 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, 600, 600, 600, 600, 600, - -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, 600, 600, 600, 600, 600, -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, 600, 600, 600, 600, 600, - -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, 1200, 600, 1200, 600, 1200, 600, 600, -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, 1200, 600, 1200, 600, 1200, 600, 600, - - 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 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[] = { -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, -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, -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, -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, -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, -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 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[] = { -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, -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, 1200, 600, 1200, 600, 1200, 600, 600, -1000000, 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, -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, -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, 1200, 600, 1200, 600, 1200, 600, 600, -1000000, 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, - -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, -10000, 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, -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, -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, -10000, 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, -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, - -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, -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, -10000, 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, -10000, 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, -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, -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, - -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, -10000, 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, -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, -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, -10000, 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, -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 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}, - - {InfraredProtocolSIRC20, 0xFB5, 0x53, false}, - {InfraredProtocolSIRC15, 0x7D, 0x53, false}, - {InfraredProtocolSIRC, 0xA, 0x55, false}, - {InfraredProtocolSIRC20, 0xFB5, 0x53, false}, - {InfraredProtocolSIRC15, 0x7D, 0x53, false}, - {InfraredProtocolSIRC, 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}, - - {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 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 InfraredMessage test_encoder_sirc_input2[] = { - {InfraredProtocolSIRC15, 0x7D, 0x53, false}, - {InfraredProtocolSIRC15, 0x7D, 0x53, true}, - {InfraredProtocolSIRC15, 0x7D, 0x53, true}, -}; - -const uint32_t test_encoder_sirc_expected2[] = { - 10000, 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, - 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, - 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 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}, - - {InfraredProtocolSIRC, 0x1A, 0x22, false}, - {InfraredProtocolSIRC, 0x1A, 0x22, true}, - {InfraredProtocolSIRC, 0x1A, 0x22, true}, - {InfraredProtocolSIRC, 0x17, 0x0A, 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}, - - {InfraredProtocolSIRC20, 0xAA, 0x55, false}, - {InfraredProtocolSIRC20, 0x331, 0x71, 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}, -}; - diff --git a/applications/unit_tests/test_index.c b/applications/unit_tests/test_index.c index 8ff27b4d..9f12adae 100644 --- a/applications/unit_tests/test_index.c +++ b/applications/unit_tests/test_index.c @@ -10,8 +10,8 @@ #define TAG "UnitTests" -int run_minunit(); -int run_minunit_test_infrared_decoder_encoder(); +int run_minunit_test_furi(); +int run_minunit_test_infrared(); int run_minunit_test_rpc(); int run_minunit_test_flipper_format(); int run_minunit_test_flipper_format_string(); @@ -21,14 +21,35 @@ int run_minunit_test_subghz(); int run_minunit_test_dirwalk(); int run_minunit_test_nfc(); -void minunit_print_progress(void) { - static char progress[] = {'\\', '|', '/', '-'}; +typedef int (*UnitTestEntry)(); + +typedef struct { + const char* name; + const UnitTestEntry entry; +} UnitTest; + +const UnitTest unit_tests[] = { + {.name = "furi", .entry = run_minunit_test_furi}, + {.name = "storage", .entry = run_minunit_test_storage}, + {.name = "stream", .entry = run_minunit_test_stream}, + {.name = "dirwalk", .entry = run_minunit_test_dirwalk}, + {.name = "flipper_format", .entry = run_minunit_test_flipper_format}, + {.name = "flipper_format_string", .entry = run_minunit_test_flipper_format_string}, + {.name = "rpc", .entry = run_minunit_test_rpc}, + {.name = "subghz", .entry = run_minunit_test_subghz}, + {.name = "infrared", .entry = run_minunit_test_infrared}, + {.name = "nfc", .entry = run_minunit_test_nfc}, +}; + +void minunit_print_progress() { + static const char progress[] = {'\\', '|', '/', '-'}; static uint8_t progress_counter = 0; static TickType_t last_tick = 0; TickType_t current_tick = xTaskGetTickCount(); if(current_tick - last_tick > 20) { last_tick = current_tick; printf("[%c]\033[3D", progress[++progress_counter % COUNT_OF(progress)]); + fflush(stdout); } } @@ -40,7 +61,7 @@ void unit_tests_cli(Cli* cli, string_t args, void* context) { UNUSED(cli); UNUSED(args); UNUSED(context); - uint32_t test_result = 0; + uint32_t failed_tests = 0; minunit_run = 0; minunit_assert = 0; minunit_fail = 0; @@ -51,7 +72,7 @@ void unit_tests_cli(Cli* cli, string_t args, void* context) { // TODO: lock device while test running if(loader_is_locked(loader)) { - FURI_LOG_E(TAG, "RPC: stop all applications to run tests"); + printf("RPC: stop all applications to run tests\r\n"); notification_message(notification, &sequence_blink_magenta_100); } else { notification_message_block(notification, &sequence_set_only_blue_255); @@ -59,34 +80,39 @@ void unit_tests_cli(Cli* cli, string_t args, void* context) { uint32_t heap_before = memmgr_get_free_heap(); uint32_t cycle_counter = furi_hal_get_tick(); - test_result |= run_minunit(); - test_result |= run_minunit_test_storage(); - test_result |= run_minunit_test_stream(); - test_result |= run_minunit_test_dirwalk(); - test_result |= run_minunit_test_flipper_format(); - test_result |= run_minunit_test_flipper_format_string(); - test_result |= run_minunit_test_infrared_decoder_encoder(); - test_result |= run_minunit_test_rpc(); - test_result |= run_minunit_test_subghz(); - test_result |= run_minunit_test_nfc(); + for(size_t i = 0; i < COUNT_OF(unit_tests); i++) { + if(cli_cmd_interrupt_received(cli)) { + break; + } + if(string_size(args)) { + if(string_cmp_str(args, unit_tests[i].name) == 0) { + failed_tests += unit_tests[i].entry(); + } else { + printf("Skipping %s\r\n", unit_tests[i].name); + } + } else { + failed_tests += unit_tests[i].entry(); + } + } + printf("\r\nFailed tests: %lu\r\n", failed_tests); + + // Time report cycle_counter = (furi_hal_get_tick() - cycle_counter); + printf("Consumed: %lu ms\r\n", cycle_counter); - FURI_LOG_I(TAG, "Consumed: %u us", cycle_counter); + // Wait for tested services and apps to deallocate memory + furi_hal_delay_ms(200); + uint32_t heap_after = memmgr_get_free_heap(); + printf("Leaked: %ld\r\n", heap_before - heap_after); - if(test_result == 0) { - furi_hal_delay_ms(200); /* wait for tested services and apps to deallocate */ - uint32_t heap_after = memmgr_get_free_heap(); + // Final Report + if(failed_tests == 0) { notification_message(notification, &sequence_success); - if(heap_after != heap_before) { - FURI_LOG_E(TAG, "Leaked: %d", heap_before - heap_after); - } else { - FURI_LOG_I(TAG, "No leaks"); - } - FURI_LOG_I(TAG, "PASSED"); + printf("Status: PASSED\r\n"); } else { notification_message(notification, &sequence_error); - FURI_LOG_E(TAG, "FAILED"); + printf("Status: FAILED\r\n"); } } |