+
+#include "unishox2.h"
+
+/// uint8_t is unsigned char
+typedef unsigned char uint8_t;
+
+const char *USX_FREQ_SEQ_DFLT[] = {"\": \"", "\": ", "", "=\"", "\":\"", "://"};
+const char *USX_FREQ_SEQ_TXT[] = {" the ", " and ", "tion", " with", "ing", "ment"};
+const char *USX_FREQ_SEQ_URL[] = {"https://", "www.", ".com", "http://", ".org", ".net"};
+const char *USX_FREQ_SEQ_JSON[] = {"\": \"", "\": ", "\",", "}}}", "\":\"", "}}"};
+const char *USX_FREQ_SEQ_HTML[] = {"", "=\"", "div", "href", "class", ""};
+const char *USX_FREQ_SEQ_XML[] = {"", "=\"", "\">", "', ':', '\n', 0, '[',
+ ']', '\\', ';', '\'', '\t', '@', '*', '&', '?', '!',
+ '^', '|', '\r', '~', '`', 0, 0, 0},
+ {0, ',', '.', '0', '1', '9', '2', '5', '-', '/', '3', '4', '6', '7',
+ '8', '(', ')', ' ', '=', '+', '$', '%', '#', 0, 0, 0, 0, 0}};
+
+/// Stores position of letter in usx_sets.
+/// First 3 bits - position in usx_hcodes
+/// Next 5 bits - position in usx_vcodes
+uint8_t usx_code_94[94];
+
+/// Vertical codes starting from the MSB
+uint8_t usx_vcodes[] = {0x00, 0x40, 0x60, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xD8,
+ 0xE0, 0xE4, 0xE8, 0xEC, 0xEE, 0xF0, 0xF2, 0xF4, 0xF6, 0xF7,
+ 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF};
+
+/// Length of each veritical code
+uint8_t usx_vcode_lens[] = {2, 3, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 7,
+ 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8};
+
+/// Vertical Codes and Set number for frequent sequences in sets USX_SYM and USX_NUM. First 3 bits
+/// indicate set (USX_SYM/USX_NUM) and rest are vcode positions
+uint8_t usx_freq_codes[] = {
+ (1 << 5) + 25, (1 << 5) + 26, (1 << 5) + 27, (2 << 5) + 23, (2 << 5) + 24, (2 << 5) + 25};
+
+/// Not used
+const int UTF8_MASK[] = {0xE0, 0xF0, 0xF8};
+/// Not used
+const int UTF8_PREFIX[] = {0xC0, 0xE0, 0xF0};
+
+/// Minimum length to consider as repeating sequence
+#define NICE_LEN 5
+
+/// Set (USX_NUM - 2) and vertical code (26) for encoding repeating letters
+#define RPT_CODE ((2 << 5) + 26)
+/// Set (USX_NUM - 2) and vertical code (27) for encoding terminator
+#define TERM_CODE ((2 << 5) + 27)
+/// Set (USX_SYM - 1) and vertical code (7) for encoding Line feed \\n
+#define LF_CODE ((1 << 5) + 7)
+/// Set (USX_NUM - 1) and vertical code (8) for encoding \\r\\n
+#define CRLF_CODE ((1 << 5) + 8)
+/// Set (USX_NUM - 1) and vertical code (22) for encoding \\r
+#define CR_CODE ((1 << 5) + 22)
+/// Set (USX_NUM - 1) and vertical code (14) for encoding \\t
+#define TAB_CODE ((1 << 5) + 14)
+/// Set (USX_NUM - 2) and vertical code (17) for space character when it appears in USX_NUM state
+/// \\r
+#define NUM_SPC_CODE ((2 << 5) + 17)
+
+/// Code for special code (11111) when state=USX_DELTA
+#define UNI_STATE_SPL_CODE 0xF8
+/// Length of Code for special code when state=USX_DELTA
+#define UNI_STATE_SPL_CODE_LEN 5
+/// Code for switch code when state=USX_DELTA
+#define UNI_STATE_SW_CODE 0x80
+/// Length of Code for Switch code when state=USX_DELTA
+#define UNI_STATE_SW_CODE_LEN 2
+
+/// Switch code in USX_ALPHA and USX_NUM 00
+#define SW_CODE 0
+/// Length of Switch code
+#define SW_CODE_LEN 2
+/// Terminator bit sequence for Preset 1. Length varies depending on state as per following macros
+#define TERM_BYTE_PRESET_1 0
+/// Length of Terminator bit sequence when state is lower
+#define TERM_BYTE_PRESET_1_LEN_LOWER 6
+/// Length of Terminator bit sequence when state is upper
+#define TERM_BYTE_PRESET_1_LEN_UPPER 4
+
+/// Offset at which usx_code_94 starts
+#define USX_OFFSET_94 33
+
+/// global to indicate whether initialization is complete or not
+uint8_t is_inited = 0;
+
+/// Fills the usx_code_94 94 letter array based on sets of characters at usx_sets \n
+/// For each element in usx_code_94, first 3 msb bits is set (USX_ALPHA / USX_SYM / USX_NUM) \n
+/// and the rest 5 bits indicate the vertical position in the corresponding set
+void init_coder() {
+ if (is_inited)
+ return;
+ memset(usx_code_94, '\0', sizeof(usx_code_94));
+ for (int i = 0; i < 3; i++) {
+ for (int j = 0; j < 28; j++) {
+ uint8_t c = usx_sets[i][j];
+ if (c > 32) {
+ usx_code_94[c - USX_OFFSET_94] = (i << 5) + j;
+ if (c >= 'a' && c <= 'z')
+ usx_code_94[c - USX_OFFSET_94 - ('a' - 'A')] = (i << 5) + j;
+ }
+ }
+ }
+ is_inited = 1;
+}
+
+/// Mask for retrieving each code to be encoded according to its length
+unsigned int usx_mask[] = {0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF};
+
+/// Appends specified number of bits to the output (out) \n
+/// If maximum limit (olen) is reached, -1 is returned \n
+/// Otherwise clen bits in code are appended to out starting with MSB
+int append_bits(char *out, int olen, int ol, uint8_t code, int clen) {
+ // printf("%d,%x,%d,%d\n", ol, code, clen, state);
+
+ while (clen > 0) {
+ int oidx;
+ unsigned char a_byte;
+
+ uint8_t cur_bit = ol % 8;
+ uint8_t blen = clen;
+ a_byte = code & usx_mask[blen - 1];
+ a_byte >>= cur_bit;
+ if (blen + cur_bit > 8)
+ blen = (8 - cur_bit);
+ oidx = ol / 8;
+ if (oidx < 0 || olen <= oidx)
+ return -1;
+ if (cur_bit == 0)
+ out[oidx] = a_byte;
+ else
+ out[oidx] |= a_byte;
+ code <<= blen;
+ ol += blen;
+ clen -= blen;
+ }
+ return ol;
+}
+
+/// This is a safe call to append_bits() making sure it does not write past olen
+#define SAFE_APPEND_BITS(exp) \
+ do { \
+ const int newidx = (exp); \
+ if (newidx < 0) \
+ return newidx; \
+ } while (0)
+
+/// Appends switch code to out depending on the state (USX_DELTA or other)
+int append_switch_code(char *out, int olen, int ol, uint8_t state) {
+ if (state == USX_DELTA) {
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, UNI_STATE_SPL_CODE, UNI_STATE_SPL_CODE_LEN));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, UNI_STATE_SW_CODE, UNI_STATE_SW_CODE_LEN));
+ } else
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, SW_CODE, SW_CODE_LEN));
+ return ol;
+}
+
+/// Appends given horizontal and veritical code bits to out
+int append_code(char *out,
+ int olen,
+ int ol,
+ uint8_t code,
+ uint8_t *state,
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[]) {
+ uint8_t hcode = code >> 5;
+ uint8_t vcode = code & 0x1F;
+ if (!usx_hcode_lens[hcode] && hcode != USX_ALPHA)
+ return ol;
+ switch (hcode) {
+ case USX_ALPHA:
+ if (*state != USX_ALPHA) {
+ SAFE_APPEND_BITS(ol = append_switch_code(out, olen, ol, *state));
+ SAFE_APPEND_BITS(
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ *state = USX_ALPHA;
+ }
+ break;
+ case USX_SYM:
+ SAFE_APPEND_BITS(ol = append_switch_code(out, olen, ol, *state));
+ SAFE_APPEND_BITS(
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_SYM], usx_hcode_lens[USX_SYM]));
+ break;
+ case USX_NUM:
+ if (*state != USX_NUM) {
+ SAFE_APPEND_BITS(ol = append_switch_code(out, olen, ol, *state));
+ SAFE_APPEND_BITS(
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_NUM], usx_hcode_lens[USX_NUM]));
+ if (usx_sets[hcode][vcode] >= '0' && usx_sets[hcode][vcode] <= '9')
+ *state = USX_NUM;
+ }
+ }
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, usx_vcodes[vcode], usx_vcode_lens[vcode]));
+ return ol;
+}
+
+/// Length of bits used to represent count for each level
+const uint8_t count_bit_lens[5] = {2, 4, 7, 11, 16};
+/// Cumulative counts represented at each level
+const int32_t count_adder[5] = {4, 20, 148, 2196, 67732};
+/// Codes used to specify the level that the count belongs to
+const uint8_t count_codes[] = {0x01, 0x82, 0xC3, 0xE4, 0xF4};
+/// Encodes given count to out
+int encodeCount(char *out, int olen, int ol, int count) {
+ // First five bits are code and Last three bits of codes represent length
+ for (int i = 0; i < 5; i++) {
+ if (count < count_adder[i]) {
+ SAFE_APPEND_BITS(
+ ol = append_bits(out, olen, ol, (count_codes[i] & 0xF8), count_codes[i] & 0x07));
+ uint16_t count16 = (count - (i ? count_adder[i - 1] : 0)) << (16 - count_bit_lens[i]);
+ if (count_bit_lens[i] > 8) {
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, count16 >> 8, 8));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, count16 & 0xFF, count_bit_lens[i] - 8));
+ } else
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, count16 >> 8, count_bit_lens[i]));
+ return ol;
+ }
+ }
+ return ol;
+}
+
+/// Length of bits used to represent delta code for each level
+const uint8_t uni_bit_len[5] = {6, 12, 14, 16, 21};
+/// Cumulative delta codes represented at each level
+const int32_t uni_adder[5] = {0, 64, 4160, 20544, 86080};
+
+/// Encodes the unicode code point given by code to out. prev_code is used to calculate the delta
+int encodeUnicode(char *out, int olen, int ol, int32_t code, int32_t prev_code) {
+ // First five bits are code and Last three bits of codes represent length
+ // const uint8_t codes[8] = {0x00, 0x42, 0x83, 0xA3, 0xC3, 0xE4, 0xF5, 0xFD};
+ const uint8_t codes[6] = {0x01, 0x82, 0xC3, 0xE4, 0xF5, 0xFD};
+ int32_t till = 0;
+ int32_t diff = code - prev_code;
+ if (diff < 0)
+ diff = -diff;
+ // printf("%ld, ", code);
+ // printf("Diff: %d\n", diff);
+ for (int i = 0; i < 5; i++) {
+ till += (1 << uni_bit_len[i]);
+ if (diff < till) {
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, (codes[i] & 0xF8), codes[i] & 0x07));
+ // if (diff) {
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, prev_code > code ? 0x80 : 0, 1));
+ int32_t val = diff - uni_adder[i];
+ // printf("Val: %d\n", val);
+ if (uni_bit_len[i] > 16) {
+ val <<= (24 - uni_bit_len[i]);
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, val >> 16, 8));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, (val >> 8) & 0xFF, 8));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, val & 0xFF, uni_bit_len[i] - 16));
+ } else if (uni_bit_len[i] > 8) {
+ val <<= (16 - uni_bit_len[i]);
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, val >> 8, 8));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, val & 0xFF, uni_bit_len[i] - 8));
+ } else {
+ val <<= (8 - uni_bit_len[i]);
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, val & 0xFF, uni_bit_len[i]));
+ }
+ return ol;
+ }
+ }
+ return ol;
+}
+
+/// Reads UTF-8 character from in. Also returns the number of bytes occupied by the UTF-8 character
+/// in utf8len
+int32_t readUTF8(const char *in, int len, int l, int *utf8len) {
+ int32_t ret = 0;
+ if (l < (len - 1) && (in[l] & 0xE0) == 0xC0 && (in[l + 1] & 0xC0) == 0x80) {
+ *utf8len = 2;
+ ret = (in[l] & 0x1F);
+ ret <<= 6;
+ ret += (in[l + 1] & 0x3F);
+ if (ret < 0x80)
+ ret = 0;
+ } else if (l < (len - 2) && (in[l] & 0xF0) == 0xE0 && (in[l + 1] & 0xC0) == 0x80 &&
+ (in[l + 2] & 0xC0) == 0x80) {
+ *utf8len = 3;
+ ret = (in[l] & 0x0F);
+ ret <<= 6;
+ ret += (in[l + 1] & 0x3F);
+ ret <<= 6;
+ ret += (in[l + 2] & 0x3F);
+ if (ret < 0x0800)
+ ret = 0;
+ } else if (l < (len - 3) && (in[l] & 0xF8) == 0xF0 && (in[l + 1] & 0xC0) == 0x80 &&
+ (in[l + 2] & 0xC0) == 0x80 && (in[l + 3] & 0xC0) == 0x80) {
+ *utf8len = 4;
+ ret = (in[l] & 0x07);
+ ret <<= 6;
+ ret += (in[l + 1] & 0x3F);
+ ret <<= 6;
+ ret += (in[l + 2] & 0x3F);
+ ret <<= 6;
+ ret += (in[l + 3] & 0x3F);
+ if (ret < 0x10000)
+ ret = 0;
+ }
+ return ret;
+}
+
+/// Finds the longest matching sequence from the beginning of the string. \n
+/// If a match is found and it is longer than NICE_LEN, it is encoded as a repeating sequence to out
+/// \n This is also used for Unicode strings \n This is a crude implementation that is not
+/// optimized. Assuming only short strings \n are encoded, this is not much of an issue.
+int matchOccurance(const char *in,
+ int len,
+ int l,
+ char *out,
+ int olen,
+ int *ol,
+ const uint8_t *state,
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[]) {
+ int j, k;
+ int longest_dist = 0;
+ int longest_len = 0;
+ for (j = l - NICE_LEN; j >= 0; j--) {
+ for (k = l; k < len && j + k - l < l; k++) {
+ if (in[k] != in[j + k - l])
+ break;
+ }
+ while ((((unsigned char)in[k]) >> 6) == 2)
+ k--; // Skip partial UTF-8 matches
+ // if ((in[k - 1] >> 3) == 0x1E || (in[k - 1] >> 4) == 0x0E || (in[k - 1] >> 5) == 0x06)
+ // k--;
+ if ((k - l) > (NICE_LEN - 1)) {
+ int match_len = k - l - NICE_LEN;
+ int match_dist = l - j - NICE_LEN + 1;
+ if (match_len > longest_len) {
+ longest_len = match_len;
+ longest_dist = match_dist;
+ }
+ }
+ }
+ if (longest_len) {
+ SAFE_APPEND_BITS(*ol = append_switch_code(out, olen, *ol, *state));
+ SAFE_APPEND_BITS(*ol = append_bits(
+ out, olen, *ol, usx_hcodes[USX_DICT], usx_hcode_lens[USX_DICT]));
+ // printf("Len:%d / Dist:%d/%.*s\n", longest_len, longest_dist, longest_len + NICE_LEN, in + l -
+ // longest_dist - NICE_LEN + 1);
+ SAFE_APPEND_BITS(*ol = encodeCount(out, olen, *ol, longest_len));
+ SAFE_APPEND_BITS(*ol = encodeCount(out, olen, *ol, longest_dist));
+ l += (longest_len + NICE_LEN);
+ l--;
+ return l;
+ }
+ return -l;
+}
+
+/// This is used only when encoding a string array
+/// Finds the longest matching sequence from the previous array element to the beginning of the
+/// string array. \n If a match is found and it is longer than NICE_LEN, it is encoded as a
+/// repeating sequence to out \n This is also used for Unicode strings \n This is a crude
+/// implementation that is not optimized. Assuming only short strings \n are encoded, this is not
+/// much of an issue.
+int matchLine(const char *in,
+ int len,
+ int l,
+ char *out,
+ int olen,
+ int *ol,
+ struct us_lnk_lst *prev_lines,
+ const uint8_t *state,
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[]) {
+ int last_ol = *ol;
+ int last_len = 0;
+ int last_dist = 0;
+ int last_ctx = 0;
+ int line_ctr = 0;
+ int j = 0;
+ do {
+ int i, k;
+ int line_len = (int)strlen(prev_lines->data);
+ int limit = (line_ctr == 0 ? l : line_len);
+ for (; j < limit; j++) {
+ for (i = l, k = j; k < line_len && i < len; k++, i++) {
+ if (prev_lines->data[k] != in[i])
+ break;
+ }
+ while ((((unsigned char)prev_lines->data[k]) >> 6) == 2)
+ k--; // Skip partial UTF-8 matches
+ if ((k - j) >= NICE_LEN) {
+ if (last_len) {
+ if (j > last_dist)
+ continue;
+ // int saving = ((k - j) - last_len) + (last_dist - j) + (last_ctx - line_ctr);
+ // if (saving < 0) {
+ // //printf("No savng: %d\n", saving);
+ // continue;
+ // }
+ *ol = last_ol;
+ }
+ last_len = (k - j);
+ last_dist = j;
+ last_ctx = line_ctr;
+ SAFE_APPEND_BITS(*ol = append_switch_code(out, olen, *ol, *state));
+ SAFE_APPEND_BITS(*ol = append_bits(
+ out, olen, *ol, usx_hcodes[USX_DICT], usx_hcode_lens[USX_DICT]));
+ SAFE_APPEND_BITS(*ol = encodeCount(out, olen, *ol, last_len - NICE_LEN));
+ SAFE_APPEND_BITS(*ol = encodeCount(out, olen, *ol, last_dist));
+ SAFE_APPEND_BITS(*ol = encodeCount(out, olen, *ol, last_ctx));
+ /*
+ if ((*ol - last_ol) > (last_len * 4)) {
+ last_len = 0;
+ *ol = last_ol;
+ }*/
+ // printf("Len: %d, Dist: %d, Line: %d\n", last_len, last_dist, last_ctx);
+ j += last_len;
+ }
+ }
+ line_ctr++;
+ prev_lines = prev_lines->previous;
+ } while (prev_lines && prev_lines->data != NULL);
+ if (last_len) {
+ l += last_len;
+ l--;
+ return l;
+ }
+ return -l;
+}
+
+/// Returns 4 bit code assuming ch falls between '0' to '9', \n
+/// 'A' to 'F' or 'a' to 'f'
+uint8_t getBaseCode(char ch) {
+ if (ch >= '0' && ch <= '9')
+ return (ch - '0') << 4;
+ else if (ch >= 'A' && ch <= 'F')
+ return (ch - 'A' + 10) << 4;
+ else if (ch >= 'a' && ch <= 'f')
+ return (ch - 'a' + 10) << 4;
+ return 0;
+}
+
+/// Enum indicating nibble type - USX_NIB_NUM means ch is a number '0' to '9', \n
+/// USX_NIB_HEX_LOWER means ch is between 'a' to 'f', \n
+/// USX_NIB_HEX_UPPER means ch is between 'A' to 'F'
+enum { USX_NIB_NUM = 0, USX_NIB_HEX_LOWER, USX_NIB_HEX_UPPER, USX_NIB_NOT };
+/// Gets 4 bit code assuming ch falls between '0' to '9', \n
+/// 'A' to 'F' or 'a' to 'f'
+char getNibbleType(char ch) {
+ if (ch >= '0' && ch <= '9')
+ return USX_NIB_NUM;
+ else if (ch >= 'a' && ch <= 'f')
+ return USX_NIB_HEX_LOWER;
+ else if (ch >= 'A' && ch <= 'F')
+ return USX_NIB_HEX_UPPER;
+ return USX_NIB_NOT;
+}
+
+/// Starts coding of nibble sets
+int append_nibble_escape(char *out,
+ int olen,
+ int ol,
+ uint8_t state,
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[]) {
+ SAFE_APPEND_BITS(ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, usx_hcodes[USX_NUM], usx_hcode_lens[USX_NUM]));
+ SAFE_APPEND_BITS(ol = append_bits(out, olen, ol, 0, 2));
+ return ol;
+}
+
+/// Returns minimum value of two longs
+long min_of(long c, long i) {
+ return c > i ? i : c;
+}
+
+/// Appends the terminator code depending on the state, preset and whether full terminator needs to
+/// be encoded to out or not \n
+int append_final_bits(char *const out,
+ const int olen,
+ int ol,
+ const uint8_t state,
+ const uint8_t is_all_upper,
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[]) {
+ if (usx_hcode_lens[USX_ALPHA]) {
+ if (USX_NUM != state) {
+ // for num state, append TERM_CODE directly
+ // for other state, switch to Num Set first
+ SAFE_APPEND_BITS(ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS(
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_NUM], usx_hcode_lens[USX_NUM]));
+ }
+ SAFE_APPEND_BITS(
+ ol = append_bits(
+ out, olen, ol, usx_vcodes[TERM_CODE & 0x1F], usx_vcode_lens[TERM_CODE & 0x1F]));
+ } else {
+ // preset 1, terminate at 2 or 3 SW_CODE, i.e., 4 or 6 continuous 0 bits
+ // see discussion: https://github.com/siara-cc/Unishox/issues/19#issuecomment-922435580
+ SAFE_APPEND_BITS(ol = append_bits(out,
+ olen,
+ ol,
+ TERM_BYTE_PRESET_1,
+ is_all_upper ? TERM_BYTE_PRESET_1_LEN_UPPER
+ : TERM_BYTE_PRESET_1_LEN_LOWER));
+ }
+
+ // fill uint8_t with the last bit
+ SAFE_APPEND_BITS(ol =
+ append_bits(out,
+ olen,
+ ol,
+ (ol == 0 || out[(ol - 1) / 8] << ((ol - 1) & 7) >= 0) ? 0 : 0xFF,
+ (8 - ol % 8) & 7));
+
+ return ol;
+}
+
+/// Macro used in the main compress function so that if the output len exceeds given maximum length
+/// (olen) it can exit
+#define SAFE_APPEND_BITS2(olen, exp) \
+ do { \
+ const int newidx = (exp); \
+ const int __olen = (olen); \
+ if (newidx < 0) \
+ return __olen >= 0 ? __olen + 1 : (1 - __olen) * 4; \
+ } while (0)
+
+// Main API function. See unishox2.h for documentation
+int unishox2_compress_lines(const char *in,
+ int len,
+ UNISHOX_API_OUT_AND_LEN(char *out, int olen),
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[],
+ const char *usx_freq_seq[],
+ const char *usx_templates[],
+ struct us_lnk_lst *prev_lines) {
+ uint8_t state;
+
+ int l, ll, ol;
+ char c_in, c_next;
+ int prev_uni;
+ uint8_t is_upper, is_all_upper;
+#if (UNISHOX_API_OUT_AND_LEN(0, 1)) == 0
+ const int olen = INT_MAX - 1;
+ const int rawolen = olen;
+ const uint8_t need_full_term_codes = 0;
+#else
+ const int rawolen = olen;
+ uint8_t need_full_term_codes = 0;
+ if (olen < 0) {
+ need_full_term_codes = 1;
+ olen *= -1;
+ }
+#endif
+
+ init_coder();
+ ol = 0;
+ prev_uni = 0;
+ state = USX_ALPHA;
+ is_all_upper = 0;
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, UNISHOX_MAGIC_BITS, UNISHOX_MAGIC_BIT_LEN)); // magic bit(s)
+ for (l = 0; l < len; l++) {
+ if (usx_hcode_lens[USX_DICT] && l < (len - NICE_LEN + 1)) {
+ if (prev_lines) {
+ l = matchLine(in, len, l, out, olen, &ol, prev_lines, &state, usx_hcodes, usx_hcode_lens);
+ if (l > 0) {
+ continue;
+ } else if (l < 0 && ol < 0) {
+ return olen + 1;
+ }
+ l = -l;
+ } else {
+ l = matchOccurance(in, len, l, out, olen, &ol, &state, usx_hcodes, usx_hcode_lens);
+ if (l > 0) {
+ continue;
+ } else if (l < 0 && ol < 0) {
+ return olen + 1;
+ }
+ l = -l;
+ }
+ }
+
+ c_in = in[l];
+ if (l && len > 4 && l < (len - 4) && usx_hcode_lens[USX_NUM]) {
+ if (c_in == in[l - 1] && c_in == in[l + 1] && c_in == in[l + 2] && c_in == in[l + 3]) {
+ int rpt_count = l + 4;
+ while (rpt_count < len && in[rpt_count] == c_in)
+ rpt_count++;
+ rpt_count -= l;
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_code(out, olen, ol, RPT_CODE, &state, usx_hcodes, usx_hcode_lens));
+ SAFE_APPEND_BITS2(rawolen, ol = encodeCount(out, olen, ol, rpt_count - 4));
+ l += rpt_count;
+ l--;
+ continue;
+ }
+ }
+
+ if (l <= (len - 36) && usx_hcode_lens[USX_NUM]) {
+ if (in[l + 8] == '-' && in[l + 13] == '-' && in[l + 18] == '-' && in[l + 23] == '-') {
+ char hex_type = USX_NIB_NUM;
+ int uid_pos = l;
+ for (; uid_pos < l + 36; uid_pos++) {
+ char c_uid = in[uid_pos];
+ if (c_uid == '-' && (uid_pos == 8 || uid_pos == 13 || uid_pos == 18 || uid_pos == 23))
+ continue;
+ char nib_type = getNibbleType(c_uid);
+ if (nib_type == USX_NIB_NOT)
+ break;
+ if (nib_type != USX_NIB_NUM) {
+ if (hex_type != USX_NIB_NUM && hex_type != nib_type)
+ break;
+ hex_type = nib_type;
+ }
+ }
+ if (uid_pos == l + 36) {
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_nibble_escape(out, olen, ol, state, usx_hcodes, usx_hcode_lens));
+ SAFE_APPEND_BITS2(rawolen,
+ ol = append_bits(out,
+ olen,
+ ol,
+ (hex_type == USX_NIB_HEX_LOWER ? 0xC0 : 0xF0),
+ (hex_type == USX_NIB_HEX_LOWER ? 3 : 5)));
+ for (uid_pos = l; uid_pos < l + 36; uid_pos++) {
+ char c_uid = in[uid_pos];
+ if (c_uid != '-')
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, getBaseCode(c_uid), 4));
+ }
+ // printf("GUID:\n");
+ l += 35;
+ continue;
+ }
+ }
+ }
+
+ if (l < (len - 5) && usx_hcode_lens[USX_NUM]) {
+ char hex_type = USX_NIB_NUM;
+ int hex_len = 0;
+ do {
+ char nib_type = getNibbleType(in[l + hex_len]);
+ if (nib_type == USX_NIB_NOT)
+ break;
+ if (nib_type != USX_NIB_NUM) {
+ if (hex_type != USX_NIB_NUM && hex_type != nib_type)
+ break;
+ hex_type = nib_type;
+ }
+ hex_len++;
+ } while (l + hex_len < len);
+ if (hex_len > 10 && hex_type == USX_NIB_NUM)
+ hex_type = USX_NIB_HEX_LOWER;
+ if ((hex_type == USX_NIB_HEX_LOWER || hex_type == USX_NIB_HEX_UPPER) && hex_len > 3) {
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_nibble_escape(out, olen, ol, state, usx_hcodes, usx_hcode_lens));
+ SAFE_APPEND_BITS2(rawolen,
+ ol = append_bits(out,
+ olen,
+ ol,
+ (hex_type == USX_NIB_HEX_LOWER ? 0x80 : 0xE0),
+ (hex_type == USX_NIB_HEX_LOWER ? 2 : 4)));
+ SAFE_APPEND_BITS2(rawolen, ol = encodeCount(out, olen, ol, hex_len));
+ do {
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, getBaseCode(in[l++]), 4));
+ } while (--hex_len);
+ l--;
+ continue;
+ }
+ }
+
+ if (usx_templates != NULL) {
+ int i;
+ for (i = 0; i < 5; i++) {
+ if (usx_templates[i]) {
+ int rem = (int)strlen(usx_templates[i]);
+ int j = 0;
+ for (; j < rem && l + j < len; j++) {
+ char c_t = usx_templates[i][j];
+ c_in = in[l + j];
+ if (c_t == 'f' || c_t == 'F') {
+ if (getNibbleType(c_in) != (c_t == 'f' ? USX_NIB_HEX_LOWER : USX_NIB_HEX_UPPER) &&
+ getNibbleType(c_in) != USX_NIB_NUM) {
+ break;
+ }
+ } else if (c_t == 'r' || c_t == 't' || c_t == 'o') {
+ if (c_in < '0' || c_in > (c_t == 'r' ? '7' : (c_t == 't' ? '3' : '1')))
+ break;
+ } else if (c_t != c_in)
+ break;
+ }
+ if (((float)j / rem) > 0.66) {
+ // printf("%s\n", usx_templates[i]);
+ rem = rem - j;
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_nibble_escape(out, olen, ol, state, usx_hcodes, usx_hcode_lens));
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, 0, 1));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, (count_codes[i] & 0xF8), count_codes[i] & 0x07));
+ SAFE_APPEND_BITS2(rawolen, ol = encodeCount(out, olen, ol, rem));
+ for (int k = 0; k < j; k++) {
+ char c_t = usx_templates[i][k];
+ if (c_t == 'f' || c_t == 'F')
+ SAFE_APPEND_BITS2(rawolen,
+ ol = append_bits(out, olen, ol, getBaseCode(in[l + k]), 4));
+ else if (c_t == 'r' || c_t == 't' || c_t == 'o') {
+ c_t = (c_t == 'r' ? 3 : (c_t == 't' ? 2 : 1));
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_bits(out, olen, ol, (in[l + k] - '0') << (8 - c_t), c_t));
+ }
+ }
+ l += j;
+ l--;
+ break;
+ }
+ }
+ }
+ if (i < 5)
+ continue;
+ }
+
+ if (usx_freq_seq != NULL) {
+ int i;
+ for (i = 0; i < 6; i++) {
+ int seq_len = (int)strlen(usx_freq_seq[i]);
+ if (len - seq_len >= 0 && l <= len - seq_len) {
+ if (memcmp(usx_freq_seq[i], in + l, seq_len) == 0 &&
+ usx_hcode_lens[usx_freq_codes[i] >> 5]) {
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_code(
+ out, olen, ol, usx_freq_codes[i], &state, usx_hcodes, usx_hcode_lens));
+ l += seq_len;
+ l--;
+ break;
+ }
+ }
+ }
+ if (i < 6)
+ continue;
+ }
+
+ c_in = in[l];
+
+ is_upper = 0;
+ if (c_in >= 'A' && c_in <= 'Z')
+ is_upper = 1;
+ else {
+ if (is_all_upper) {
+ is_all_upper = 0;
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ state = USX_ALPHA;
+ }
+ }
+ if (is_upper && !is_all_upper) {
+ if (state == USX_NUM) {
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ state = USX_ALPHA;
+ }
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ if (state == USX_DELTA) {
+ state = USX_ALPHA;
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ }
+ }
+ c_next = 0;
+ if (l + 1 < len)
+ c_next = in[l + 1];
+
+ if (c_in >= 32 && c_in <= 126) {
+ if (is_upper && !is_all_upper) {
+ for (ll = l + 4; ll >= l && ll < len; ll--) {
+ if (in[ll] < 'A' || in[ll] > 'Z')
+ break;
+ }
+ if (ll == l - 1) {
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ state = USX_ALPHA;
+ is_all_upper = 1;
+ }
+ }
+ if (state == USX_DELTA && (c_in == ' ' || c_in == '.' || c_in == ',')) {
+ uint8_t spl_code = (c_in == ',' ? 0xC0 : (c_in == '.' ? 0xE0 : (c_in == ' ' ? 0 : 0xFF)));
+ if (spl_code != 0xFF) {
+ uint8_t spl_code_len = (c_in == ',' ? 3 : (c_in == '.' ? 4 : (c_in == ' ' ? 1 : 4)));
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_bits(out, olen, ol, UNI_STATE_SPL_CODE, UNI_STATE_SPL_CODE_LEN));
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, spl_code, spl_code_len));
+ continue;
+ }
+ }
+ c_in -= 32;
+ if (is_all_upper && is_upper)
+ c_in += 32;
+ if (c_in == 0) {
+ if (state == USX_NUM)
+ SAFE_APPEND_BITS2(rawolen,
+ ol = append_bits(out,
+ olen,
+ ol,
+ usx_vcodes[NUM_SPC_CODE & 0x1F],
+ usx_vcode_lens[NUM_SPC_CODE & 0x1F]));
+ else
+ SAFE_APPEND_BITS2(rawolen,
+ ol = append_bits(out, olen, ol, usx_vcodes[1], usx_vcode_lens[1]));
+ } else {
+ c_in--;
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_code(
+ out, olen, ol, usx_code_94[(int)c_in], &state, usx_hcodes, usx_hcode_lens));
+ }
+ } else if (c_in == 13 && c_next == 10) {
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_code(out, olen, ol, CRLF_CODE, &state, usx_hcodes, usx_hcode_lens));
+ l++;
+ } else if (c_in == 10) {
+ if (state == USX_DELTA) {
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_bits(out, olen, ol, UNI_STATE_SPL_CODE, UNI_STATE_SPL_CODE_LEN));
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, 0xF0, 4));
+ } else
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_code(out, olen, ol, LF_CODE, &state, usx_hcodes, usx_hcode_lens));
+ } else if (c_in == 13) {
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_code(out, olen, ol, CR_CODE, &state, usx_hcodes, usx_hcode_lens));
+ } else if (c_in == '\t') {
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_code(out, olen, ol, TAB_CODE, &state, usx_hcodes, usx_hcode_lens));
+ } else {
+ int utf8len;
+ int32_t uni = readUTF8(in, len, l, &utf8len);
+ if (uni) {
+ l += utf8len;
+ if (state != USX_DELTA) {
+ int32_t uni2 = readUTF8(in, len, l, &utf8len);
+ if (uni2) {
+ if (state != USX_ALPHA) {
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol =
+ append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ }
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_ALPHA], usx_hcode_lens[USX_ALPHA]));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(
+ out, olen, ol, usx_vcodes[1], usx_vcode_lens[1])); // code for space (' ')
+ state = USX_DELTA;
+ } else {
+ SAFE_APPEND_BITS2(rawolen, ol = append_switch_code(out, olen, ol, state));
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_bits(out, olen, ol, usx_hcodes[USX_DELTA], usx_hcode_lens[USX_DELTA]));
+ }
+ }
+ SAFE_APPEND_BITS2(rawolen, ol = encodeUnicode(out, olen, ol, uni, prev_uni));
+ // printf("%d:%d:%d\n", l, utf8len, uni);
+ prev_uni = uni;
+ l--;
+ } else {
+ int bin_count = 1;
+ for (int bi = l + 1; bi < len; bi++) {
+ char c_bi = in[bi];
+ // if (c_bi > 0x1F && c_bi != 0x7F)
+ // break;
+ if (readUTF8(in, len, bi, &utf8len))
+ break;
+ if (bi < (len - 4) && c_bi == in[bi - 1] && c_bi == in[bi + 1] && c_bi == in[bi + 2] &&
+ c_bi == in[bi + 3])
+ break;
+ bin_count++;
+ }
+ // printf("Bin:%d:%d:%x:%d\n", l, (unsigned char) c_in, (unsigned char) c_in, bin_count);
+ SAFE_APPEND_BITS2(
+ rawolen, ol = append_nibble_escape(out, olen, ol, state, usx_hcodes, usx_hcode_lens));
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, 0xF8, 5));
+ SAFE_APPEND_BITS2(rawolen, ol = encodeCount(out, olen, ol, bin_count));
+ do {
+ SAFE_APPEND_BITS2(rawolen, ol = append_bits(out, olen, ol, in[l++], 8));
+ } while (--bin_count);
+ l--;
+ }
+ }
+ }
+
+ if (need_full_term_codes) {
+ const int orig_ol = ol;
+ SAFE_APPEND_BITS2(
+ rawolen,
+ ol = append_final_bits(out, olen, ol, state, is_all_upper, usx_hcodes, usx_hcode_lens));
+ return (ol / 8) * 4 + (((ol - orig_ol) / 8) & 3);
+ } else {
+ const int rst = (ol + 7) / 8;
+ append_final_bits(out, rst, ol, state, is_all_upper, usx_hcodes, usx_hcode_lens);
+ return rst;
+ }
+}
+
+// Main API function. See unishox2.h for documentation
+int unishox2_compress(const char *in,
+ int len,
+ UNISHOX_API_OUT_AND_LEN(char *out, int olen),
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[],
+ const char *usx_freq_seq[],
+ const char *usx_templates[]) {
+ return unishox2_compress_lines(in,
+ len,
+ UNISHOX_API_OUT_AND_LEN(out, olen),
+ usx_hcodes,
+ usx_hcode_lens,
+ usx_freq_seq,
+ usx_templates,
+ NULL);
+}
+
+// Main API function. See unishox2.h for documentation
+int unishox2_compress_simple(const char *in, int len, char *out) {
+ return unishox2_compress_lines(in,
+ len,
+ UNISHOX_API_OUT_AND_LEN(out, INT_MAX - 1),
+ USX_HCODES_DFLT,
+ USX_HCODE_LENS_DFLT,
+ USX_FREQ_SEQ_DFLT,
+ USX_TEMPLATES,
+ NULL);
+}
+
+// Reads one bit from in
+int readBit(const char *in, int bit_no) {
+ return in[bit_no >> 3] & (0x80 >> (bit_no % 8));
+}
+
+// Reads next 8 bits, if available
+int read8bitCode(const char *in, int len, int bit_no) {
+ int bit_pos = bit_no & 0x07;
+ int char_pos = bit_no >> 3;
+ len >>= 3;
+ uint8_t code = (((uint8_t)in[char_pos]) << bit_pos);
+ char_pos++;
+ if (char_pos < len) {
+ code |= ((uint8_t)in[char_pos]) >> (8 - bit_pos);
+ } else
+ code |= (0xFF >> (8 - bit_pos));
+ return code;
+}
+
+/// The list of veritical codes is split into 5 sections. Used by readVCodeIdx()
+#define SECTION_COUNT 5
+/// Used by readVCodeIdx() for finding the section under which the code read using read8bitCode()
+/// falls
+uint8_t usx_vsections[] = {0x7F, 0xBF, 0xDF, 0xEF, 0xFF};
+/// Used by readVCodeIdx() for finding the section vertical position offset
+uint8_t usx_vsection_pos[] = {0, 4, 8, 12, 20};
+/// Used by readVCodeIdx() for masking the code read by read8bitCode()
+uint8_t usx_vsection_mask[] = {0x7F, 0x3F, 0x1F, 0x0F, 0x0F};
+/// Used by readVCodeIdx() for shifting the code read by read8bitCode() to obtain the vpos
+uint8_t usx_vsection_shift[] = {5, 4, 3, 1, 0};
+
+/// Vertical decoder lookup table - 3 bits code len, 5 bytes vertical pos
+/// code len is one less as 8 cannot be accommodated in 3 bits
+uint8_t usx_vcode_lookup[36] = {
+ (1 << 5) + 0, (1 << 5) + 0, (2 << 5) + 1, (2 << 5) + 2, // Section 1
+ (3 << 5) + 3, (3 << 5) + 4, (3 << 5) + 5, (3 << 5) + 6, // Section 2
+ (3 << 5) + 7, (3 << 5) + 7, (4 << 5) + 8, (4 << 5) + 9, // Section 3
+ (5 << 5) + 10, (5 << 5) + 10, (5 << 5) + 11, (5 << 5) + 11, // Section 4
+ (5 << 5) + 12, (5 << 5) + 12, (6 << 5) + 13, (6 << 5) + 14, (6 << 5) + 15, (6 << 5) + 15,
+ (6 << 5) + 16, (6 << 5) + 16, // Section 5
+ (6 << 5) + 17, (6 << 5) + 17, (7 << 5) + 18, (7 << 5) + 19, (7 << 5) + 20, (7 << 5) + 21,
+ (7 << 5) + 22, (7 << 5) + 23, (7 << 5) + 24, (7 << 5) + 25, (7 << 5) + 26, (7 << 5) + 27};
+
+/// Decodes the vertical code from the given bitstream at in \n
+/// This is designed to use less memory using a 36 uint8_t buffer \n
+/// compared to using a 256 uint8_t buffer to decode the next 8 bits read by read8bitCode() \n
+/// by splitting the list of vertical codes. \n
+/// Decoder is designed for using less memory, not speed. \n
+/// Returns the veritical code index or 99 if match could not be found. \n
+/// Also updates bit_no_p with how many ever bits used by the vertical code.
+int readVCodeIdx(const char *in, int len, int *bit_no_p) {
+ if (*bit_no_p < len) {
+ uint8_t code = read8bitCode(in, len, *bit_no_p);
+ int i = 0;
+ do {
+ if (code <= usx_vsections[i]) {
+ uint8_t vcode = usx_vcode_lookup[usx_vsection_pos[i] +
+ ((code & usx_vsection_mask[i]) >> usx_vsection_shift[i])];
+ (*bit_no_p) += ((vcode >> 5) + 1);
+ if (*bit_no_p > len)
+ return 99;
+ return vcode & 0x1F;
+ }
+ } while (++i < SECTION_COUNT);
+ }
+ return 99;
+}
+
+/// Mask for retrieving each code to be decoded according to its length \n
+/// Same as usx_mask so redundant
+uint8_t len_masks[] = {0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF};
+/// Decodes the horizontal code from the given bitstream at in \n
+/// depending on the hcodes defined using usx_hcodes and usx_hcode_lens \n
+/// Returns the horizontal code index or 99 if match could not be found. \n
+/// Also updates bit_no_p with how many ever bits used by the horizontal code.
+int readHCodeIdx(const char *in,
+ int len,
+ int *bit_no_p,
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[]) {
+ if (!usx_hcode_lens[USX_ALPHA])
+ return USX_ALPHA;
+ if (*bit_no_p < len) {
+ uint8_t code = read8bitCode(in, len, *bit_no_p);
+ for (int code_pos = 0; code_pos < 5; code_pos++) {
+ if (usx_hcode_lens[code_pos] &&
+ (code & len_masks[usx_hcode_lens[code_pos] - 1]) == usx_hcodes[code_pos]) {
+ *bit_no_p += usx_hcode_lens[code_pos];
+ return code_pos;
+ }
+ }
+ }
+ return 99;
+}
+
+// TODO: Last value check.. Also len check in readBit
+/// Returns the position of step code (0, 10, 110, etc.) encountered in the stream
+int getStepCodeIdx(const char *in, int len, int *bit_no_p, int limit) {
+ int idx = 0;
+ while (*bit_no_p < len && readBit(in, *bit_no_p)) {
+ idx++;
+ (*bit_no_p)++;
+ if (idx == limit)
+ return idx;
+ }
+ if (*bit_no_p >= len)
+ return 99;
+ (*bit_no_p)++;
+ return idx;
+}
+
+/// Reads specified number of bits and builds the corresponding integer
+int32_t getNumFromBits(const char *in, int len, int bit_no, int count) {
+ int32_t ret = 0;
+ while (count-- && bit_no < len) {
+ ret += (readBit(in, bit_no) ? 1 << count : 0);
+ bit_no++;
+ }
+ return count < 0 ? ret : -1;
+}
+
+/// Decodes the count from the given bit stream at in. Also updates bit_no_p
+int32_t readCount(const char *in, int *bit_no_p, int len) {
+ int idx = getStepCodeIdx(in, len, bit_no_p, 4);
+ if (idx == 99)
+ return -1;
+ if (*bit_no_p + count_bit_lens[idx] - 1 >= len)
+ return -1;
+ int32_t count =
+ getNumFromBits(in, len, *bit_no_p, count_bit_lens[idx]) + (idx ? count_adder[idx - 1] : 0);
+ (*bit_no_p) += count_bit_lens[idx];
+ return count;
+}
+
+/// Decodes the Unicode codepoint from the given bit stream at in. Also updates bit_no_p \n
+/// When the step code is 5, reads the next step code to find out the special code.
+int32_t readUnicode(const char *in, int *bit_no_p, int len) {
+ int idx = getStepCodeIdx(in, len, bit_no_p, 5);
+ if (idx == 99)
+ return 0x7FFFFF00 + 99;
+ if (idx == 5) {
+ idx = getStepCodeIdx(in, len, bit_no_p, 4);
+ return 0x7FFFFF00 + idx;
+ }
+ if (idx >= 0) {
+ int sign = (*bit_no_p < len ? readBit(in, *bit_no_p) : 0);
+ (*bit_no_p)++;
+ if (*bit_no_p + uni_bit_len[idx] - 1 >= len)
+ return 0x7FFFFF00 + 99;
+ int32_t count = getNumFromBits(in, len, *bit_no_p, uni_bit_len[idx]);
+ count += uni_adder[idx];
+ (*bit_no_p) += uni_bit_len[idx];
+ // printf("Sign: %d, Val:%d", sign, count);
+ return sign ? -count : count;
+ }
+ return 0;
+}
+
+/// Macro to ensure that the decoder does not append more than olen bytes to out
+#define DEC_OUTPUT_CHAR(out, olen, ol, c) \
+ do { \
+ char *const obuf = (out); \
+ const int oidx = (ol); \
+ const int limit = (olen); \
+ if (limit <= oidx) \
+ return limit + 1; \
+ else if (oidx < 0) \
+ return 0; \
+ else \
+ obuf[oidx] = (c); \
+ } while (0)
+
+/// Macro to ensure that the decoder does not append more than olen bytes to out
+#define DEC_OUTPUT_CHARS(olen, exp) \
+ do { \
+ const int newidx = (exp); \
+ const int limit = (olen); \
+ if (newidx > limit) \
+ return limit + 1; \
+ } while (0)
+
+/// Write given unicode code point to out as a UTF-8 sequence
+int writeUTF8(char *out, int olen, int ol, int uni) {
+ if (uni < (1 << 11)) {
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0xC0 + (uni >> 6));
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0x80 + (uni & 0x3F));
+ } else if (uni < (1 << 16)) {
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0xE0 + (uni >> 12));
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0x80 + ((uni >> 6) & 0x3F));
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0x80 + (uni & 0x3F));
+ } else {
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0xF0 + (uni >> 18));
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0x80 + ((uni >> 12) & 0x3F));
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0x80 + ((uni >> 6) & 0x3F));
+ DEC_OUTPUT_CHAR(out, olen, ol++, 0x80 + (uni & 0x3F));
+ }
+ return ol;
+}
+
+/// Decode repeating sequence and appends to out
+int decodeRepeat(const char *in,
+ int len,
+ char *out,
+ int olen,
+ int ol,
+ int *bit_no,
+ struct us_lnk_lst *prev_lines) {
+ if (prev_lines) {
+ int32_t dict_len = readCount(in, bit_no, len) + NICE_LEN;
+ if (dict_len < NICE_LEN)
+ return -1;
+ int32_t dist = readCount(in, bit_no, len);
+ if (dist < 0)
+ return -1;
+ int32_t ctx = readCount(in, bit_no, len);
+ if (ctx < 0)
+ return -1;
+ struct us_lnk_lst *cur_line = prev_lines;
+ const int left = olen - ol;
+ while (ctx-- && cur_line)
+ cur_line = cur_line->previous;
+ if (cur_line == NULL)
+ return -1;
+ if (left <= 0)
+ return olen + 1;
+ if ((size_t)dist >= strlen(cur_line->data))
+ return -1;
+ memmove(out + ol, cur_line->data + dist, min_of(left, dict_len));
+ if (left < dict_len)
+ return olen + 1;
+ ol += dict_len;
+ } else {
+ int32_t dict_len = readCount(in, bit_no, len) + NICE_LEN;
+ if (dict_len < NICE_LEN)
+ return -1;
+ int32_t dist = readCount(in, bit_no, len) + NICE_LEN - 1;
+ if (dist < NICE_LEN - 1)
+ return -1;
+ const int32_t left = olen - ol;
+ // printf("Decode len: %d, dist: %d\n", dict_len - NICE_LEN, dist - NICE_LEN + 1);
+ if (left <= 0)
+ return olen + 1;
+ if (ol - dist < 0)
+ return -1;
+ memmove(out + ol, out + ol - dist, min_of(left, dict_len));
+ if (left < dict_len)
+ return olen + 1;
+ ol += dict_len;
+ }
+ return ol;
+}
+
+/// Returns hex character corresponding to the 4 bit nibble
+char getHexChar(int32_t nibble, int hex_type) {
+ if (nibble >= 0 && nibble <= 9)
+ return '0' + nibble;
+ else if (hex_type < USX_NIB_HEX_UPPER)
+ return 'a' + nibble - 10;
+ return 'A' + nibble - 10;
+}
+
+// Main API function. See unishox2.h for documentation
+int unishox2_decompress_lines(const char *in,
+ int len,
+ UNISHOX_API_OUT_AND_LEN(char *out, int olen),
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[],
+ const char *usx_freq_seq[],
+ const char *usx_templates[],
+ struct us_lnk_lst *prev_lines) {
+ int dstate;
+ int bit_no;
+ int h, v;
+ uint8_t is_all_upper;
+#if (UNISHOX_API_OUT_AND_LEN(0, 1)) == 0
+ const int olen = INT_MAX - 1;
+#endif
+
+ init_coder();
+ int ol = 0;
+ bit_no = UNISHOX_MAGIC_BIT_LEN; // ignore the magic bit
+ dstate = h = USX_ALPHA;
+ is_all_upper = 0;
+
+ int prev_uni = 0;
+
+ len <<= 3;
+ while (bit_no < len) {
+ int orig_bit_no = bit_no;
+ if (dstate == USX_DELTA || h == USX_DELTA) {
+ if (dstate != USX_DELTA)
+ h = dstate;
+ int32_t delta = readUnicode(in, &bit_no, len);
+ if ((delta >> 8) == 0x7FFFFF) {
+ int spl_code_idx = delta & 0x000000FF;
+ if (spl_code_idx == 99)
+ break;
+ switch (spl_code_idx) {
+ case 0:
+ DEC_OUTPUT_CHAR(out, olen, ol++, ' ');
+ continue;
+ case 1:
+ h = readHCodeIdx(in, len, &bit_no, usx_hcodes, usx_hcode_lens);
+ if (h == 99) {
+ bit_no = len;
+ continue;
+ }
+ if (h == USX_DELTA || h == USX_ALPHA) {
+ dstate = h;
+ continue;
+ }
+ if (h == USX_DICT) {
+ int rpt_ret = decodeRepeat(in, len, out, olen, ol, &bit_no, prev_lines);
+ if (rpt_ret < 0)
+ return ol; // if we break here it will only break out of switch
+ DEC_OUTPUT_CHARS(olen, ol = rpt_ret);
+ h = dstate;
+ continue;
+ }
+ break;
+ case 2:
+ DEC_OUTPUT_CHAR(out, olen, ol++, ',');
+ continue;
+ case 3:
+ DEC_OUTPUT_CHAR(out, olen, ol++, '.');
+ continue;
+ case 4:
+ DEC_OUTPUT_CHAR(out, olen, ol++, 10);
+ continue;
+ }
+ } else {
+ prev_uni += delta;
+ DEC_OUTPUT_CHARS(olen, ol = writeUTF8(out, olen, ol, prev_uni));
+ // printf("%ld, ", prev_uni);
+ }
+ if (dstate == USX_DELTA && h == USX_DELTA)
+ continue;
+ } else
+ h = dstate;
+ char c = 0;
+ uint8_t is_upper = is_all_upper;
+ v = readVCodeIdx(in, len, &bit_no);
+ if (v == 99 || h == 99) {
+ bit_no = orig_bit_no;
+ break;
+ }
+ if (v == 0 && h != USX_SYM) {
+ if (bit_no >= len)
+ break;
+ if (h != USX_NUM || dstate != USX_DELTA) {
+ h = readHCodeIdx(in, len, &bit_no, usx_hcodes, usx_hcode_lens);
+ if (h == 99 || bit_no >= len) {
+ bit_no = orig_bit_no;
+ break;
+ }
+ }
+ if (h == USX_ALPHA) {
+ if (dstate == USX_ALPHA) {
+ if (!usx_hcode_lens[USX_ALPHA] &&
+ TERM_BYTE_PRESET_1 == (read8bitCode(in, len, bit_no - SW_CODE_LEN) &
+ (0xFF << (8 - (is_all_upper ? TERM_BYTE_PRESET_1_LEN_UPPER
+ : TERM_BYTE_PRESET_1_LEN_LOWER)))))
+ break; // Terminator for preset 1
+ if (is_all_upper) {
+ is_upper = is_all_upper = 0;
+ continue;
+ }
+ v = readVCodeIdx(in, len, &bit_no);
+ if (v == 99) {
+ bit_no = orig_bit_no;
+ break;
+ }
+ if (v == 0) {
+ h = readHCodeIdx(in, len, &bit_no, usx_hcodes, usx_hcode_lens);
+ if (h == 99) {
+ bit_no = orig_bit_no;
+ break;
+ }
+ if (h == USX_ALPHA) {
+ is_all_upper = 1;
+ continue;
+ }
+ }
+ is_upper = 1;
+ } else {
+ dstate = USX_ALPHA;
+ continue;
+ }
+ } else if (h == USX_DICT) {
+ int rpt_ret = decodeRepeat(in, len, out, olen, ol, &bit_no, prev_lines);
+ if (rpt_ret < 0)
+ break;
+ DEC_OUTPUT_CHARS(olen, ol = rpt_ret);
+ continue;
+ } else if (h == USX_DELTA) {
+ // printf("Sign: %d, bitno: %d\n", sign, bit_no);
+ // printf("Code: %d\n", prev_uni);
+ // printf("BitNo: %d\n", bit_no);
+ continue;
+ } else {
+ if (h != USX_NUM || dstate != USX_DELTA)
+ v = readVCodeIdx(in, len, &bit_no);
+ if (v == 99) {
+ bit_no = orig_bit_no;
+ break;
+ }
+ if (h == USX_NUM && v == 0) {
+ int idx = getStepCodeIdx(in, len, &bit_no, 5);
+ if (idx == 99)
+ break;
+ if (idx == 0) {
+ idx = getStepCodeIdx(in, len, &bit_no, 4);
+ if (idx >= 5)
+ break;
+ int32_t rem = readCount(in, &bit_no, len);
+ if (rem < 0)
+ break;
+ if (usx_templates[idx] == NULL)
+ break;
+ size_t tlen = strlen(usx_templates[idx]);
+ if ((size_t)rem > tlen)
+ break;
+ rem = tlen - rem;
+ int eof = 0;
+ for (int j = 0; j < rem; j++) {
+ char c_t = usx_templates[idx][j];
+ if (c_t == 'f' || c_t == 'r' || c_t == 't' || c_t == 'o' || c_t == 'F') {
+ char nibble_len =
+ (c_t == 'f' || c_t == 'F' ? 4 : (c_t == 'r' ? 3 : (c_t == 't' ? 2 : 1)));
+ const int32_t raw_char = getNumFromBits(in, len, bit_no, nibble_len);
+ if (raw_char < 0) {
+ eof = 1;
+ break;
+ }
+ DEC_OUTPUT_CHAR(
+ out,
+ olen,
+ ol++,
+ getHexChar((char)raw_char, c_t == 'f' ? USX_NIB_HEX_LOWER : USX_NIB_HEX_UPPER));
+ bit_no += nibble_len;
+ } else
+ DEC_OUTPUT_CHAR(out, olen, ol++, c_t);
+ }
+ if (eof)
+ break; // reach input eof
+ } else if (idx == 5) {
+ int32_t bin_count = readCount(in, &bit_no, len);
+ if (bin_count < 0)
+ break;
+ if (bin_count == 0) // invalid encoding
+ break;
+ do {
+ const int32_t raw_char = getNumFromBits(in, len, bit_no, 8);
+ if (raw_char < 0)
+ break;
+ DEC_OUTPUT_CHAR(out, olen, ol++, (char)raw_char);
+ bit_no += 8;
+ } while (--bin_count);
+ if (bin_count > 0)
+ break; // reach input eof
+ } else {
+ int32_t nibble_count = 0;
+ if (idx == 2 || idx == 4)
+ nibble_count = 32;
+ else {
+ nibble_count = readCount(in, &bit_no, len);
+ if (nibble_count < 0)
+ break;
+ if (nibble_count == 0) // invalid encoding
+ break;
+ }
+ do {
+ int32_t nibble = getNumFromBits(in, len, bit_no, 4);
+ if (nibble < 0)
+ break;
+ DEC_OUTPUT_CHAR(out,
+ olen,
+ ol++,
+ getHexChar(nibble, idx < 3 ? USX_NIB_HEX_LOWER : USX_NIB_HEX_UPPER));
+ if ((idx == 2 || idx == 4) && (nibble_count == 25 || nibble_count == 21 ||
+ nibble_count == 17 || nibble_count == 13))
+ DEC_OUTPUT_CHAR(out, olen, ol++, '-');
+ bit_no += 4;
+ } while (--nibble_count);
+ if (nibble_count > 0)
+ break; // reach input eof
+ }
+ if (dstate == USX_DELTA)
+ h = USX_DELTA;
+ continue;
+ }
+ }
+ }
+ if (is_upper && v == 1) {
+ h = dstate = USX_DELTA; // continuous delta coding
+ continue;
+ }
+ if (h < 3 && v < 28)
+ c = usx_sets[h][v];
+ if (c >= 'a' && c <= 'z') {
+ dstate = USX_ALPHA;
+ if (is_upper)
+ c -= 32;
+ } else {
+ if (c >= '0' && c <= '9') {
+ dstate = USX_NUM;
+ } else if (c == 0) {
+ if (v == 8) {
+ DEC_OUTPUT_CHAR(out, olen, ol++, '\r');
+ DEC_OUTPUT_CHAR(out, olen, ol++, '\n');
+ } else if (h == USX_NUM && v == 26) {
+ int32_t count = readCount(in, &bit_no, len);
+ if (count < 0)
+ break;
+ count += 4;
+ if (ol <= 0)
+ return 0; // invalid encoding
+ char rpt_c = out[ol - 1];
+ while (count--)
+ DEC_OUTPUT_CHAR(out, olen, ol++, rpt_c);
+ } else if (h == USX_SYM && v > 24) {
+ v -= 25;
+ const int freqlen = (int)strlen(usx_freq_seq[v]);
+ const int left = olen - ol;
+ if (left <= 0)
+ return olen + 1;
+ memcpy(out + ol, usx_freq_seq[v], min_of(left, freqlen));
+ if (left < freqlen)
+ return olen + 1;
+ ol += freqlen;
+ } else if (h == USX_NUM && v > 22 && v < 26) {
+ v -= (23 - 3);
+ const int freqlen = (int)strlen(usx_freq_seq[v]);
+ const int left = olen - ol;
+ if (left <= 0)
+ return olen + 1;
+ memcpy(out + ol, usx_freq_seq[v], min_of(left, freqlen));
+ if (left < freqlen)
+ return olen + 1;
+ ol += freqlen;
+ } else
+ break; // Terminator
+ if (dstate == USX_DELTA)
+ h = USX_DELTA;
+ continue;
+ }
+ }
+ if (dstate == USX_DELTA)
+ h = USX_DELTA;
+ DEC_OUTPUT_CHAR(out, olen, ol++, c);
+ }
+
+ return ol;
+}
+
+// Main API function. See unishox2.h for documentation
+int unishox2_decompress(const char *in,
+ int len,
+ UNISHOX_API_OUT_AND_LEN(char *out, int olen),
+ const uint8_t usx_hcodes[],
+ const uint8_t usx_hcode_lens[],
+ const char *usx_freq_seq[],
+ const char *usx_templates[]) {
+ return unishox2_decompress_lines(in,
+ len,
+ UNISHOX_API_OUT_AND_LEN(out, olen),
+ usx_hcodes,
+ usx_hcode_lens,
+ usx_freq_seq,
+ usx_templates,
+ NULL);
+}
+
+// Main API function. See unishox2.h for documentation
+int unishox2_decompress_simple(const char *in, int len, char *out) {
+ return unishox2_decompress(in, len, UNISHOX_API_OUT_AND_LEN(out, INT_MAX - 1), USX_PSET_DFLT);
+}
\ No newline at end of file
diff --git a/firmware_p4/components/Applications/LoRa/rnode/include/rnode.h b/firmware_p4/components/Applications/LoRa/rnode/include/rnode.h
new file mode 100644
index 00000000..cabca263
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/include/rnode.h
@@ -0,0 +1,95 @@
+// Copyright (c) 2026 HIGH CODE LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+
+#ifndef RNODE_H
+#define RNODE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#include "esp_err.h"
+
+#include "sx1262.h"
+
+#define RNODE_FW_VERSION_MAJOR 1
+#define RNODE_FW_VERSION_MINOR 52
+
+#define RNODE_PLATFORM_ESP32 0x80
+#define RNODE_MCU_ESP32 0x81
+
+#define RNODE_DEFAULT_FREQ_HZ 915000000U
+#define RNODE_DEFAULT_BW_HZ 125000U
+#define RNODE_DEFAULT_SF 8
+#define RNODE_DEFAULT_CR 5
+#define RNODE_DEFAULT_TX_POWER_DBM 17
+
+/**
+ * @brief Current radio configuration applied by the host over KISS.
+ */
+typedef struct {
+ uint32_t freq_hz;
+ uint32_t bw_hz;
+ uint8_t sf;
+ uint8_t cr;
+ int8_t tx_power_dbm;
+ bool is_radio_on;
+} rnode_radio_cfg_t;
+
+/**
+ * @brief Telemetry state reported to the host.
+ */
+typedef struct {
+ uint32_t rx_count;
+ uint32_t tx_count;
+ int16_t last_rssi_dbm;
+ int8_t last_snr_quarter_db;
+ uint8_t battery_pct;
+ int8_t cpu_temp_c;
+} rnode_stats_t;
+
+/**
+ * @brief Initialize the RNode subsystem (KISS engine + serial + SX1262 hookup).
+ *
+ * @param hal SX1262 HAL previously created via sx1262_hal_create.
+ * @return ESP_OK on success.
+ */
+esp_err_t rnode_init(const sx1262_hal_t *hal);
+
+/**
+ * @brief Start radio IRQ task and continuous RX.
+ *
+ * @return ESP_OK on success.
+ */
+esp_err_t rnode_start(void);
+
+/**
+ * @brief Periodic service. Call from the main loop. Drains serial RX,
+ * runs the KISS decoder and dispatches command frames.
+ */
+void rnode_poll(void);
+
+/**
+ * @brief Read-only snapshot of the current radio configuration.
+ */
+const rnode_radio_cfg_t *rnode_get_radio_cfg(void);
+
+/**
+ * @brief Read-only snapshot of the telemetry counters.
+ */
+const rnode_stats_t *rnode_get_stats(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RNODE_H
diff --git a/firmware_p4/components/Applications/LoRa/rnode/include/rnode_kiss.h b/firmware_p4/components/Applications/LoRa/rnode/include/rnode_kiss.h
new file mode 100644
index 00000000..c76858ae
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/include/rnode_kiss.h
@@ -0,0 +1,90 @@
+// Copyright (c) 2026 HIGH CODE LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+
+#ifndef RNODE_KISS_H
+#define RNODE_KISS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#define KISS_FEND 0xC0
+#define KISS_FESC 0xDB
+#define KISS_TFEND 0xDC
+#define KISS_TFESC 0xDD
+
+#define RNODE_KISS_FRAME_MAX 512
+
+/**
+ * @brief State machine for the KISS frame decoder.
+ *
+ * The decoder is byte-driven. When a full frame becomes available the
+ * caller drains it via rnode_kiss_decoder_take_frame.
+ */
+typedef struct {
+ uint8_t buf[RNODE_KISS_FRAME_MAX];
+ size_t len;
+ bool is_in_frame;
+ bool is_escaped;
+ bool has_frame_ready;
+} rnode_kiss_decoder_t;
+
+/**
+ * @brief Reset the decoder to its initial state.
+ *
+ * @param d Decoder instance. Must not be NULL.
+ */
+void rnode_kiss_decoder_reset(rnode_kiss_decoder_t *d);
+
+/**
+ * @brief Feed one received byte to the decoder.
+ *
+ * @param d Decoder instance.
+ * @param byte Byte received from serial.
+ * @return true if a complete frame became available after this byte.
+ */
+bool rnode_kiss_decoder_feed(rnode_kiss_decoder_t *d, uint8_t byte);
+
+/**
+ * @brief Pop the ready frame and clear the flag.
+ *
+ * @param[in] d Decoder.
+ * @param[out] out_buf Destination buffer (full frame: cmd + payload).
+ * @param cap Destination capacity.
+ * @param[out] out_len Frame size written to out_buf.
+ * @return true if a frame was popped, false otherwise.
+ */
+bool rnode_kiss_decoder_take_frame(rnode_kiss_decoder_t *d,
+ uint8_t *out_buf,
+ size_t cap,
+ size_t *out_len);
+
+/**
+ * @brief Encode a KISS frame ready for TX on the serial link.
+ *
+ * Wraps payload with FEND markers and escapes special bytes.
+ *
+ * @param[in] cmd_id First logical byte of the frame.
+ * @param[in] payload Data buffer (may be NULL if payload_len == 0).
+ * @param payload_len Payload size in bytes.
+ * @param[out] out_buf Destination for the encoded frame.
+ * @param cap Capacity of out_buf.
+ * @return Encoded length, or 0 if cap is exceeded.
+ */
+size_t rnode_kiss_encode(
+ uint8_t cmd_id, const uint8_t *payload, size_t payload_len, uint8_t *out_buf, size_t cap);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RNODE_KISS_H
diff --git a/firmware_p4/components/Applications/LoRa/rnode/include/rnode_serial.h b/firmware_p4/components/Applications/LoRa/rnode/include/rnode_serial.h
new file mode 100644
index 00000000..24ed734b
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/include/rnode_serial.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2026 HIGH CODE LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+
+#ifndef RNODE_SERIAL_H
+#define RNODE_SERIAL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#include "esp_err.h"
+
+/**
+ * @brief Initialize UART0 in raw mode for the KISS protocol.
+ *
+ * ESP32-S3 default pins: TX=GPIO43, RX=GPIO44. 115200 8N1 no flow control.
+ *
+ * @return ESP_OK on success, error code otherwise.
+ */
+esp_err_t rnode_serial_init(void);
+
+/**
+ * @brief Write raw bytes to the UART. Blocking.
+ *
+ * @param data Buffer to write.
+ * @param len Number of bytes.
+ * @return Bytes written, or -1 on error.
+ */
+int rnode_serial_write(const uint8_t *data, size_t len);
+
+/**
+ * @brief Read raw bytes from the UART (non-blocking, timeout 0).
+ *
+ * @param out Destination buffer.
+ * @param cap Destination capacity.
+ * @return Bytes read (>= 0), 0 if nothing available.
+ */
+int rnode_serial_read(uint8_t *out, size_t cap);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RNODE_SERIAL_H
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode.c b/firmware_p4/components/Applications/LoRa/rnode/rnode.c
new file mode 100644
index 00000000..aa7d5434
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode.c
@@ -0,0 +1,415 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rnode.h"
+
+#include
+
+#include "esp_log.h"
+#include "esp_random.h"
+#include "esp_timer.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+
+#include "rnode_internal.h"
+#include "rnode_kiss.h"
+#include "rnode_serial.h"
+#include "sx1262.h"
+#include "sx1262_regs.h"
+#include "sx1262_types.h"
+
+static const char *TAG = "RNODE";
+
+#define RNODE_SERIAL_RX_CHUNK 256
+#define RNODE_RX_DRAIN_BUDGET 8
+#define RNODE_CAD_TIMEOUT_MS 200
+#define RNODE_CSMA_RETRIES 3
+#define RNODE_CSMA_BACKOFF_BASE_MS 20
+#define RNODE_CSMA_BACKOFF_RAND_MS 60
+
+static rnode_radio_cfg_t s_cfg;
+static rnode_stats_t s_stats;
+static rnode_kiss_decoder_t s_decoder;
+static sx1262_hal_t s_hal;
+static bool s_is_initialized = false;
+static bool s_has_hal = false;
+static uint64_t s_tx_start_us = 0;
+static volatile bool s_is_cad_pending = false;
+static volatile bool s_is_cad_busy = false;
+
+static uint8_t map_sf(uint8_t sf);
+static uint8_t map_bw(uint32_t bw_hz);
+static uint8_t map_cr(uint8_t cr);
+static sx1262_config_t build_lora_cfg(void);
+static void on_radio_rx(const sx1262_packet_t *pkt, void *ctx);
+static void on_radio_tx_done(void *ctx);
+static void on_radio_error(int err, void *ctx);
+static void on_radio_cad_done(bool is_active, void *ctx);
+static bool csma_check_clear(void);
+static uint32_t csma_backoff_ms(void);
+
+rnode_radio_cfg_t *rnode_cfg_mut(void) {
+ return &s_cfg;
+}
+
+rnode_stats_t *rnode_stats_mut(void) {
+ return &s_stats;
+}
+
+const rnode_radio_cfg_t *rnode_get_radio_cfg(void) {
+ return &s_cfg;
+}
+
+const rnode_stats_t *rnode_get_stats(void) {
+ return &s_stats;
+}
+
+void rnode_send_frame(uint8_t cmd_id, const uint8_t *payload, size_t len) {
+ uint8_t frame[RNODE_KISS_FRAME_MAX];
+ size_t n = rnode_kiss_encode(cmd_id, payload, len, frame, sizeof(frame));
+ if (n == 0) {
+ ESP_LOGW(TAG, "kiss_encode overflow (cmd=0x%02X len=%u)", cmd_id, (unsigned)len);
+ return;
+ }
+ rnode_serial_write(frame, n);
+}
+
+void rnode_send_error(uint8_t code) {
+ rnode_send_frame(RNODE_CMD_ERROR, &code, 1);
+}
+
+esp_err_t rnode_apply_radio_cfg(void) {
+ sx1262_config_t cfg = build_lora_cfg();
+ esp_err_t ret = sx1262_config_lora(&cfg);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+ if (s_cfg.is_radio_on) {
+ sx1262_receive_continuous();
+ }
+ return ESP_OK;
+}
+
+esp_err_t rnode_set_radio_state(bool is_on) {
+ if (is_on) {
+ return sx1262_receive_continuous();
+ }
+ sx1262_stop_rx();
+ return ESP_OK;
+}
+
+esp_err_t rnode_radio_transmit(const uint8_t *data, size_t len) {
+ if (data == NULL || len == 0 || len > 255) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ bool is_clear = false;
+ for (int attempt = 0; attempt <= RNODE_CSMA_RETRIES; attempt++) {
+ if (csma_check_clear()) {
+ is_clear = true;
+ break;
+ }
+ if (attempt < RNODE_CSMA_RETRIES) {
+ vTaskDelay(pdMS_TO_TICKS(csma_backoff_ms()));
+ }
+ }
+ if (!is_clear) {
+ ESP_LOGW(TAG, "CSMA: channel busy after %d retries, dropping TX", RNODE_CSMA_RETRIES);
+ if (s_cfg.is_radio_on) {
+ sx1262_receive_continuous();
+ }
+ return ESP_ERR_TIMEOUT;
+ }
+
+ uint8_t ready = 0x01;
+ rnode_send_frame(RNODE_CMD_READY, &ready, 1);
+
+ s_tx_start_us = (uint64_t)esp_timer_get_time();
+ esp_err_t ret = sx1262_transmit(data, (uint8_t)len, 5000);
+ if (ret != ESP_OK) {
+ if (s_cfg.is_radio_on) {
+ sx1262_receive_continuous();
+ }
+ return ret;
+ }
+ uint32_t airtime_ms = rnode_airtime_estimate_ms(len, s_cfg.bw_hz, s_cfg.sf, s_cfg.cr);
+ rnode_airtime_record_tx(airtime_ms);
+ return ESP_OK;
+}
+
+esp_err_t rnode_init(const sx1262_hal_t *hal) {
+ if (s_is_initialized) {
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (hal == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ memset(&s_cfg, 0, sizeof(s_cfg));
+ memset(&s_stats, 0, sizeof(s_stats));
+ rnode_kiss_decoder_reset(&s_decoder);
+
+ s_stats.battery_pct = 100;
+ s_stats.cpu_temp_c = 25;
+
+ s_hal = *hal;
+ s_has_hal = true;
+
+ rnode_nvs_load_cfg();
+
+ sx1262_config_t cfg = build_lora_cfg();
+ esp_err_t ret = sx1262_init(&cfg);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "sx1262_init failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ sx1262_callbacks_t cbs = {
+ .on_tx_done = on_radio_tx_done,
+ .on_rx_done = on_radio_rx,
+ .on_cad_done = on_radio_cad_done,
+ .on_timeout = NULL,
+ .on_error = on_radio_error,
+ .cb_ctx = NULL,
+ };
+ sx1262_set_callbacks(&cbs);
+
+ ret = rnode_serial_init();
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ s_is_initialized = true;
+ ESP_LOGI(TAG,
+ "init done -- fw=%u.%u freq=%lu sf=%u bw=%lu cr=4/%u tx=%ddBm",
+ RNODE_FW_VERSION_MAJOR,
+ RNODE_FW_VERSION_MINOR,
+ (unsigned long)s_cfg.freq_hz,
+ s_cfg.sf,
+ (unsigned long)s_cfg.bw_hz,
+ s_cfg.cr,
+ s_cfg.tx_power_dbm);
+ return ESP_OK;
+}
+
+esp_err_t rnode_start(void) {
+ if (!s_is_initialized) {
+ return ESP_ERR_INVALID_STATE;
+ }
+ esp_err_t ret = sx1262_start();
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "sx1262_start failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+ s_cfg.is_radio_on = true;
+ return sx1262_receive_continuous();
+}
+
+void rnode_poll(void) {
+ if (!s_is_initialized) {
+ return;
+ }
+
+ uint8_t rx[RNODE_SERIAL_RX_CHUNK];
+ int n = rnode_serial_read(rx, sizeof(rx));
+ for (int i = 0; i < n; i++) {
+ if (rnode_kiss_decoder_feed(&s_decoder, rx[i])) {
+ uint8_t frame[RNODE_KISS_FRAME_MAX];
+ size_t flen = 0;
+ if (rnode_kiss_decoder_take_frame(&s_decoder, frame, sizeof(frame), &flen)) {
+ rnode_dispatch(frame, flen);
+ }
+ }
+ }
+
+ for (int i = 0; i < RNODE_RX_DRAIN_BUDGET; i++) {
+ sx1262_packet_t pkt;
+ if (sx1262_get_packet(&pkt) != ESP_OK) {
+ break;
+ }
+ }
+}
+
+static uint8_t map_sf(uint8_t sf) {
+ switch (sf) {
+ case 5:
+ return SX1262_LORA_SF5;
+ case 6:
+ return SX1262_LORA_SF6;
+ case 7:
+ return SX1262_LORA_SF7;
+ case 8:
+ return SX1262_LORA_SF8;
+ case 9:
+ return SX1262_LORA_SF9;
+ case 10:
+ return SX1262_LORA_SF10;
+ case 11:
+ return SX1262_LORA_SF11;
+ case 12:
+ return SX1262_LORA_SF12;
+ default:
+ return SX1262_LORA_SF8;
+ }
+}
+
+static uint8_t map_bw(uint32_t bw_hz) {
+ if (bw_hz <= 7810)
+ return SX1262_LORA_BW_7;
+ if (bw_hz <= 10420)
+ return SX1262_LORA_BW_10;
+ if (bw_hz <= 15630)
+ return SX1262_LORA_BW_15;
+ if (bw_hz <= 20830)
+ return SX1262_LORA_BW_20;
+ if (bw_hz <= 31250)
+ return SX1262_LORA_BW_31;
+ if (bw_hz <= 41670)
+ return SX1262_LORA_BW_41;
+ if (bw_hz <= 62500)
+ return SX1262_LORA_BW_62;
+ if (bw_hz <= 125000)
+ return SX1262_LORA_BW_125;
+ if (bw_hz <= 250000)
+ return SX1262_LORA_BW_250;
+ return SX1262_LORA_BW_500;
+}
+
+static uint8_t map_cr(uint8_t cr) {
+ switch (cr) {
+ case 5:
+ return SX1262_LORA_CR_4_5;
+ case 6:
+ return SX1262_LORA_CR_4_6;
+ case 7:
+ return SX1262_LORA_CR_4_7;
+ case 8:
+ return SX1262_LORA_CR_4_8;
+ default:
+ return SX1262_LORA_CR_4_5;
+ }
+}
+
+static sx1262_config_t build_lora_cfg(void) {
+ sx1262_config_t cfg = {
+ .hal = s_hal,
+ .frequency_hz = s_cfg.freq_hz,
+ .sf = map_sf(s_cfg.sf),
+ .bw = map_bw(s_cfg.bw_hz),
+ .cr = map_cr(s_cfg.cr),
+ .tx_power_dbm = s_cfg.tx_power_dbm,
+ .preamble_len = 12,
+ .is_crc_on = true,
+ .is_inverted_iq = false,
+ .is_implicit_hdr = false,
+ .is_public_network = false,
+ };
+ return cfg;
+}
+
+static void on_radio_rx(const sx1262_packet_t *pkt, void *ctx) {
+ (void)ctx;
+ if (pkt == NULL || pkt->len == 0) {
+ return;
+ }
+ if (pkt->has_crc_error || pkt->has_header_error) {
+ return;
+ }
+
+ s_stats.rx_count++;
+ s_stats.last_rssi_dbm = pkt->rssi_pkt_dbm;
+ s_stats.last_snr_quarter_db = pkt->snr_pkt_db;
+
+ rnode_send_frame(RNODE_CMD_DATA, pkt->buf, pkt->len);
+
+ int rssi = pkt->rssi_pkt_dbm;
+ if (rssi < -157)
+ rssi = -157;
+ if (rssi > 98)
+ rssi = 98;
+ uint8_t rssi_byte = (uint8_t)(rssi + RNODE_RSSI_OFFSET);
+ rnode_send_frame(RNODE_CMD_STAT_RSSI, &rssi_byte, 1);
+
+ uint8_t snr_byte = (uint8_t)pkt->snr_pkt_db;
+ rnode_send_frame(RNODE_CMD_STAT_SNR, &snr_byte, 1);
+
+ uint8_t rxc[4] = {
+ (uint8_t)((s_stats.rx_count >> 24) & 0xFF),
+ (uint8_t)((s_stats.rx_count >> 16) & 0xFF),
+ (uint8_t)((s_stats.rx_count >> 8) & 0xFF),
+ (uint8_t)(s_stats.rx_count & 0xFF),
+ };
+ rnode_send_frame(RNODE_CMD_STAT_RX, rxc, sizeof(rxc));
+}
+
+static void on_radio_tx_done(void *ctx) {
+ (void)ctx;
+ if (s_tx_start_us > 0) {
+ s_tx_start_us = 0;
+ }
+ s_stats.tx_count++;
+
+ uint8_t txc[4] = {
+ (uint8_t)((s_stats.tx_count >> 24) & 0xFF),
+ (uint8_t)((s_stats.tx_count >> 16) & 0xFF),
+ (uint8_t)((s_stats.tx_count >> 8) & 0xFF),
+ (uint8_t)(s_stats.tx_count & 0xFF),
+ };
+ rnode_send_frame(RNODE_CMD_STAT_TX, txc, sizeof(txc));
+
+ if (s_cfg.is_radio_on) {
+ sx1262_receive_continuous();
+ }
+}
+
+static void on_radio_error(int err, void *ctx) {
+ (void)ctx;
+ ESP_LOGW(TAG, "radio error: %d", err);
+}
+
+static void on_radio_cad_done(bool is_active, void *ctx) {
+ (void)ctx;
+ s_is_cad_busy = is_active;
+ s_is_cad_pending = false;
+}
+
+static bool csma_check_clear(void) {
+ s_is_cad_pending = true;
+ s_is_cad_busy = false;
+
+ sx1262_stop_rx();
+ esp_err_t err = sx1262_cad_start();
+ if (err != ESP_OK) {
+ s_is_cad_pending = false;
+ return true;
+ }
+
+ uint32_t deadline_ms = (uint32_t)(esp_timer_get_time() / 1000ULL) + RNODE_CAD_TIMEOUT_MS;
+ while (s_is_cad_pending) {
+ uint32_t now_ms = (uint32_t)(esp_timer_get_time() / 1000ULL);
+ if ((int32_t)(now_ms - deadline_ms) >= 0) {
+ s_is_cad_pending = false;
+ ESP_LOGW(TAG, "CAD timeout -- assume clear");
+ return true;
+ }
+ vTaskDelay(pdMS_TO_TICKS(1));
+ }
+ return !s_is_cad_busy;
+}
+
+static uint32_t csma_backoff_ms(void) {
+ uint32_t r = esp_random() % RNODE_CSMA_BACKOFF_RAND_MS;
+ return RNODE_CSMA_BACKOFF_BASE_MS + r;
+}
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode_airtime.c b/firmware_p4/components/Applications/LoRa/rnode/rnode_airtime.c
new file mode 100644
index 00000000..607e1824
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode_airtime.c
@@ -0,0 +1,133 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rnode_internal.h"
+
+#include
+
+#include "esp_timer.h"
+
+#define AT_SHORT_WINDOW_MS 60000UL
+#define AT_LONG_WINDOW_MS 3600000UL
+#define AT_RING_SLOTS 64
+
+typedef struct {
+ uint64_t end_us;
+ uint32_t duration_ms;
+} at_event_t;
+
+static at_event_t s_events[AT_RING_SLOTS];
+static uint8_t s_event_head = 0;
+static uint8_t s_event_count = 0;
+static uint16_t s_st_limit_cpct = 0;
+static uint16_t s_lt_limit_cpct = 0;
+
+static uint64_t now_us(void);
+static uint32_t airtime_in_window(uint32_t window_ms);
+static uint16_t pct_centi(uint32_t airtime_ms, uint32_t window_ms);
+
+void rnode_airtime_record_tx(uint32_t airtime_ms) {
+ s_events[s_event_head].end_us = now_us();
+ s_events[s_event_head].duration_ms = airtime_ms;
+ s_event_head = (s_event_head + 1) % AT_RING_SLOTS;
+ if (s_event_count < AT_RING_SLOTS) {
+ s_event_count++;
+ }
+}
+
+uint16_t rnode_airtime_short(void) {
+ uint32_t ms = airtime_in_window(AT_SHORT_WINDOW_MS);
+ return pct_centi(ms, AT_SHORT_WINDOW_MS);
+}
+
+uint16_t rnode_airtime_long(void) {
+ uint32_t ms = airtime_in_window(AT_LONG_WINDOW_MS);
+ return pct_centi(ms, AT_LONG_WINDOW_MS);
+}
+
+void rnode_airtime_set_limits(uint16_t st_limit_cpct, uint16_t lt_limit_cpct) {
+ s_st_limit_cpct = st_limit_cpct;
+ s_lt_limit_cpct = lt_limit_cpct;
+}
+
+bool rnode_airtime_is_blocked(void) {
+ if (s_st_limit_cpct > 0 && rnode_airtime_short() >= s_st_limit_cpct) {
+ return true;
+ }
+ if (s_lt_limit_cpct > 0 && rnode_airtime_long() >= s_lt_limit_cpct) {
+ return true;
+ }
+ return false;
+}
+
+uint32_t rnode_airtime_estimate_ms(size_t payload_bytes, uint32_t bw_hz, uint8_t sf, uint8_t cr) {
+ if (bw_hz == 0 || sf < 5 || sf > 12) {
+ return 0;
+ }
+ double rs = (double)bw_hz / (double)(1U << sf);
+ double ts = 1.0 / rs;
+ double preamble_symbols = 8.0 + 4.25;
+ double cr_factor = (double)cr;
+ double pl = (double)payload_bytes;
+ double sf_d = (double)sf;
+ double de = (sf >= 11) ? 1.0 : 0.0;
+ double numerator = 8.0 * pl - 4.0 * sf_d + 28.0 + 16.0;
+ double denominator = 4.0 * (sf_d - 2.0 * de);
+ double payload_symbols = 8.0 + ceil(numerator / denominator) * cr_factor;
+ if (payload_symbols < 8.0) {
+ payload_symbols = 8.0;
+ }
+ double total_symbols = preamble_symbols + payload_symbols;
+ double airtime_s = total_symbols * ts;
+ double airtime_ms = airtime_s * 1000.0;
+ if (airtime_ms < 1.0) {
+ airtime_ms = 1.0;
+ }
+ return (uint32_t)(airtime_ms + 0.5);
+}
+
+static uint64_t now_us(void) {
+ return (uint64_t)esp_timer_get_time();
+}
+
+static uint32_t airtime_in_window(uint32_t window_ms) {
+ uint64_t cutoff_us = now_us();
+ uint64_t window_us = (uint64_t)window_ms * 1000ULL;
+ if (cutoff_us < window_us) {
+ cutoff_us = 0;
+ } else {
+ cutoff_us -= window_us;
+ }
+ uint32_t sum_ms = 0;
+ for (uint8_t i = 0; i < s_event_count; i++) {
+ uint8_t idx = (s_event_head + AT_RING_SLOTS - 1 - i) % AT_RING_SLOTS;
+ if (s_events[idx].end_us < cutoff_us) {
+ break;
+ }
+ sum_ms += s_events[idx].duration_ms;
+ }
+ return sum_ms;
+}
+
+static uint16_t pct_centi(uint32_t airtime_ms, uint32_t window_ms) {
+ if (window_ms == 0) {
+ return 0;
+ }
+ uint64_t v = (uint64_t)airtime_ms * 10000ULL / (uint64_t)window_ms;
+ if (v > 10000ULL) {
+ v = 10000ULL;
+ }
+ return (uint16_t)v;
+}
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode_commands.c b/firmware_p4/components/Applications/LoRa/rnode/rnode_commands.c
new file mode 100644
index 00000000..e7a69b98
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode_commands.c
@@ -0,0 +1,393 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rnode_internal.h"
+
+#include
+
+#include "esp_log.h"
+#include "esp_random.h"
+#include "esp_system.h"
+#include "esp_timer.h"
+
+static const char *TAG = "RNODE_CMD";
+
+static uint32_t read_be32(const uint8_t *p);
+static uint16_t read_be16(const uint8_t *p);
+static void write_be32(uint8_t *out, uint32_t v);
+
+static void handle_detect(const uint8_t *payload, size_t len);
+static void handle_fw_version(const uint8_t *payload, size_t len);
+static void handle_platform(const uint8_t *payload, size_t len);
+static void handle_mcu(const uint8_t *payload, size_t len);
+static void handle_frequency(const uint8_t *payload, size_t len);
+static void handle_bandwidth(const uint8_t *payload, size_t len);
+static void handle_txpower(const uint8_t *payload, size_t len);
+static void handle_sf(const uint8_t *payload, size_t len);
+static void handle_cr(const uint8_t *payload, size_t len);
+static void handle_radio_state(const uint8_t *payload, size_t len);
+static void handle_data(const uint8_t *payload, size_t len);
+static void handle_st_alock(const uint8_t *payload, size_t len);
+static void handle_lt_alock(const uint8_t *payload, size_t len);
+static void handle_blink(const uint8_t *payload, size_t len);
+static void handle_random(const uint8_t *payload, size_t len);
+static void handle_reset(const uint8_t *payload, size_t len);
+static void handle_leave(const uint8_t *payload, size_t len);
+static void handle_stat_chtm(const uint8_t *payload, size_t len);
+static void handle_stat_phyprm(const uint8_t *payload, size_t len);
+static void handle_stat_bat(const uint8_t *payload, size_t len);
+static void handle_stat_temp(const uint8_t *payload, size_t len);
+static void handle_stat_csma(const uint8_t *payload, size_t len);
+
+void rnode_dispatch(const uint8_t *frame, size_t len) {
+ if (frame == NULL || len == 0) {
+ return;
+ }
+ uint8_t cmd = frame[0];
+ const uint8_t *payload = (len > 1) ? &frame[1] : NULL;
+ size_t plen = (len > 1) ? len - 1 : 0;
+
+ switch (cmd) {
+ case RNODE_CMD_DATA:
+ handle_data(payload, plen);
+ break;
+ case RNODE_CMD_FREQUENCY:
+ handle_frequency(payload, plen);
+ break;
+ case RNODE_CMD_BANDWIDTH:
+ handle_bandwidth(payload, plen);
+ break;
+ case RNODE_CMD_TXPOWER:
+ handle_txpower(payload, plen);
+ break;
+ case RNODE_CMD_SF:
+ handle_sf(payload, plen);
+ break;
+ case RNODE_CMD_CR:
+ handle_cr(payload, plen);
+ break;
+ case RNODE_CMD_RADIO_STATE:
+ handle_radio_state(payload, plen);
+ break;
+ case RNODE_CMD_DETECT:
+ handle_detect(payload, plen);
+ break;
+ case RNODE_CMD_LEAVE:
+ handle_leave(payload, plen);
+ break;
+ case RNODE_CMD_ST_ALOCK:
+ handle_st_alock(payload, plen);
+ break;
+ case RNODE_CMD_LT_ALOCK:
+ handle_lt_alock(payload, plen);
+ break;
+ case RNODE_CMD_STAT_CHTM:
+ handle_stat_chtm(payload, plen);
+ break;
+ case RNODE_CMD_STAT_PHYPRM:
+ handle_stat_phyprm(payload, plen);
+ break;
+ case RNODE_CMD_STAT_BAT:
+ handle_stat_bat(payload, plen);
+ break;
+ case RNODE_CMD_STAT_CSMA:
+ handle_stat_csma(payload, plen);
+ break;
+ case RNODE_CMD_STAT_TEMP:
+ handle_stat_temp(payload, plen);
+ break;
+ case RNODE_CMD_BLINK:
+ handle_blink(payload, plen);
+ break;
+ case RNODE_CMD_RANDOM:
+ handle_random(payload, plen);
+ break;
+ case RNODE_CMD_FW_VERSION:
+ handle_fw_version(payload, plen);
+ break;
+ case RNODE_CMD_PLATFORM:
+ handle_platform(payload, plen);
+ break;
+ case RNODE_CMD_MCU:
+ handle_mcu(payload, plen);
+ break;
+ case RNODE_CMD_RESET:
+ handle_reset(payload, plen);
+ break;
+ case RNODE_CMD_RADIO_LOCK:
+ break;
+ default:
+ ESP_LOGW(TAG, "Unhandled CMD 0x%02X (%u bytes)", cmd, (unsigned)plen);
+ break;
+ }
+}
+
+static uint32_t read_be32(const uint8_t *p) {
+ return ((uint32_t)p[0] << 24) | ((uint32_t)p[1] << 16) | ((uint32_t)p[2] << 8) | (uint32_t)p[3];
+}
+
+static uint16_t read_be16(const uint8_t *p) {
+ return ((uint16_t)p[0] << 8) | (uint16_t)p[1];
+}
+
+static void write_be32(uint8_t *out, uint32_t v) {
+ out[0] = (uint8_t)((v >> 24) & 0xFF);
+ out[1] = (uint8_t)((v >> 16) & 0xFF);
+ out[2] = (uint8_t)((v >> 8) & 0xFF);
+ out[3] = (uint8_t)(v & 0xFF);
+}
+
+static void handle_detect(const uint8_t *payload, size_t len) {
+ if (len < 1 || payload[0] != RNODE_DETECT_PROBE) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint8_t resp = RNODE_CMD_DETECT_RESP;
+ rnode_send_frame(RNODE_CMD_DETECT, &resp, 1);
+}
+
+static void handle_fw_version(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t out[2] = {RNODE_FW_VERSION_MAJOR, RNODE_FW_VERSION_MINOR};
+ rnode_send_frame(RNODE_CMD_FW_VERSION, out, sizeof(out));
+}
+
+static void handle_platform(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t out = RNODE_PLATFORM_ESP32;
+ rnode_send_frame(RNODE_CMD_PLATFORM, &out, 1);
+}
+
+static void handle_mcu(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t out = RNODE_MCU_ESP32;
+ rnode_send_frame(RNODE_CMD_MCU, &out, 1);
+}
+
+static void handle_frequency(const uint8_t *payload, size_t len) {
+ if (len < 4) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint32_t freq = read_be32(payload);
+ rnode_cfg_mut()->freq_hz = freq;
+ rnode_nvs_save_cfg();
+ rnode_apply_radio_cfg();
+
+ uint8_t out[4];
+ write_be32(out, rnode_cfg_mut()->freq_hz);
+ rnode_send_frame(RNODE_CMD_FREQUENCY, out, sizeof(out));
+}
+
+static void handle_bandwidth(const uint8_t *payload, size_t len) {
+ if (len < 4) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint32_t bw = read_be32(payload);
+ rnode_cfg_mut()->bw_hz = bw;
+ rnode_nvs_save_cfg();
+ rnode_apply_radio_cfg();
+
+ uint8_t out[4];
+ write_be32(out, rnode_cfg_mut()->bw_hz);
+ rnode_send_frame(RNODE_CMD_BANDWIDTH, out, sizeof(out));
+}
+
+static void handle_txpower(const uint8_t *payload, size_t len) {
+ if (len < 1) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ int8_t power = (int8_t)payload[0];
+ rnode_cfg_mut()->tx_power_dbm = power;
+ rnode_nvs_save_cfg();
+ rnode_apply_radio_cfg();
+
+ uint8_t out = (uint8_t)rnode_cfg_mut()->tx_power_dbm;
+ rnode_send_frame(RNODE_CMD_TXPOWER, &out, 1);
+}
+
+static void handle_sf(const uint8_t *payload, size_t len) {
+ if (len < 1) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint8_t sf = payload[0];
+ if (sf < 5 || sf > 12) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ rnode_cfg_mut()->sf = sf;
+ rnode_nvs_save_cfg();
+ rnode_apply_radio_cfg();
+
+ uint8_t out = rnode_cfg_mut()->sf;
+ rnode_send_frame(RNODE_CMD_SF, &out, 1);
+}
+
+static void handle_cr(const uint8_t *payload, size_t len) {
+ if (len < 1) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint8_t cr = payload[0];
+ if (cr < 5 || cr > 8) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ rnode_cfg_mut()->cr = cr;
+ rnode_nvs_save_cfg();
+ rnode_apply_radio_cfg();
+
+ uint8_t out = rnode_cfg_mut()->cr;
+ rnode_send_frame(RNODE_CMD_CR, &out, 1);
+}
+
+static void handle_radio_state(const uint8_t *payload, size_t len) {
+ rnode_radio_cfg_t *cfg = rnode_cfg_mut();
+ if (len >= 1 && payload[0] != 0xFF) {
+ bool is_on = (payload[0] != 0);
+ if (rnode_set_radio_state(is_on) != ESP_OK) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ cfg->is_radio_on = is_on;
+ }
+ uint8_t out = cfg->is_radio_on ? 0x01 : 0x00;
+ rnode_send_frame(RNODE_CMD_RADIO_STATE, &out, 1);
+}
+
+static void handle_data(const uint8_t *payload, size_t len) {
+ if (len == 0) {
+ return;
+ }
+ if (rnode_airtime_is_blocked()) {
+ rnode_send_error(RNODE_ERROR_QUEUE_FULL);
+ return;
+ }
+ esp_err_t ret = rnode_radio_transmit(payload, len);
+ if (ret != ESP_OK) {
+ ESP_LOGW(TAG, "TX failed: %s", esp_err_to_name(ret));
+ rnode_send_error(RNODE_ERROR_TXFAILED);
+ return;
+ }
+ rnode_stats_mut()->tx_count++;
+}
+
+static void handle_st_alock(const uint8_t *payload, size_t len) {
+ if (len < 2) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint16_t st = read_be16(payload);
+ rnode_airtime_set_limits(st, rnode_airtime_long());
+ rnode_send_frame(RNODE_CMD_ST_ALOCK, payload, 2);
+}
+
+static void handle_lt_alock(const uint8_t *payload, size_t len) {
+ if (len < 2) {
+ rnode_send_error(RNODE_ERROR_INITRADIO);
+ return;
+ }
+ uint16_t lt = read_be16(payload);
+ rnode_airtime_set_limits(rnode_airtime_short(), lt);
+ rnode_send_frame(RNODE_CMD_LT_ALOCK, payload, 2);
+}
+
+static void handle_blink(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ ESP_LOGI(TAG, "BLINK");
+}
+
+static void handle_random(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t r = (uint8_t)(esp_random() & 0xFF);
+ rnode_send_frame(RNODE_CMD_RANDOM, &r, 1);
+}
+
+static void handle_reset(const uint8_t *payload, size_t len) {
+ if (len < 1 || payload[0] != RNODE_RESET_MAGIC) {
+ return;
+ }
+ ESP_LOGW(TAG, "Host requested reset");
+ esp_restart();
+}
+
+static void handle_leave(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ ESP_LOGI(TAG, "Host went offline");
+}
+
+static void handle_stat_chtm(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t out[11] = {0};
+ uint16_t st = rnode_airtime_short();
+ uint16_t lt = rnode_airtime_long();
+ out[0] = (uint8_t)((st >> 8) & 0xFF);
+ out[1] = (uint8_t)(st & 0xFF);
+ out[2] = (uint8_t)((lt >> 8) & 0xFF);
+ out[3] = (uint8_t)(lt & 0xFF);
+ rnode_send_frame(RNODE_CMD_STAT_CHTM, out, sizeof(out));
+}
+
+static void handle_stat_phyprm(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ const rnode_radio_cfg_t *cfg = rnode_get_radio_cfg();
+ uint32_t symbol_time_us = 0;
+ if (cfg->bw_hz > 0) {
+ symbol_time_us = ((uint32_t)1U << cfg->sf) * 1000000U / cfg->bw_hz;
+ }
+ uint8_t out[12] = {0};
+ out[0] = cfg->sf;
+ out[1] = cfg->cr;
+ write_be32(&out[2], cfg->bw_hz);
+ write_be32(&out[6], symbol_time_us);
+ out[10] = 8;
+ out[11] = 0;
+ rnode_send_frame(RNODE_CMD_STAT_PHYPRM, out, sizeof(out));
+}
+
+static void handle_stat_bat(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t out[2];
+ out[0] = 0x01;
+ out[1] = rnode_get_stats()->battery_pct;
+ rnode_send_frame(RNODE_CMD_STAT_BAT, out, sizeof(out));
+}
+
+static void handle_stat_temp(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ int8_t temp_c = rnode_get_stats()->cpu_temp_c;
+ uint8_t out = (uint8_t)(temp_c + RNODE_TEMP_OFFSET);
+ rnode_send_frame(RNODE_CMD_STAT_TEMP, &out, 1);
+}
+
+static void handle_stat_csma(const uint8_t *payload, size_t len) {
+ (void)payload;
+ (void)len;
+ uint8_t out[3] = {0, 0, 0};
+ rnode_send_frame(RNODE_CMD_STAT_CSMA, out, sizeof(out));
+}
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode_internal.h b/firmware_p4/components/Applications/LoRa/rnode/rnode_internal.h
new file mode 100644
index 00000000..7fc9ca0b
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode_internal.h
@@ -0,0 +1,158 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef RNODE_INTERNAL_H
+#define RNODE_INTERNAL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#include "rnode.h"
+
+#define RNODE_CMD_DATA 0x00
+#define RNODE_CMD_FREQUENCY 0x01
+#define RNODE_CMD_BANDWIDTH 0x02
+#define RNODE_CMD_TXPOWER 0x03
+#define RNODE_CMD_SF 0x04
+#define RNODE_CMD_CR 0x05
+#define RNODE_CMD_RADIO_STATE 0x06
+#define RNODE_CMD_RADIO_LOCK 0x07
+#define RNODE_CMD_DETECT 0x08
+#define RNODE_CMD_READY 0x0F
+#define RNODE_CMD_LEAVE 0x0A
+#define RNODE_CMD_ST_ALOCK 0x0B
+#define RNODE_CMD_LT_ALOCK 0x0C
+#define RNODE_CMD_STAT_RX 0x21
+#define RNODE_CMD_STAT_TX 0x22
+#define RNODE_CMD_STAT_RSSI 0x23
+#define RNODE_CMD_STAT_SNR 0x24
+#define RNODE_CMD_STAT_CHTM 0x25
+#define RNODE_CMD_STAT_PHYPRM 0x26
+#define RNODE_CMD_STAT_BAT 0x27
+#define RNODE_CMD_STAT_CSMA 0x28
+#define RNODE_CMD_STAT_TEMP 0x29
+#define RNODE_CMD_BLINK 0x30
+#define RNODE_CMD_RANDOM 0x40
+#define RNODE_CMD_DETECT_RESP 0x46
+#define RNODE_CMD_PLATFORM 0x48
+#define RNODE_CMD_MCU 0x49
+#define RNODE_CMD_FW_VERSION 0x50
+#define RNODE_CMD_RESET 0x55
+#define RNODE_CMD_ERROR 0x90
+
+#define RNODE_DETECT_PROBE 0x73
+#define RNODE_RESET_MAGIC 0xF8
+#define RNODE_LEAVE_MAGIC 0xFF
+
+#define RNODE_ERROR_INITRADIO 0x01
+#define RNODE_ERROR_TXFAILED 0x02
+#define RNODE_ERROR_EEPROM_LOCKED 0x03
+#define RNODE_ERROR_QUEUE_FULL 0x04
+#define RNODE_ERROR_MEMORY_LOW 0x05
+#define RNODE_ERROR_MODEM_TIMEOUT 0x06
+
+#define RNODE_RSSI_OFFSET 157
+#define RNODE_TEMP_OFFSET 120
+
+#define RNODE_AIRTIME_WINDOW_MS 3600000UL
+
+/**
+ * @brief Encode a KISS frame and send it over the serial port.
+ */
+void rnode_send_frame(uint8_t cmd_id, const uint8_t *payload, size_t len);
+
+/**
+ * @brief Send an error frame (CMD_ERROR + 1B code).
+ */
+void rnode_send_error(uint8_t code);
+
+/**
+ * @brief Central command dispatcher. Processes a decoded KISS frame.
+ */
+void rnode_dispatch(const uint8_t *frame, size_t len);
+
+/**
+ * @brief Push the current radio config to the SX1262 (freq/bw/sf/cr/power).
+ */
+esp_err_t rnode_apply_radio_cfg(void);
+
+/**
+ * @brief Toggle continuous RX on the SX1262.
+ */
+esp_err_t rnode_set_radio_state(bool is_on);
+
+/**
+ * @brief Transmit payload via SX1262 with CSMA/CAD listen-before-talk.
+ */
+esp_err_t rnode_radio_transmit(const uint8_t *data, size_t len);
+
+/**
+ * @brief Mutable accessors for internal config and stats.
+ */
+rnode_radio_cfg_t *rnode_cfg_mut(void);
+rnode_stats_t *rnode_stats_mut(void);
+
+/**
+ * @brief Persist the current radio config in NVS.
+ */
+void rnode_nvs_save_cfg(void);
+
+/**
+ * @brief Load radio config from NVS, falling back to defaults.
+ */
+void rnode_nvs_load_cfg(void);
+
+/**
+ * @brief Record a TX event in the airtime tracker.
+ */
+void rnode_airtime_record_tx(uint32_t airtime_ms);
+
+/**
+ * @brief Accumulated airtime in the short window (1 min) as hundredths of %.
+ */
+uint16_t rnode_airtime_short(void);
+
+/**
+ * @brief Accumulated airtime in the long window (1 hour) as hundredths of %.
+ */
+uint16_t rnode_airtime_long(void);
+
+/**
+ * @brief Regulatory setpoints (host sends via CMD_ST_ALOCK / CMD_LT_ALOCK).
+ * Values in hundredths of % (0..10000).
+ */
+void rnode_airtime_set_limits(uint16_t st_limit_cpct, uint16_t lt_limit_cpct);
+
+/**
+ * @brief Returns true if TX is currently blocked by airtime enforcement.
+ */
+bool rnode_airtime_is_blocked(void);
+
+/**
+ * @brief Estimate LoRa packet airtime in milliseconds.
+ * Semtech AN1200.13 formula.
+ */
+uint32_t rnode_airtime_estimate_ms(size_t payload_bytes, uint32_t bw_hz, uint8_t sf, uint8_t cr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RNODE_INTERNAL_H
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode_kiss.c b/firmware_p4/components/Applications/LoRa/rnode/rnode_kiss.c
new file mode 100644
index 00000000..16356ade
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode_kiss.c
@@ -0,0 +1,154 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rnode_kiss.h"
+
+#include
+
+static size_t append_escaped(uint8_t *out, size_t pos, size_t cap, uint8_t b);
+
+void rnode_kiss_decoder_reset(rnode_kiss_decoder_t *d) {
+ if (d == NULL) {
+ return;
+ }
+ d->len = 0;
+ d->is_in_frame = false;
+ d->is_escaped = false;
+ d->has_frame_ready = false;
+}
+
+bool rnode_kiss_decoder_feed(rnode_kiss_decoder_t *d, uint8_t byte) {
+ if (d == NULL) {
+ return false;
+ }
+
+ if (byte == KISS_FEND) {
+ if (d->is_in_frame && d->len > 0) {
+ d->has_frame_ready = true;
+ d->is_in_frame = false;
+ return true;
+ }
+ d->is_in_frame = true;
+ d->is_escaped = false;
+ d->len = 0;
+ return false;
+ }
+
+ if (!d->is_in_frame) {
+ return false;
+ }
+
+ if (d->is_escaped) {
+ d->is_escaped = false;
+ uint8_t out = byte;
+ if (byte == KISS_TFEND) {
+ out = KISS_FEND;
+ } else if (byte == KISS_TFESC) {
+ out = KISS_FESC;
+ }
+ if (d->len < RNODE_KISS_FRAME_MAX) {
+ d->buf[d->len++] = out;
+ } else {
+ d->is_in_frame = false;
+ d->len = 0;
+ }
+ return false;
+ }
+
+ if (byte == KISS_FESC) {
+ d->is_escaped = true;
+ return false;
+ }
+
+ if (d->len < RNODE_KISS_FRAME_MAX) {
+ d->buf[d->len++] = byte;
+ } else {
+ d->is_in_frame = false;
+ d->len = 0;
+ }
+ return false;
+}
+
+bool rnode_kiss_decoder_take_frame(rnode_kiss_decoder_t *d,
+ uint8_t *out_buf,
+ size_t cap,
+ size_t *out_len) {
+ if (d == NULL || !d->has_frame_ready) {
+ return false;
+ }
+ size_t n = d->len;
+ if (n > cap) {
+ n = cap;
+ }
+ if (out_buf != NULL) {
+ memcpy(out_buf, d->buf, n);
+ }
+ if (out_len != NULL) {
+ *out_len = n;
+ }
+ d->has_frame_ready = false;
+ d->len = 0;
+ return true;
+}
+
+size_t rnode_kiss_encode(
+ uint8_t cmd_id, const uint8_t *payload, size_t payload_len, uint8_t *out_buf, size_t cap) {
+ if (out_buf == NULL || cap < 3) {
+ return 0;
+ }
+ size_t pos = 0;
+ out_buf[pos++] = KISS_FEND;
+ size_t after = append_escaped(out_buf, pos, cap, cmd_id);
+ if (after == 0) {
+ return 0;
+ }
+ pos = after;
+ for (size_t i = 0; i < payload_len; i++) {
+ after = append_escaped(out_buf, pos, cap, payload[i]);
+ if (after == 0) {
+ return 0;
+ }
+ pos = after;
+ }
+ if (pos + 1 > cap) {
+ return 0;
+ }
+ out_buf[pos++] = KISS_FEND;
+ return pos;
+}
+
+static size_t append_escaped(uint8_t *out, size_t pos, size_t cap, uint8_t b) {
+ if (b == KISS_FEND) {
+ if (pos + 2 > cap) {
+ return 0;
+ }
+ out[pos++] = KISS_FESC;
+ out[pos++] = KISS_TFEND;
+ return pos;
+ }
+ if (b == KISS_FESC) {
+ if (pos + 2 > cap) {
+ return 0;
+ }
+ out[pos++] = KISS_FESC;
+ out[pos++] = KISS_TFESC;
+ return pos;
+ }
+ if (pos + 1 > cap) {
+ return 0;
+ }
+ out[pos++] = b;
+ return pos;
+}
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode_nvs.c b/firmware_p4/components/Applications/LoRa/rnode/rnode_nvs.c
new file mode 100644
index 00000000..4c563393
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode_nvs.c
@@ -0,0 +1,90 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rnode_internal.h"
+
+#include "esp_log.h"
+#include "nvs.h"
+#include "nvs_flash.h"
+
+static const char *TAG = "RNODE_NVS";
+
+#define RNODE_NVS_NAMESPACE "rnode"
+#define RNODE_NVS_KEY_CFG "radio_cfg"
+
+#define RNODE_FREQ_MIN_HZ 137000000UL
+#define RNODE_FREQ_MAX_HZ 3000000000UL
+#define RNODE_BW_MIN_HZ 7800UL
+#define RNODE_BW_MAX_HZ 1625000UL
+#define RNODE_SF_MIN 5
+#define RNODE_SF_MAX 12
+#define RNODE_CR_MIN 5
+#define RNODE_CR_MAX 8
+#define RNODE_TX_POWER_MIN_DBM (-9)
+#define RNODE_TX_POWER_MAX_DBM 22
+
+void rnode_nvs_save_cfg(void) {
+ nvs_handle_t h;
+ esp_err_t err = nvs_open(RNODE_NVS_NAMESPACE, NVS_READWRITE, &h);
+ if (err != ESP_OK) {
+ ESP_LOGW(TAG, "nvs_open failed: %s", esp_err_to_name(err));
+ return;
+ }
+ nvs_set_blob(h, RNODE_NVS_KEY_CFG, rnode_cfg_mut(), sizeof(rnode_radio_cfg_t));
+ nvs_commit(h);
+ nvs_close(h);
+}
+
+void rnode_nvs_load_cfg(void) {
+ rnode_radio_cfg_t *cfg = rnode_cfg_mut();
+ cfg->freq_hz = RNODE_DEFAULT_FREQ_HZ;
+ cfg->bw_hz = RNODE_DEFAULT_BW_HZ;
+ cfg->sf = RNODE_DEFAULT_SF;
+ cfg->cr = RNODE_DEFAULT_CR;
+ cfg->tx_power_dbm = RNODE_DEFAULT_TX_POWER_DBM;
+ cfg->is_radio_on = false;
+
+ nvs_handle_t h;
+ esp_err_t err = nvs_open(RNODE_NVS_NAMESPACE, NVS_READONLY, &h);
+ if (err != ESP_OK) {
+ return;
+ }
+
+ rnode_radio_cfg_t persisted = {0};
+ size_t sz = sizeof(persisted);
+ err = nvs_get_blob(h, RNODE_NVS_KEY_CFG, &persisted, &sz);
+ nvs_close(h);
+
+ if (err != ESP_OK || sz != sizeof(persisted)) {
+ return;
+ }
+ if (persisted.freq_hz >= RNODE_FREQ_MIN_HZ && persisted.freq_hz <= RNODE_FREQ_MAX_HZ) {
+ cfg->freq_hz = persisted.freq_hz;
+ }
+ if (persisted.bw_hz >= RNODE_BW_MIN_HZ && persisted.bw_hz <= RNODE_BW_MAX_HZ) {
+ cfg->bw_hz = persisted.bw_hz;
+ }
+ if (persisted.sf >= RNODE_SF_MIN && persisted.sf <= RNODE_SF_MAX) {
+ cfg->sf = persisted.sf;
+ }
+ if (persisted.cr >= RNODE_CR_MIN && persisted.cr <= RNODE_CR_MAX) {
+ cfg->cr = persisted.cr;
+ }
+ if (persisted.tx_power_dbm >= RNODE_TX_POWER_MIN_DBM &&
+ persisted.tx_power_dbm <= RNODE_TX_POWER_MAX_DBM) {
+ cfg->tx_power_dbm = persisted.tx_power_dbm;
+ }
+ ESP_LOGI(TAG, "Loaded radio cfg from NVS");
+}
diff --git a/firmware_p4/components/Applications/LoRa/rnode/rnode_serial.c b/firmware_p4/components/Applications/LoRa/rnode/rnode_serial.c
new file mode 100644
index 00000000..db0ccbad
--- /dev/null
+++ b/firmware_p4/components/Applications/LoRa/rnode/rnode_serial.c
@@ -0,0 +1,89 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rnode_serial.h"
+
+#include "driver/uart.h"
+#include "esp_log.h"
+
+static const char *TAG = "RNODE_SERIAL";
+
+#define RNODE_UART_PORT UART_NUM_0
+#define RNODE_UART_TX_PIN 43
+#define RNODE_UART_RX_PIN 44
+#define RNODE_UART_BAUD 115200
+#define RNODE_UART_RX_BUF 2048
+#define RNODE_UART_TX_BUF 2048
+
+esp_err_t rnode_serial_init(void) {
+ uart_config_t cfg = {
+ .baud_rate = RNODE_UART_BAUD,
+ .data_bits = UART_DATA_8_BITS,
+ .parity = UART_PARITY_DISABLE,
+ .stop_bits = UART_STOP_BITS_1,
+ .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
+ .source_clk = UART_SCLK_DEFAULT,
+ };
+
+ esp_err_t ret =
+ uart_driver_install(RNODE_UART_PORT, RNODE_UART_RX_BUF, RNODE_UART_TX_BUF, 0, NULL, 0);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "uart_driver_install failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ ret = uart_param_config(RNODE_UART_PORT, &cfg);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "uart_param_config failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ ret = uart_set_pin(RNODE_UART_PORT,
+ RNODE_UART_TX_PIN,
+ RNODE_UART_RX_PIN,
+ UART_PIN_NO_CHANGE,
+ UART_PIN_NO_CHANGE);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "uart_set_pin failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ ESP_LOGI(TAG,
+ "UART%d @ %d baud (TX=GPIO%d RX=GPIO%d)",
+ RNODE_UART_PORT,
+ RNODE_UART_BAUD,
+ RNODE_UART_TX_PIN,
+ RNODE_UART_RX_PIN);
+ return ESP_OK;
+}
+
+int rnode_serial_write(const uint8_t *data, size_t len) {
+ if (data == NULL || len == 0) {
+ return 0;
+ }
+ int n = uart_write_bytes(RNODE_UART_PORT, (const char *)data, len);
+ return n;
+}
+
+int rnode_serial_read(uint8_t *out, size_t cap) {
+ if (out == NULL || cap == 0) {
+ return 0;
+ }
+ int n = uart_read_bytes(RNODE_UART_PORT, out, cap, 0);
+ if (n < 0) {
+ return 0;
+ }
+ return n;
+}
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_analyzer.h b/firmware_p4/components/Applications/SubGhz/include/subghz_analyzer.h
index a35f3ea0..3a5698c4 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_analyzer.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_analyzer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_ANALYZER_H
#define SUBGHZ_ANALYZER_H
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_protocol_serializer.h b/firmware_p4/components/Applications/SubGhz/include/subghz_protocol_serializer.h
index 21e1c229..07693891 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_protocol_serializer.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_protocol_serializer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_PROTOCOL_SERIALIZER_H
#define SUBGHZ_PROTOCOL_SERIALIZER_H
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_receiver.h b/firmware_p4/components/Applications/SubGhz/include/subghz_receiver.h
index 1e435aa1..8f0da732 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_receiver.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_receiver.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_RECEIVER_H
#define SUBGHZ_RECEIVER_H
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_spectrum.h b/firmware_p4/components/Applications/SubGhz/include/subghz_spectrum.h
index 7ae20926..94baea1b 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_spectrum.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_spectrum.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_SPECTRUM_H
#define SUBGHZ_SPECTRUM_H
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_storage.h b/firmware_p4/components/Applications/SubGhz/include/subghz_storage.h
index acbe0b11..21460af3 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_storage.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_storage.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_STORAGE_H
#define SUBGHZ_STORAGE_H
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_transmitter.h b/firmware_p4/components/Applications/SubGhz/include/subghz_transmitter.h
index 78cd3a11..686534b9 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_transmitter.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_transmitter.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_TRANSMITTER_H
#define SUBGHZ_TRANSMITTER_H
diff --git a/firmware_p4/components/Applications/SubGhz/include/subghz_types.h b/firmware_p4/components/Applications/SubGhz/include/subghz_types.h
index 5581d9c0..620a3b17 100644
--- a/firmware_p4/components/Applications/SubGhz/include/subghz_types.h
+++ b/firmware_p4/components/Applications/SubGhz/include/subghz_types.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_TYPES_H
#define SUBGHZ_TYPES_H
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_decoder.h b/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_decoder.h
index a61bccf7..917b6463 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_decoder.h
+++ b/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_decoder.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_PROTOCOL_DECODER_H
#define SUBGHZ_PROTOCOL_DECODER_H
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_registry.h b/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_registry.h
index a0cf4a93..b35f41b8 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_registry.h
+++ b/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_registry.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_PROTOCOL_REGISTRY_H
#define SUBGHZ_PROTOCOL_REGISTRY_H
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_utils.h b/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_utils.h
index ed00a2be..7ced43db 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_utils.h
+++ b/firmware_p4/components/Applications/SubGhz/protocols/include/subghz_protocol_utils.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_PROTOCOL_UTILS_H
#define SUBGHZ_PROTOCOL_UTILS_H
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_ansonic.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_ansonic.c
index 29c744a4..62651216 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_ansonic.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_ansonic.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_came.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_came.c
index e907fab9..d39d151c 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_came.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_came.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_chamberlain.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_chamberlain.c
index 8e33db9b..2a1ca58d 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_chamberlain.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_chamberlain.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_holtek.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_holtek.c
index d7f504d6..a5d5d132 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_holtek.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_holtek.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_liftmaster.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_liftmaster.c
index ab142bb7..e7d74fad 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_liftmaster.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_liftmaster.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_linear.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_linear.c
index 253a6802..cd8d3546 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_linear.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_linear.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_nice_flo.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_nice_flo.c
index 59832043..8c5916fe 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_nice_flo.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_nice_flo.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_princeton.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_princeton.c
index 51515a5e..af6f4b91 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_princeton.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_princeton.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_rcswitch.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_rcswitch.c
index 8754ac6d..d43f63b5 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_rcswitch.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_rcswitch.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/protocol_rossi.c b/firmware_p4/components/Applications/SubGhz/protocols/protocol_rossi.c
index 3fbac2cd..ba68de0d 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/protocol_rossi.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/protocol_rossi.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_decoder.h"
diff --git a/firmware_p4/components/Applications/SubGhz/protocols/subghz_protocol_registry.c b/firmware_p4/components/Applications/SubGhz/protocols/subghz_protocol_registry.c
index 0259cd98..50e04c17 100644
--- a/firmware_p4/components/Applications/SubGhz/protocols/subghz_protocol_registry.c
+++ b/firmware_p4/components/Applications/SubGhz/protocols/subghz_protocol_registry.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_registry.h"
diff --git a/firmware_p4/components/Applications/SubGhz/subghz_analyzer.c b/firmware_p4/components/Applications/SubGhz/subghz_analyzer.c
index 23a92ca6..a1ea5a61 100644
--- a/firmware_p4/components/Applications/SubGhz/subghz_analyzer.c
+++ b/firmware_p4/components/Applications/SubGhz/subghz_analyzer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_analyzer.h"
diff --git a/firmware_p4/components/Applications/SubGhz/subghz_protocol_serializer.c b/firmware_p4/components/Applications/SubGhz/subghz_protocol_serializer.c
index ea74b7e0..9469902a 100644
--- a/firmware_p4/components/Applications/SubGhz/subghz_protocol_serializer.c
+++ b/firmware_p4/components/Applications/SubGhz/subghz_protocol_serializer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_protocol_serializer.h"
diff --git a/firmware_p4/components/Applications/SubGhz/subghz_receiver.c b/firmware_p4/components/Applications/SubGhz/subghz_receiver.c
index bc269575..2c1ecf99 100644
--- a/firmware_p4/components/Applications/SubGhz/subghz_receiver.c
+++ b/firmware_p4/components/Applications/SubGhz/subghz_receiver.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_receiver.h"
diff --git a/firmware_p4/components/Applications/SubGhz/subghz_spectrum.c b/firmware_p4/components/Applications/SubGhz/subghz_spectrum.c
index fadb4807..25c1c4f5 100644
--- a/firmware_p4/components/Applications/SubGhz/subghz_spectrum.c
+++ b/firmware_p4/components/Applications/SubGhz/subghz_spectrum.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_spectrum.h"
diff --git a/firmware_p4/components/Applications/SubGhz/subghz_storage.c b/firmware_p4/components/Applications/SubGhz/subghz_storage.c
index 3ebc072c..ac6652d8 100644
--- a/firmware_p4/components/Applications/SubGhz/subghz_storage.c
+++ b/firmware_p4/components/Applications/SubGhz/subghz_storage.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_storage.h"
diff --git a/firmware_p4/components/Applications/SubGhz/subghz_transmitter.c b/firmware_p4/components/Applications/SubGhz/subghz_transmitter.c
index f8e50ed7..5fb53ccd 100644
--- a/firmware_p4/components/Applications/SubGhz/subghz_transmitter.c
+++ b/firmware_p4/components/Applications/SubGhz/subghz_transmitter.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_transmitter.h"
diff --git a/firmware_p4/components/Applications/bad_usb/bad_usb.c b/firmware_p4/components/Applications/bad_usb/bad_usb.c
index 512ec52c..8daa56cb 100644
--- a/firmware_p4/components/Applications/bad_usb/bad_usb.c
+++ b/firmware_p4/components/Applications/bad_usb/bad_usb.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "bad_usb.h"
diff --git a/firmware_p4/components/Applications/bad_usb/ducky_parser.c b/firmware_p4/components/Applications/bad_usb/ducky_parser.c
index 0e4b77d3..a3c7c93f 100644
--- a/firmware_p4/components/Applications/bad_usb/ducky_parser.c
+++ b/firmware_p4/components/Applications/bad_usb/ducky_parser.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ducky_parser.h"
diff --git a/firmware_p4/components/Applications/bad_usb/hid_hal.c b/firmware_p4/components/Applications/bad_usb/hid_hal.c
index de0e2abe..d7170c05 100644
--- a/firmware_p4/components/Applications/bad_usb/hid_hal.c
+++ b/firmware_p4/components/Applications/bad_usb/hid_hal.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "hid_hal.h"
diff --git a/firmware_p4/components/Applications/bad_usb/hid_layouts.c b/firmware_p4/components/Applications/bad_usb/hid_layouts.c
index 2751506d..01c5ff61 100644
--- a/firmware_p4/components/Applications/bad_usb/hid_layouts.c
+++ b/firmware_p4/components/Applications/bad_usb/hid_layouts.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "hid_layouts.h"
diff --git a/firmware_p4/components/Applications/bad_usb/include/bad_usb.h b/firmware_p4/components/Applications/bad_usb/include/bad_usb.h
index 6d45e1fa..fdcb2c18 100644
--- a/firmware_p4/components/Applications/bad_usb/include/bad_usb.h
+++ b/firmware_p4/components/Applications/bad_usb/include/bad_usb.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BAD_USB_H
#define BAD_USB_H
diff --git a/firmware_p4/components/Applications/bad_usb/include/ducky_parser.h b/firmware_p4/components/Applications/bad_usb/include/ducky_parser.h
index a15d4fd1..82ead1d7 100644
--- a/firmware_p4/components/Applications/bad_usb/include/ducky_parser.h
+++ b/firmware_p4/components/Applications/bad_usb/include/ducky_parser.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef DUCKY_PARSER_H
#define DUCKY_PARSER_H
diff --git a/firmware_p4/components/Applications/bad_usb/include/hid_hal.h b/firmware_p4/components/Applications/bad_usb/include/hid_hal.h
index 022f3e07..2598af05 100644
--- a/firmware_p4/components/Applications/bad_usb/include/hid_hal.h
+++ b/firmware_p4/components/Applications/bad_usb/include/hid_hal.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HID_HAL_H
#define HID_HAL_H
diff --git a/firmware_p4/components/Applications/bad_usb/include/hid_layouts.h b/firmware_p4/components/Applications/bad_usb/include/hid_layouts.h
index 14026c32..8b32b30b 100644
--- a/firmware_p4/components/Applications/bad_usb/include/hid_layouts.h
+++ b/firmware_p4/components/Applications/bad_usb/include/hid_layouts.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HID_LAYOUTS_H
#define HID_LAYOUTS_H
diff --git a/firmware_p4/components/Applications/bluetooth/android_spam.c b/firmware_p4/components/Applications/bluetooth/android_spam.c
index ae6b8b96..d2223e32 100644
--- a/firmware_p4/components/Applications/bluetooth/android_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/android_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "android_spam.h"
diff --git a/firmware_p4/components/Applications/bluetooth/apple_juice_spam.c b/firmware_p4/components/Applications/bluetooth/apple_juice_spam.c
index 07135c57..9b073e6d 100644
--- a/firmware_p4/components/Applications/bluetooth/apple_juice_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/apple_juice_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "apple_juice_spam.h"
diff --git a/firmware_p4/components/Applications/bluetooth/ble_connect_flood.c b/firmware_p4/components/Applications/bluetooth/ble_connect_flood.c
index 33ca6377..0e3eb80a 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_connect_flood.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_connect_flood.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_connect_flood.h"
@@ -19,13 +20,14 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "BLE_CONNECT_FLOOD";
#define FLOOD_ADDR_PAYLOAD_SIZE 7
-#define FLOOD_SPI_TIMEOUT_MS 2000
static bool s_is_running = false;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
esp_err_t ble_connect_flood_start(const uint8_t *addr, uint8_t addr_type) {
if (addr == NULL)
@@ -33,16 +35,20 @@ esp_err_t ble_connect_flood_start(const uint8_t *addr, uint8_t addr_type) {
uint8_t payload[FLOOD_ADDR_PAYLOAD_SIZE];
memcpy(payload, addr, 6);
payload[6] = addr_type;
- esp_err_t err = spi_bridge_send_command(
- SPI_ID_BT_APP_FLOOD, payload, sizeof(payload), NULL, NULL, FLOOD_SPI_TIMEOUT_MS);
- s_is_running = (err == ESP_OK);
- if (!s_is_running)
+ s_session_id = spi_session_start(SPI_ID_BT_APP_FLOOD, payload, sizeof(payload), NULL, NULL);
+ s_is_running = (s_session_id != SPI_SESSION_INVALID_ID);
+ if (!s_is_running) {
ESP_LOGW(TAG, "BLE flood failed over SPI.");
- return err;
+ return ESP_FAIL;
+ }
+ return ESP_OK;
}
esp_err_t ble_connect_flood_stop(void) {
- spi_bridge_send_command(SPI_ID_BT_APP_STOP, NULL, 0, NULL, NULL, FLOOD_SPI_TIMEOUT_MS);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
s_is_running = false;
return ESP_OK;
}
diff --git a/firmware_p4/components/Applications/bluetooth/ble_hid_keyboard.c b/firmware_p4/components/Applications/bluetooth/ble_hid_keyboard.c
index b4c219c2..2a726319 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_hid_keyboard.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_hid_keyboard.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_hid_keyboard.h"
diff --git a/firmware_p4/components/Applications/bluetooth/ble_l2cap_flood.c b/firmware_p4/components/Applications/bluetooth/ble_l2cap_flood.c
index ce404bf4..25c56912 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_l2cap_flood.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_l2cap_flood.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_l2cap_flood.h"
@@ -21,14 +22,14 @@
#include "bluetooth_service.h"
#include "spi_bridge.h"
#include "spi_protocol.h"
+#include "spi_session.h"
static const char *TAG = "BLE_L2CAP_FLOOD";
#define L2CAP_ADDR_PAYLOAD_SIZE 7
-#define L2CAP_SPI_START_TIMEOUT 5000
-#define L2CAP_SPI_STOP_TIMEOUT 2000
static bool s_is_running = false;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
esp_err_t ble_l2cap_flood_start(const uint8_t *addr, uint8_t addr_type) {
if (s_is_running) {
@@ -44,13 +45,8 @@ esp_err_t ble_l2cap_flood_start(const uint8_t *addr, uint8_t addr_type) {
memcpy(payload, addr, 6);
payload[6] = addr_type;
- spi_header_t resp_hdr;
- uint8_t resp_buf[SPI_MAX_PAYLOAD];
-
- esp_err_t ret = spi_bridge_send_command(
- SPI_ID_BT_APP_FLOOD, payload, sizeof(payload), &resp_hdr, resp_buf, L2CAP_SPI_START_TIMEOUT);
-
- if (ret != ESP_OK || resp_buf[0] != SPI_STATUS_OK) {
+ s_session_id = spi_session_start(SPI_ID_BT_APP_FLOOD, payload, sizeof(payload), NULL, NULL);
+ if (s_session_id == SPI_SESSION_INVALID_ID) {
ESP_LOGE(TAG, "Failed to start L2CAP flood on C5");
return ESP_FAIL;
}
@@ -64,16 +60,10 @@ esp_err_t ble_l2cap_flood_stop(void) {
if (!s_is_running)
return ESP_OK;
- spi_header_t resp_hdr;
- uint8_t resp_buf[SPI_MAX_PAYLOAD];
-
- esp_err_t ret = spi_bridge_send_command(
- SPI_ID_BT_APP_STOP, NULL, 0, &resp_hdr, resp_buf, L2CAP_SPI_STOP_TIMEOUT);
-
- if (ret != ESP_OK || resp_buf[0] != SPI_STATUS_OK) {
- ESP_LOGW(TAG, "Failed to stop L2CAP flood on C5");
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
}
-
s_is_running = false;
ESP_LOGI(TAG, "L2CAP Flood stopped");
return ESP_OK;
diff --git a/firmware_p4/components/Applications/bluetooth/ble_scanner.c b/firmware_p4/components/Applications/bluetooth/ble_scanner.c
index 495e0ee8..430394a1 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_scanner.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_scanner.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_scanner.h"
diff --git a/firmware_p4/components/Applications/bluetooth/ble_screen_server.c b/firmware_p4/components/Applications/bluetooth/ble_screen_server.c
index 60d5553f..f25889b1 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_screen_server.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_screen_server.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_screen_server.h"
diff --git a/firmware_p4/components/Applications/bluetooth/ble_sniffer.c b/firmware_p4/components/Applications/bluetooth/ble_sniffer.c
index 9f0793c5..a80a556c 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_sniffer.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_sniffer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_sniffer.h"
diff --git a/firmware_p4/components/Applications/bluetooth/ble_tracker.c b/firmware_p4/components/Applications/bluetooth/ble_tracker.c
index 551e9135..8ae50133 100644
--- a/firmware_p4/components/Applications/bluetooth/ble_tracker.c
+++ b/firmware_p4/components/Applications/bluetooth/ble_tracker.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ble_tracker.h"
diff --git a/firmware_p4/components/Applications/bluetooth/canned_spam.c b/firmware_p4/components/Applications/bluetooth/canned_spam.c
index 5287a7af..111c2895 100644
--- a/firmware_p4/components/Applications/bluetooth/canned_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/canned_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
// BLE Spam Indices:
// 0: AppleJuice (Airpods, Beats, etc)
@@ -29,12 +30,10 @@
#include "bluetooth_service.h"
#include "spi_bridge.h"
#include "spi_protocol.h"
+#include "spi_session.h"
static const char *TAG = "CANNED_SPAM";
-#define SPAM_SPI_START_TIMEOUT 5000
-#define SPAM_SPI_STOP_TIMEOUT 2000
-
typedef enum {
CANNED_SPAM_CAT_APPLE_JUICE = 0,
CANNED_SPAM_CAT_SOUR_APPLE,
@@ -50,6 +49,7 @@ static const canned_spam_type_t CATEGORY_INFO[] = {
static bool s_is_running = false;
static int s_current_category = -1;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
int spam_get_attack_count(void) {
return CANNED_SPAM_CAT_COUNT;
@@ -77,13 +77,8 @@ esp_err_t spam_start(int attack_index) {
}
uint8_t payload = (uint8_t)attack_index;
- spi_header_t resp_hdr;
- uint8_t resp_buf[SPI_MAX_PAYLOAD];
-
- esp_err_t ret = spi_bridge_send_command(
- SPI_ID_BT_APP_SPAM, &payload, sizeof(payload), &resp_hdr, resp_buf, SPAM_SPI_START_TIMEOUT);
-
- if (ret != ESP_OK || resp_buf[0] != SPI_STATUS_OK) {
+ s_session_id = spi_session_start(SPI_ID_BT_APP_SPAM, &payload, sizeof(payload), NULL, NULL);
+ if (s_session_id == SPI_SESSION_INVALID_ID) {
ESP_LOGE(TAG, "Failed to start spam on C5");
return ESP_FAIL;
}
@@ -100,16 +95,10 @@ esp_err_t spam_stop(void) {
return ESP_ERR_INVALID_STATE;
}
- spi_header_t resp_hdr;
- uint8_t resp_buf[SPI_MAX_PAYLOAD];
-
- esp_err_t ret = spi_bridge_send_command(
- SPI_ID_BT_APP_STOP, NULL, 0, &resp_hdr, resp_buf, SPAM_SPI_STOP_TIMEOUT);
-
- if (ret != ESP_OK || resp_buf[0] != SPI_STATUS_OK) {
- ESP_LOGW(TAG, "Failed to stop spam on C5");
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
}
-
s_is_running = false;
ESP_LOGI(TAG, "Spam stopped");
return ESP_OK;
diff --git a/firmware_p4/components/Applications/bluetooth/exposure_notification.c b/firmware_p4/components/Applications/bluetooth/exposure_notification.c
index 05c0f039..d6eb5276 100644
--- a/firmware_p4/components/Applications/bluetooth/exposure_notification.c
+++ b/firmware_p4/components/Applications/bluetooth/exposure_notification.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "exposure_notification.h"
diff --git a/firmware_p4/components/Applications/bluetooth/gatt_explorer.c b/firmware_p4/components/Applications/bluetooth/gatt_explorer.c
index 227834fe..f1a6158d 100644
--- a/firmware_p4/components/Applications/bluetooth/gatt_explorer.c
+++ b/firmware_p4/components/Applications/bluetooth/gatt_explorer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "gatt_explorer.h"
diff --git a/firmware_p4/components/Applications/bluetooth/include/android_spam.h b/firmware_p4/components/Applications/bluetooth/include/android_spam.h
index f2d3094d..476f04f7 100644
--- a/firmware_p4/components/Applications/bluetooth/include/android_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/android_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ANDROID_SPAM_H
#define ANDROID_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/apple_juice_spam.h b/firmware_p4/components/Applications/bluetooth/include/apple_juice_spam.h
index 6369d585..c7560239 100644
--- a/firmware_p4/components/Applications/bluetooth/include/apple_juice_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/apple_juice_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef APPLE_JUICE_SPAM_H
#define APPLE_JUICE_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_connect_flood.h b/firmware_p4/components/Applications/bluetooth/include/ble_connect_flood.h
index b0a53001..3a45f851 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_connect_flood.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_connect_flood.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_CONNECT_FLOOD_H
#define BLE_CONNECT_FLOOD_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_hid_keyboard.h b/firmware_p4/components/Applications/bluetooth/include/ble_hid_keyboard.h
index 891e48fa..5af89ea8 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_hid_keyboard.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_hid_keyboard.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_HID_KEYBOARD_H
#define BLE_HID_KEYBOARD_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_l2cap_flood.h b/firmware_p4/components/Applications/bluetooth/include/ble_l2cap_flood.h
index d5067eb9..1622a8ee 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_l2cap_flood.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_l2cap_flood.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_L2CAP_FLOOD_H
#define BLE_L2CAP_FLOOD_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_scanner.h b/firmware_p4/components/Applications/bluetooth/include/ble_scanner.h
index 072cf3a0..d8fa356e 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_scanner.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_scanner.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_SCANNER_H
#define BLE_SCANNER_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_screen_server.h b/firmware_p4/components/Applications/bluetooth/include/ble_screen_server.h
index 16ae099b..14549470 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_screen_server.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_screen_server.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_SCREEN_SERVER_H
#define BLE_SCREEN_SERVER_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_sniffer.h b/firmware_p4/components/Applications/bluetooth/include/ble_sniffer.h
index 07dba6be..3fcb5ed5 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_sniffer.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_sniffer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_SNIFFER_H
#define BLE_SNIFFER_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/ble_tracker.h b/firmware_p4/components/Applications/bluetooth/include/ble_tracker.h
index 3b07213b..823d4d2b 100644
--- a/firmware_p4/components/Applications/bluetooth/include/ble_tracker.h
+++ b/firmware_p4/components/Applications/bluetooth/include/ble_tracker.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLE_TRACKER_H
#define BLE_TRACKER_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/canned_spam.h b/firmware_p4/components/Applications/bluetooth/include/canned_spam.h
index f4236263..41d00372 100644
--- a/firmware_p4/components/Applications/bluetooth/include/canned_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/canned_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef CANNED_SPAM_H
#define CANNED_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/exposure_notification.h b/firmware_p4/components/Applications/bluetooth/include/exposure_notification.h
index badfa070..2bc811b7 100644
--- a/firmware_p4/components/Applications/bluetooth/include/exposure_notification.h
+++ b/firmware_p4/components/Applications/bluetooth/include/exposure_notification.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef EXPOSURE_NOTIFICATION_H
#define EXPOSURE_NOTIFICATION_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/gatt_explorer.h b/firmware_p4/components/Applications/bluetooth/include/gatt_explorer.h
index f45af2c8..65952f39 100644
--- a/firmware_p4/components/Applications/bluetooth/include/gatt_explorer.h
+++ b/firmware_p4/components/Applications/bluetooth/include/gatt_explorer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef GATT_EXPLORER_H
#define GATT_EXPLORER_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/oui_lookup.h b/firmware_p4/components/Applications/bluetooth/include/oui_lookup.h
index 34c9ab08..005d8aa1 100644
--- a/firmware_p4/components/Applications/bluetooth/include/oui_lookup.h
+++ b/firmware_p4/components/Applications/bluetooth/include/oui_lookup.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef OUI_LOOKUP_H
#define OUI_LOOKUP_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/samsung_spam.h b/firmware_p4/components/Applications/bluetooth/include/samsung_spam.h
index 3219d247..f1179b47 100644
--- a/firmware_p4/components/Applications/bluetooth/include/samsung_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/samsung_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SAMSUNG_SPAM_H
#define SAMSUNG_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/skimmer_detector.h b/firmware_p4/components/Applications/bluetooth/include/skimmer_detector.h
index 11dba3fd..5317a055 100644
--- a/firmware_p4/components/Applications/bluetooth/include/skimmer_detector.h
+++ b/firmware_p4/components/Applications/bluetooth/include/skimmer_detector.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SKIMMER_DETECTOR_H
#define SKIMMER_DETECTOR_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/sour_apple_spam.h b/firmware_p4/components/Applications/bluetooth/include/sour_apple_spam.h
index 102c774c..4373e9e4 100644
--- a/firmware_p4/components/Applications/bluetooth/include/sour_apple_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/sour_apple_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SOUR_APPLE_SPAM_H
#define SOUR_APPLE_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/swift_pair_spam.h b/firmware_p4/components/Applications/bluetooth/include/swift_pair_spam.h
index 032eeffc..63167f5f 100644
--- a/firmware_p4/components/Applications/bluetooth/include/swift_pair_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/swift_pair_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SWIFT_PAIR_SPAM_H
#define SWIFT_PAIR_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/tracker_detector.h b/firmware_p4/components/Applications/bluetooth/include/tracker_detector.h
index 728a3b5e..e4e4b463 100644
--- a/firmware_p4/components/Applications/bluetooth/include/tracker_detector.h
+++ b/firmware_p4/components/Applications/bluetooth/include/tracker_detector.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TRACKER_DETECTOR_H
#define TRACKER_DETECTOR_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/tutti_frutti_spam.h b/firmware_p4/components/Applications/bluetooth/include/tutti_frutti_spam.h
index a7d3135d..24ce284d 100644
--- a/firmware_p4/components/Applications/bluetooth/include/tutti_frutti_spam.h
+++ b/firmware_p4/components/Applications/bluetooth/include/tutti_frutti_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TUTTI_FRUTTI_SPAM_H
#define TUTTI_FRUTTI_SPAM_H
diff --git a/firmware_p4/components/Applications/bluetooth/include/uuid_lookup.h b/firmware_p4/components/Applications/bluetooth/include/uuid_lookup.h
index 5e273fa0..1a3ccf02 100644
--- a/firmware_p4/components/Applications/bluetooth/include/uuid_lookup.h
+++ b/firmware_p4/components/Applications/bluetooth/include/uuid_lookup.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UUID_LOOKUP_H
#define UUID_LOOKUP_H
diff --git a/firmware_p4/components/Applications/bluetooth/oui_lookup.c b/firmware_p4/components/Applications/bluetooth/oui_lookup.c
index 64daa374..06453692 100644
--- a/firmware_p4/components/Applications/bluetooth/oui_lookup.c
+++ b/firmware_p4/components/Applications/bluetooth/oui_lookup.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "oui_lookup.h"
diff --git a/firmware_p4/components/Applications/bluetooth/samsung_spam.c b/firmware_p4/components/Applications/bluetooth/samsung_spam.c
index 1bcf8767..cdc5a801 100644
--- a/firmware_p4/components/Applications/bluetooth/samsung_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/samsung_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "samsung_spam.h"
diff --git a/firmware_p4/components/Applications/bluetooth/skimmer_detector.c b/firmware_p4/components/Applications/bluetooth/skimmer_detector.c
index 8a2b7bd7..31e84968 100644
--- a/firmware_p4/components/Applications/bluetooth/skimmer_detector.c
+++ b/firmware_p4/components/Applications/bluetooth/skimmer_detector.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "skimmer_detector.h"
@@ -20,27 +21,31 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "SKIMMER_DETECTOR";
-#define SPI_TIMEOUT_MS 2000
#define SPI_DATA_TIMEOUT_MS 1000
static skimmer_detector_record_t *s_cached_results = NULL;
static uint16_t s_cached_count = 0;
static uint16_t s_cached_capacity = 0;
static skimmer_detector_record_t s_empty_record;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
bool skimmer_detector_start(void) {
ESP_LOGI(TAG, "Skimmer detector started");
skimmer_detector_clear_results();
- return (spi_bridge_send_command(SPI_ID_BT_APP_SKIMMER, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS) ==
- ESP_OK);
+ s_session_id = spi_session_start(SPI_ID_BT_APP_SKIMMER, NULL, 0, NULL, NULL);
+ return s_session_id != SPI_SESSION_INVALID_ID;
}
void skimmer_detector_stop(void) {
ESP_LOGI(TAG, "Skimmer detector stopped");
- spi_bridge_send_command(SPI_ID_BT_APP_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
skimmer_detector_clear_results();
}
diff --git a/firmware_p4/components/Applications/bluetooth/sour_apple_spam.c b/firmware_p4/components/Applications/bluetooth/sour_apple_spam.c
index 0dbc0011..29632510 100644
--- a/firmware_p4/components/Applications/bluetooth/sour_apple_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/sour_apple_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sour_apple_spam.h"
diff --git a/firmware_p4/components/Applications/bluetooth/swift_pair_spam.c b/firmware_p4/components/Applications/bluetooth/swift_pair_spam.c
index 85c13f7f..4c0c6d04 100644
--- a/firmware_p4/components/Applications/bluetooth/swift_pair_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/swift_pair_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "swift_pair_spam.h"
diff --git a/firmware_p4/components/Applications/bluetooth/tracker_detector.c b/firmware_p4/components/Applications/bluetooth/tracker_detector.c
index d4a0e726..720fa59a 100644
--- a/firmware_p4/components/Applications/bluetooth/tracker_detector.c
+++ b/firmware_p4/components/Applications/bluetooth/tracker_detector.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tracker_detector.h"
@@ -20,27 +21,31 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "TRACKER_DETECTOR";
-#define SPI_TIMEOUT_MS 2000
#define SPI_DATA_TIMEOUT_MS 1000
static tracker_detector_record_t *s_cached_results = NULL;
static uint16_t s_cached_count = 0;
static uint16_t s_cached_capacity = 0;
static tracker_detector_record_t s_empty_record;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
bool tracker_detector_start(void) {
ESP_LOGI(TAG, "Tracker detector started");
tracker_detector_clear_results();
- return (spi_bridge_send_command(SPI_ID_BT_APP_TRACKER, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS) ==
- ESP_OK);
+ s_session_id = spi_session_start(SPI_ID_BT_APP_TRACKER, NULL, 0, NULL, NULL);
+ return s_session_id != SPI_SESSION_INVALID_ID;
}
void tracker_detector_stop(void) {
ESP_LOGI(TAG, "Tracker detector stopped");
- spi_bridge_send_command(SPI_ID_BT_APP_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
tracker_detector_clear_results();
}
diff --git a/firmware_p4/components/Applications/bluetooth/tutti_frutti_spam.c b/firmware_p4/components/Applications/bluetooth/tutti_frutti_spam.c
index 64199c02..a93ee828 100644
--- a/firmware_p4/components/Applications/bluetooth/tutti_frutti_spam.c
+++ b/firmware_p4/components/Applications/bluetooth/tutti_frutti_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tutti_frutti_spam.h"
diff --git a/firmware_p4/components/Applications/bluetooth/uuid_lookup.c b/firmware_p4/components/Applications/bluetooth/uuid_lookup.c
index 9cbae81c..f10068b4 100644
--- a/firmware_p4/components/Applications/bluetooth/uuid_lookup.c
+++ b/firmware_p4/components/Applications/bluetooth/uuid_lookup.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "uuid_lookup.h"
diff --git a/firmware_p4/components/Applications/nfc/emu_diag.c b/firmware_p4/components/Applications/nfc/emu_diag.c
index 134344fb..6b5ce381 100644
--- a/firmware_p4/components/Applications/nfc/emu_diag.c
+++ b/firmware_p4/components/Applications/nfc/emu_diag.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "emu_diag.h"
#include
diff --git a/firmware_p4/components/Applications/nfc/include/emu_diag.h b/firmware_p4/components/Applications/nfc/include/emu_diag.h
index 932eeb9e..47626d33 100644
--- a/firmware_p4/components/Applications/nfc/include/emu_diag.h
+++ b/firmware_p4/components/Applications/nfc/include/emu_diag.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef EMU_DIAG_H
#define EMU_DIAG_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_card_info.h b/firmware_p4/components/Applications/nfc/include/nfc_card_info.h
index 9ab6e514..350b5353 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_card_info.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_card_info.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_CARD_INFO_H
#define NFC_CARD_INFO_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_debug.h b/firmware_p4/components/Applications/nfc/include/nfc_debug.h
index 86e82f68..7d1ad4cf 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_debug.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_debug.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_DEBUG_H
#define NFC_DEBUG_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_device.h b/firmware_p4/components/Applications/nfc/include/nfc_device.h
index d661d909..ac47a1db 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_device.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_device.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_DEVICE_H
#define NFC_DEVICE_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_listener.h b/firmware_p4/components/Applications/nfc/include/nfc_listener.h
index 56daf8c4..a7421db0 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_listener.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_listener.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_LISTENER_H
#define NFC_LISTENER_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_manager.h b/firmware_p4/components/Applications/nfc/include/nfc_manager.h
index eacc3c18..2b526d1f 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_manager.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_manager.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_MANAGER_H
#define NFC_MANAGER_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_reader.h b/firmware_p4/components/Applications/nfc/include/nfc_reader.h
index 9d90cc6b..fa279b3c 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_reader.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_reader.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_READER_H
#define NFC_READER_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_scanner.h b/firmware_p4/components/Applications/nfc/include/nfc_scanner.h
index 992f1e38..69157fb4 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_scanner.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_scanner.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_SCANNER_H
#define NFC_SCANNER_H
diff --git a/firmware_p4/components/Applications/nfc/include/nfc_store.h b/firmware_p4/components/Applications/nfc/include/nfc_store.h
index 17ca88ee..368f07dc 100644
--- a/firmware_p4/components/Applications/nfc/include/nfc_store.h
+++ b/firmware_p4/components/Applications/nfc/include/nfc_store.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_STORE_H
#define NFC_STORE_H
diff --git a/firmware_p4/components/Applications/nfc/nfc_card_info.c b/firmware_p4/components/Applications/nfc/nfc_card_info.c
index d04cfa20..26e93201 100644
--- a/firmware_p4/components/Applications/nfc/nfc_card_info.c
+++ b/firmware_p4/components/Applications/nfc/nfc_card_info.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_card_info.h"
#include
diff --git a/firmware_p4/components/Applications/nfc/nfc_debug.c b/firmware_p4/components/Applications/nfc/nfc_debug.c
index 69e80b56..52ce11db 100644
--- a/firmware_p4/components/Applications/nfc/nfc_debug.c
+++ b/firmware_p4/components/Applications/nfc/nfc_debug.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_debug.h"
#include "hb_nfc_spi.h"
diff --git a/firmware_p4/components/Applications/nfc/nfc_device.c b/firmware_p4/components/Applications/nfc/nfc_device.c
index a6c476d2..a425b3d9 100644
--- a/firmware_p4/components/Applications/nfc/nfc_device.c
+++ b/firmware_p4/components/Applications/nfc/nfc_device.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_device.h"
diff --git a/firmware_p4/components/Applications/nfc/nfc_listener.c b/firmware_p4/components/Applications/nfc/nfc_listener.c
index e854f9e1..7dd53cc1 100644
--- a/firmware_p4/components/Applications/nfc/nfc_listener.c
+++ b/firmware_p4/components/Applications/nfc/nfc_listener.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_listener.h"
#include
diff --git a/firmware_p4/components/Applications/nfc/nfc_manager.c b/firmware_p4/components/Applications/nfc/nfc_manager.c
index 50a006a0..5ace89d4 100644
--- a/firmware_p4/components/Applications/nfc/nfc_manager.c
+++ b/firmware_p4/components/Applications/nfc/nfc_manager.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_manager.h"
diff --git a/firmware_p4/components/Applications/nfc/nfc_reader.c b/firmware_p4/components/Applications/nfc/nfc_reader.c
index 69ae7d3c..f09963a2 100644
--- a/firmware_p4/components/Applications/nfc/nfc_reader.c
+++ b/firmware_p4/components/Applications/nfc/nfc_reader.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_reader.h"
#include
@@ -29,6 +30,9 @@
#include "mf_plus.h"
#include "mf_ultralight.h"
#include "nfc_card_info.h"
+#include "nfc_dict_loader.h"
+#include "tos_flash_paths.h"
+#include "tos_storage_paths.h"
#include "nfc_common.h"
#include "nfc_store.h"
#include "poller.h"
@@ -464,39 +468,9 @@ void mf_classic_read_full(nfc_iso14443a_data_t *card) {
}
if (!res->key_a_found) {
- if (known && known->hint_keys) {
- for (int k = 0; k < known->hint_key_count && !res->key_a_found; k++) {
- if (try_key_bytes(card, (uint8_t)res->first_block, MF_KEY_A, known->hint_keys[k])) {
- res->key_a_found = true;
- res->key_a_dict_idx = 0;
- memcpy(res->key_a, known->hint_keys[k], 6);
- keys_a_found++;
- memcpy(s_emu_card.keys[sect].key_a, known->hint_keys[k], 6);
- s_emu_card.keys[sect].key_a_known = true;
- prng_record_nonce(sect, mf_classic_get_last_nt());
- mf_key_cache_store(&(mf_key_cache_store_params_t){.uid = card->uid,
- .uid_len = card->uid_len,
- .sector = sect,
- .sector_count = nsect,
- .type = MF_KEY_A,
- .key = known->hint_keys[k]});
- }
- }
- }
for (int k = 0; k < dict_count && !res->key_a_found; k++) {
uint8_t key_bytes[6];
mf_key_dict_get(k, key_bytes);
- if (known && known->hint_keys) {
- bool already = false;
- for (int h = 0; h < known->hint_key_count; h++) {
- if (memcmp(key_bytes, known->hint_keys[h], 6) == 0) {
- already = true;
- break;
- }
- }
- if (already)
- continue;
- }
if (try_key_bytes(card, (uint8_t)res->first_block, MF_KEY_A, key_bytes)) {
res->key_a_found = true;
res->key_a_dict_idx = k;
@@ -592,27 +566,9 @@ void mf_classic_read_full(nfc_iso14443a_data_t *card) {
} \
} while (0)
- if (known && known->hint_keys) {
- for (int k = 0; k < known->hint_key_count && !res->key_b_found; k++) {
- if (try_key_bytes(card, (uint8_t)res->first_block, MF_KEY_B, known->hint_keys[k])) {
- FOUND_KEY_B(known->hint_keys[k]);
- }
- }
- }
for (int k = 0; k < dict_count && !res->key_b_found; k++) {
uint8_t key_bytes[6];
mf_key_dict_get(k, key_bytes);
- if (known && known->hint_keys) {
- bool already = false;
- for (int h = 0; h < known->hint_key_count; h++) {
- if (memcmp(key_bytes, known->hint_keys[h], 6) == 0) {
- already = true;
- break;
- }
- }
- if (already)
- continue;
- }
if (try_key_bytes(card, (uint8_t)res->first_block, MF_KEY_B, key_bytes)) {
FOUND_KEY_B(key_bytes);
}
@@ -1011,12 +967,29 @@ void mfp_probe_and_dump(nfc_iso14443a_data_t *card) {
#endif
#if MF_ULC_TRY_DEFAULT_KEY
-#ifndef MF_ULC_DEFAULT_KEY
-#define MF_ULC_DEFAULT_KEY \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-#endif
+#define MF_ULC_DICT_MAX_KEYS 8
+#define MF_ULC_KEY_SIZE 16
+
+static uint8_t s_mf_ulc_keys[MF_ULC_DICT_MAX_KEYS][MF_ULC_KEY_SIZE];
+static size_t s_mf_ulc_key_count = 0;
+static bool s_is_mf_ulc_loaded = false;
-static const uint8_t k_mf_ulc_default_key[16] = {MF_ULC_DEFAULT_KEY};
+static void load_mf_ulc_keys(void) {
+ if (s_is_mf_ulc_loaded) {
+ return;
+ }
+ s_is_mf_ulc_loaded = true;
+
+ const nfc_dict_load_params_t load = {
+ .sd_path = TOS_PATH_NFC_DICT "/mf_ulc_default.dic",
+ .flash_path = FLASH_NFC_DICT "/mf_ulc_default.dic",
+ .key_size = MF_ULC_KEY_SIZE,
+ .max_keys = MF_ULC_DICT_MAX_KEYS,
+ };
+ if (nfc_dict_load_file(&load, (uint8_t *)s_mf_ulc_keys, &s_mf_ulc_key_count) != ESP_OK) {
+ s_mf_ulc_key_count = 0;
+ }
+}
#endif
void mful_dump_card(nfc_iso14443a_data_t *card) {
@@ -1097,11 +1070,15 @@ void mful_dump_card(nfc_iso14443a_data_t *card) {
if (vlen < 7) {
#if MF_ULC_TRY_DEFAULT_KEY
- hb_nfc_err_t aerr = mful_ulc_auth(k_mf_ulc_default_key);
- if (aerr == HB_NFC_OK) {
- tag_type = "Ultralight C (3DES auth)";
- total_pages = 48;
- ESP_LOGI(TAG, "ULC auth OK (default key)");
+ load_mf_ulc_keys();
+ for (size_t ki = 0; ki < s_mf_ulc_key_count; ki++) {
+ hb_nfc_err_t aerr = mful_ulc_auth(s_mf_ulc_keys[ki]);
+ if (aerr == HB_NFC_OK) {
+ tag_type = "Ultralight C (3DES auth)";
+ total_pages = 48;
+ ESP_LOGI(TAG, "ULC auth OK (key %u from dict)", (unsigned)ki);
+ break;
+ }
}
#endif
}
diff --git a/firmware_p4/components/Applications/nfc/nfc_scanner.c b/firmware_p4/components/Applications/nfc/nfc_scanner.c
index 02a164f3..a0eb3a47 100644
--- a/firmware_p4/components/Applications/nfc/nfc_scanner.c
+++ b/firmware_p4/components/Applications/nfc/nfc_scanner.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_scanner.h"
#include
diff --git a/firmware_p4/components/Applications/nfc/nfc_store.c b/firmware_p4/components/Applications/nfc/nfc_store.c
index c62a8dd3..cef7ec60 100644
--- a/firmware_p4/components/Applications/nfc/nfc_store.c
+++ b/firmware_p4/components/Applications/nfc/nfc_store.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_store.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_apdu.h b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_apdu.h
index 5084ec8e..0b8c3968 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_apdu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_apdu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_apdu.h
* @brief ISO/IEC 7816-4 APDU helpers over ISO14443-4 (T=CL).
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_common.h b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_common.h
index 0f24c0db..e05453fb 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_common.h
+++ b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_common.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_common.h
* @brief Common utilities for the NFC stack.
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_crypto.h b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_crypto.h
index f4af6051..a76134f4 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_crypto.h
+++ b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_crypto.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_crypto.h
* @brief Common crypto helpers for NFC phases (CMAC, KDF, diversification).
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_rf.h b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_rf.h
index 57893e69..d42162ff 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_rf.h
+++ b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_rf.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_rf.h
* @brief RF layer configuration (Phase 2): bitrate, modulation, parity, timing.
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tag.h b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tag.h
index 2d378a0b..76dcc4e6 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tag.h
+++ b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tag.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_tag.h
* @brief NFC Forum Tag Type handlers (Phase 7).
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tcl.h b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tcl.h
index 4e1dcfa2..cfd8adcf 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tcl.h
+++ b/firmware_p4/components/Applications/nfc/protocols/common/include/nfc_tcl.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_TCL_H
#define NFC_TCL_H
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/nfc_apdu.c b/firmware_p4/components/Applications/nfc/protocols/common/nfc_apdu.c
index ba9e85cf..b560e454 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/nfc_apdu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/common/nfc_apdu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_apdu.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/nfc_crypto.c b/firmware_p4/components/Applications/nfc/protocols/common/nfc_crypto.c
index c6637afe..bff65528 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/nfc_crypto.c
+++ b/firmware_p4/components/Applications/nfc/protocols/common/nfc_crypto.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_crypto.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/nfc_rf.c b/firmware_p4/components/Applications/nfc/protocols/common/nfc_rf.c
index 2aa0f05d..f92f49fd 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/nfc_rf.c
+++ b/firmware_p4/components/Applications/nfc/protocols/common/nfc_rf.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_rf.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/nfc_tag.c b/firmware_p4/components/Applications/nfc/protocols/common/nfc_tag.c
index 63135d76..1b5a7fcc 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/nfc_tag.c
+++ b/firmware_p4/components/Applications/nfc/protocols/common/nfc_tag.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_tag.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/common/nfc_tcl.c b/firmware_p4/components/Applications/nfc/protocols/common/nfc_tcl.c
index 087ce5d1..b48e2f02 100644
--- a/firmware_p4/components/Applications/nfc/protocols/common/nfc_tcl.c
+++ b/firmware_p4/components/Applications/nfc/protocols/common/nfc_tcl.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_tcl.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/emv/emv.c b/firmware_p4/components/Applications/nfc/protocols/emv/emv.c
index 6fb4cbc4..52aba6b2 100644
--- a/firmware_p4/components/Applications/nfc/protocols/emv/emv.c
+++ b/firmware_p4/components/Applications/nfc/protocols/emv/emv.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "emv.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/emv/include/emv.h b/firmware_p4/components/Applications/nfc/protocols/emv/include/emv.h
index 1fe324d5..c7cb1662 100644
--- a/firmware_p4/components/Applications/nfc/protocols/emv/include/emv.h
+++ b/firmware_p4/components/Applications/nfc/protocols/emv/include/emv.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file emv.h
* @brief EMV contactless helpers (PPSE, AID select, GPO, READ RECORD).
diff --git a/firmware_p4/components/Applications/nfc/protocols/felica/felica.c b/firmware_p4/components/Applications/nfc/protocols/felica/felica.c
index f321ccbb..b9e165f0 100644
--- a/firmware_p4/components/Applications/nfc/protocols/felica/felica.c
+++ b/firmware_p4/components/Applications/nfc/protocols/felica/felica.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "felica.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/felica/felica_emu.c b/firmware_p4/components/Applications/nfc/protocols/felica/felica_emu.c
index c7fe723f..25fbebbd 100644
--- a/firmware_p4/components/Applications/nfc/protocols/felica/felica_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/felica/felica_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "felica_emu.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/felica/include/felica.h b/firmware_p4/components/Applications/nfc/protocols/felica/include/felica.h
index 3e05d288..dadee279 100644
--- a/firmware_p4/components/Applications/nfc/protocols/felica/include/felica.h
+++ b/firmware_p4/components/Applications/nfc/protocols/felica/include/felica.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file felica.h
* @brief FeliCa (NFC-F / ISO 18092) reader/writer for ST25R3916.
diff --git a/firmware_p4/components/Applications/nfc/protocols/felica/include/felica_emu.h b/firmware_p4/components/Applications/nfc/protocols/felica/include/felica_emu.h
index e4a830fd..30411be8 100644
--- a/firmware_p4/components/Applications/nfc/protocols/felica/include/felica_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/felica/include/felica_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file felica_emu.h
* @brief FeliCa (NFC-F) tag emulation for ST25R3916.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso14443a.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso14443a.h
index 89a06c97..611f68a0 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso14443a.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso14443a.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso14443a.h
* @brief ISO14443A types and CRC_A.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso_dep.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso_dep.h
index 54f2f014..676ce73b 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso_dep.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/iso_dep.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso_dep.h
* @brief ISO-DEP (ISO14443-4) RATS, I-Block, chaining (Phase 6).
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/ndef.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/ndef.h
index 9385089f..97fd4d49 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/ndef.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/ndef.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file ndef.h
* @brief NDEF parser/builder helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/nfc_poller.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/nfc_poller.h
index a3462fd3..1264a5a5 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/nfc_poller.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/nfc_poller.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_poller.h
* @brief NFC Poller field control + transceive engine.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/poller.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/poller.h
index 874da560..b183f4d2 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/poller.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/poller.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file poller.h
* @brief ISO14443A Poller REQA/WUPA, anti-collision, SELECT.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t.h
index 25ade13b..836bbdd0 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t4t.h
* @brief ISO14443-4 / Type 4 Tag (T4T) NDEF reader helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t_emu.h b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t_emu.h
index 336ccf63..5c62e44f 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/include/t4t_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t4t_emu.h
* @brief ISO14443-4 / T4T emulation (ISO-DEP target).
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso14443a.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso14443a.c
index a800b46a..ebde76e2 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso14443a.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso14443a.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso14443a.c
* @brief ISO14443A CRC_A calculation.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso_dep.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso_dep.c
index 7cc38b46..1cd6b927 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso_dep.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/iso_dep.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso_dep.c
* @brief ISO-DEP - basic RATS + I-Block exchange with chaining/WTX (best effort).
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/ndef.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/ndef.c
index a7caa6ab..671792d1 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/ndef.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/ndef.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file ndef.c
* @brief NDEF record parser, builder, and TLV helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/nfc_poller.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/nfc_poller.c
index b056a4ca..6135da14 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/nfc_poller.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/nfc_poller.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file nfc_poller.c
* @brief NFC poller transceive engine.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/poller.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/poller.c
index 2a7e037b..5c6f486c 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/poller.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/poller.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file poller.c
* @brief ISO14443A poller helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t.c
index c12781b7..794d1531 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t4t.c
* @brief ISO7816-4 Type 4 Tag (T4T) NDEF read/write over ISO-DEP.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t_emu.c b/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t_emu.c
index d98ddbde..cfc36152 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443a/t4t_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t4t_emu.c
* @brief ISO14443A Type 4 Tag emulation over ST25R3916 passive target mode.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b.h b/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b.h
index b04d729b..75b76138 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso14443b.h
* @brief ISO 14443B (NFC-B) poller basics for ST25R3916.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b_emu.h b/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b_emu.h
index 3ce12b34..def6846e 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443b/include/iso14443b_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso14443b_emu.h
* @brief ISO14443B (NFC-B) target emulation with basic ISO-DEP/T4T APDUs.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b.c b/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b.c
index 54c8657b..19b40050 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso14443b.c
* @brief ISO 14443-B poller: REQB/ATTRIB, T=CL transceive, and T4T-B NDEF read.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b_emu.c b/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b_emu.c
index 18a730cd..0c8fcb4e 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso14443b/iso14443b_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso14443b_emu.c
* @brief ISO 14443-B passive target emulator: T4T-B NDEF and DESFire delegation.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693.h b/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693.h
index 351f9354..ccf1112b 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso15693.h
* @brief ISO 15693 (NFC-V) reader/writer for ST25R3916.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693_emu.h b/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693_emu.h
index a0e17669..651a4cc6 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/iso15693/include/iso15693_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso15693_emu.h
* @brief ISO 15693 (NFC-V) tag emulation for ST25R3916.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693.c b/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693.c
index acc42446..7f1dd08e 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso15693.c
* @brief ISO 15693 (NFC-V) poller implementation.
diff --git a/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693_emu.c b/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693_emu.c
index 953400f5..073fff9a 100644
--- a/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/iso15693/iso15693_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file iso15693_emu.c
* @brief ISO 15693 (NFC-V) tag emulation over ST25R3916 passive target mode.
diff --git a/firmware_p4/components/Applications/nfc/protocols/llcp/include/llcp.h b/firmware_p4/components/Applications/nfc/protocols/llcp/include/llcp.h
index b3f5f844..32769b70 100644
--- a/firmware_p4/components/Applications/nfc/protocols/llcp/include/llcp.h
+++ b/firmware_p4/components/Applications/nfc/protocols/llcp/include/llcp.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file llcp.h
* @brief LLCP (Logical Link Control Protocol) over NFC-DEP.
diff --git a/firmware_p4/components/Applications/nfc/protocols/llcp/include/snep.h b/firmware_p4/components/Applications/nfc/protocols/llcp/include/snep.h
index f989d2ba..d40a988b 100644
--- a/firmware_p4/components/Applications/nfc/protocols/llcp/include/snep.h
+++ b/firmware_p4/components/Applications/nfc/protocols/llcp/include/snep.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file snep.h
* @brief SNEP (Simple NDEF Exchange Protocol) client helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/llcp/llcp.c b/firmware_p4/components/Applications/nfc/protocols/llcp/llcp.c
index a873be3d..b103190a 100644
--- a/firmware_p4/components/Applications/nfc/protocols/llcp/llcp.c
+++ b/firmware_p4/components/Applications/nfc/protocols/llcp/llcp.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file llcp.c
* @brief NFC-DEP / LLCP initiator: ATR exchange, DEP transceive, and PDU builders.
diff --git a/firmware_p4/components/Applications/nfc/protocols/llcp/snep.c b/firmware_p4/components/Applications/nfc/protocols/llcp/snep.c
index 42afd83b..5d836a25 100644
--- a/firmware_p4/components/Applications/nfc/protocols/llcp/snep.c
+++ b/firmware_p4/components/Applications/nfc/protocols/llcp/snep.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file snep.c
* @brief SNEP client: PUT and GET over LLCP/I-PDU.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/crypto1.c b/firmware_p4/components/Applications/nfc/protocols/mifare/crypto1.c
index 52ec39af..2abc23e5 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/crypto1.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/crypto1.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "crypto1.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/crypto1.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/crypto1.h
index ee445a61..cf0dde65 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/crypto1.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/crypto1.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file crypto1.h
* @brief Crypto1 cipher for MIFARE Classic.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic.h
index a6bb4b7a..7c9ca499 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_classic.h
* @brief MIFARE Classic auth, read, write sectors.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_emu.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_emu.h
index 0c8b1c4a..373e9ab8 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_classic_emu.h
* @brief MIFARE Classic card emulation.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_writer.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_writer.h
index e0a41b6c..f011f6ea 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_writer.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_classic_writer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_classic_writer.h
* @brief MIFARE Classic block write with Crypto1 authentication.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire.h
index bf1c3409..94f535c2 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_desfire.h
* @brief MIFARE DESFire native command interface.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire_emu.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire_emu.h
index 278f62d1..a99453d4 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_desfire_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_desfire_emu.h
* @brief Minimal MIFARE DESFire (native) APDU emulation helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_cache.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_cache.h
index cfd3aea9..ec803ae0 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_cache.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_cache.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_key_cache.h
* @brief Per-card MIFARE Classic key cache with NVS persistence.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_dict.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_dict.h
index 2a45e2cd..41e66495 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_dict.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_key_dict.h
@@ -1,19 +1,25 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_key_dict.h
- * @brief MIFARE Classic key dictionary (built-in + user-added keys).
+ * @brief MIFARE Classic key dictionary (loaded from .dic files on SD/flash).
+ *
+ * Default and family dictionaries ship on the firmware flash partition and
+ * are copied to the SD card on first boot. The user can edit them or add
+ * extra dictionaries. Keys discovered at runtime are appended to
+ * `mf_classic_user.dic` on the SD card.
*/
#ifndef MF_KEY_DICT_H
#define MF_KEY_DICT_H
@@ -27,19 +33,21 @@
extern "C" {
#endif
-/** @brief Maximum user-added keys stored in NVS (on top of built-in). */
-#define MF_KEY_DICT_MAX_EXTRA 128
-
-/** @brief Total built-in keys count (defined in .c). */
-extern const int MF_KEY_DICT_BUILTIN_COUNT;
+/** @brief Maximum number of keys held in the in-memory dictionary. */
+#define MF_KEY_DICT_MAX_KEYS 256
/**
- * @brief Initialize the key dictionary (load user keys from NVS).
+ * @brief Initialize the key dictionary (load default + user .dic files).
+ *
+ * Reads `mf_classic_default.dic` and `mf_classic_user.dic` from the NFC
+ * dictionary path on the SD card, falling back to the flash partition.
+ * Also migrates the legacy NVS namespace ("nfc_dict") into the user file
+ * the first time it runs after upgrade.
*/
void mf_key_dict_init(void);
/**
- * @brief Get total number of keys (built-in + user-added).
+ * @brief Get total number of keys currently loaded.
*
* @return Total key count.
*/
@@ -57,17 +65,20 @@ void mf_key_dict_get(int idx, uint8_t key_out[6]);
* @brief Check if a key exists in the dictionary.
*
* @param key 6-byte key to check.
- * @return true if the key is in the dictionary.
+ * @return true if the key is already in the dictionary.
*/
bool mf_key_dict_contains(const uint8_t key[6]);
/**
- * @brief Add a user key to the dictionary.
+ * @brief Add a key to the dictionary and persist it to mf_classic_user.dic.
+ *
+ * If the key is already present (built-in or user), this is a no-op and
+ * returns HB_NFC_OK.
*
* @param key 6-byte key to add.
* @return
- * - HB_NFC_OK on success
- * - Error code if dictionary is full or key already exists
+ * - HB_NFC_OK on success or duplicate
+ * - Error code if dictionary is full or persistence failed
*/
hb_nfc_err_t mf_key_dict_add(const uint8_t key[6]);
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_known_cards.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_known_cards.h
index 9b48c067..52ec0adc 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_known_cards.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_known_cards.h
@@ -1,23 +1,26 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_known_cards.h
- * @brief Known MIFARE Classic card type database.
+ * @brief Known MIFARE Classic card type database (name + identification only).
*
- * Matches a card by SAK + ATQA (and optionally UID prefix).
- * When a match is found, provides a human-readable name, hint string,
- * and priority key list to try before the full dictionary.
+ * Matches a card by SAK + ATQA (and optionally UID prefix) and returns a
+ * human-readable name plus a hint string. Key dictionaries are no longer
+ * tied to card profiles — the brute-force loop in the reader iterates
+ * @ref mf_key_dict, which already aggregates every mf_classic_*.dic file
+ * the user dropped in /sdcard/nfc/assets/dict/.
*/
#ifndef MF_KNOWN_CARDS_H
#define MF_KNOWN_CARDS_H
@@ -38,9 +41,7 @@ typedef struct {
uint8_t sak;
uint8_t atqa[2];
uint8_t uid_prefix[4];
- uint8_t uid_prefix_len; /**< @brief 0 = do not check UID prefix. */
- const uint8_t (*hint_keys)[6]; /**< @brief Priority keys, may be NULL. */
- int hint_key_count;
+ uint8_t uid_prefix_len; /**< @brief 0 = do not check UID prefix. */
} mf_known_card_t;
/**
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_nested.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_nested.h
index 35e98a68..6ad94b9d 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_nested.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_nested.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_nested.h
* @brief Nested authentication attack for MIFARE Classic.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_plus.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_plus.h
index 2d3fe60a..5b00ddc4 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_plus.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_plus.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_plus.h
* @brief MIFARE Plus SL3 auth and crypto helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_ultralight.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_ultralight.h
index 8b831b4e..e14bbdeb 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_ultralight.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mf_ultralight.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_ultralight.h
* @brief MIFARE Ultralight / NTAG READ, WRITE, PWD_AUTH, GET_VERSION.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mfkey.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mfkey.h
index fc14254e..31152724 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/include/mfkey.h
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/mfkey.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mfkey.h
* @brief MFKey key recovery attacks for MIFARE Classic.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/include/nfc_dict_loader.h b/firmware_p4/components/Applications/nfc/protocols/mifare/include/nfc_dict_loader.h
new file mode 100644
index 00000000..363e6df3
--- /dev/null
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/include/nfc_dict_loader.h
@@ -0,0 +1,119 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+/**
+ * @file nfc_dict_loader.h
+ * @brief Parser for .dic key dictionary files (hex per line, '#' comments).
+ *
+ * The .dic format is plain ASCII text. Each non-empty, non-comment line is
+ * a hex string representing a single key. Whitespace is ignored. Lines that
+ * do not match the requested key size are skipped (with a debug log).
+ */
+#ifndef NFC_DICT_LOADER_H
+#define NFC_DICT_LOADER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#include "esp_err.h"
+
+/**
+ * @brief Parameters for nfc_dict_load_file().
+ */
+typedef struct {
+ const char *sd_path; /**< @brief SD path. May be NULL to skip SD lookup. */
+ const char *flash_path; /**< @brief Flash partition fallback path. May be NULL. */
+ size_t key_size; /**< @brief Bytes per key (e.g. 6 or 16). */
+ size_t max_keys; /**< @brief Maximum keys to read. */
+} nfc_dict_load_params_t;
+
+/**
+ * @brief Parameters for nfc_dict_load_dir().
+ */
+typedef struct {
+ const char *dir; /**< @brief Directory to scan. */
+ const char *prefix; /**< @brief Filename prefix filter, NULL for any. */
+ size_t key_size; /**< @brief Bytes per key. */
+ size_t max_keys; /**< @brief Maximum keys to read across all files. */
+} nfc_dict_scan_params_t;
+
+/**
+ * @brief Load a .dic file into a contiguous key buffer.
+ *
+ * Tries @c params->sd_path first; if missing/empty, falls back to
+ * @c params->flash_path.
+ *
+ * @param params Source paths and sizing.
+ * @param[out] out_keys Buffer of capacity (key_size * max_keys) bytes.
+ * @param[out] out_count Number of keys actually loaded.
+ * @return
+ * - ESP_OK if at least one key was read
+ * - ESP_ERR_NOT_FOUND if both paths are missing/empty
+ * - ESP_ERR_INVALID_ARG on bad arguments
+ */
+esp_err_t
+nfc_dict_load_file(const nfc_dict_load_params_t *params, uint8_t *out_keys, size_t *out_count);
+
+/**
+ * @brief Scan a directory and load every .dic file matching the prefix.
+ *
+ * Files are read in directory-iteration order. Duplicates across files are
+ * skipped. Returns ESP_OK even if no keys were found, as long as the
+ * directory could be opened.
+ *
+ * @param params Scan parameters (dir, prefix, key_size, max_keys).
+ * @param[out] out_keys Buffer of capacity (key_size * max_keys) bytes.
+ * @param[out] out_count Number of unique keys loaded across all files.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_NOT_FOUND if the directory cannot be opened
+ * - ESP_ERR_INVALID_ARG on bad arguments
+ */
+esp_err_t
+nfc_dict_load_dir(const nfc_dict_scan_params_t *params, uint8_t *out_keys, size_t *out_count);
+
+/**
+ * @brief Check if @p key already exists in the contiguous buffer @p keys.
+ *
+ * @param keys Buffer of (count * key_size) bytes.
+ * @param count Number of keys in the buffer.
+ * @param key_size Bytes per key.
+ * @param key Candidate key.
+ * @return true if a byte-for-byte match exists.
+ */
+bool nfc_dict_contains(const uint8_t *keys, size_t count, size_t key_size, const uint8_t *key);
+
+/**
+ * @brief Append a key to a .dic file on the SD card (creating it if needed).
+ *
+ * Writes one uppercase hex line followed by '\n'. Does not check for
+ * duplicates — caller is expected to use @ref nfc_dict_contains first.
+ *
+ * @param sd_path Path on the SD card.
+ * @param key Key bytes.
+ * @param key_size Bytes per key.
+ * @return ESP_OK on success, ESP_FAIL on I/O error.
+ */
+esp_err_t nfc_dict_append_key(const char *sd_path, const uint8_t *key, size_t key_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // NFC_DICT_LOADER_H
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic.c
index 7f9d7e7b..aa74df8d 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_classic.c
* @brief MIFARE Classic authentication, read, and write operations.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_emu.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_emu.c
index 2bf518ea..0d438f11 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_classic_emu.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_writer.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_writer.c
index 40af7bf2..d6dbd206 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_writer.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_classic_writer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_classic_writer.c
* @brief MIFARE Classic write and access-bit helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire.c
index eb5fd455..17e33ef9 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_desfire.h"
#include
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire_emu.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire_emu.c
index f66fface..3d7c7a4c 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_desfire_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_desfire_emu.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_cache.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_cache.c
index e8467671..5ac526d2 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_cache.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_cache.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_key_cache.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_dict.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_dict.c
index bf87e2f8..acb886c4 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_dict.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_key_dict.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_key_dict.h"
@@ -18,183 +19,114 @@
#include "esp_log.h"
#include "nvs.h"
+#include "nvs_flash.h"
#include "highboy_nfc_error.h"
+#include "nfc_dict_loader.h"
+#include "tos_storage_paths.h"
static const char *TAG = "NFC_MF_KEY_DICT";
-#define MF_KEY_SIZE 6
-#define NVS_KEY_NAME_SIZE 16
-
-static const uint8_t s_builtin_keys[][MF_KEY_SIZE] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, {0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5},
- {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0}, {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
- {0x4D, 0x3A, 0x99, 0xC3, 0x51, 0xDD}, {0x1A, 0x98, 0x2C, 0x7E, 0x45, 0x9A},
- {0x71, 0x4C, 0x5C, 0x88, 0x6E, 0x97}, {0x58, 0x7E, 0xE5, 0xF9, 0x35, 0x0F},
- {0xA0, 0x47, 0x8C, 0xC3, 0x90, 0x91}, {0x53, 0x3C, 0xB6, 0xC7, 0x23, 0xF6},
- {0x8F, 0xD0, 0xA4, 0xF2, 0x56, 0xE9}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
- {0xC3, 0x4B, 0xF0, 0x36, 0x40, 0x15}, {0x9A, 0xB3, 0x45, 0x67, 0xAB, 0x34},
- {0x23, 0x40, 0x4E, 0x30, 0xD3, 0x4A}, {0x19, 0x74, 0x97, 0xC1, 0xC9, 0x31},
- {0xAC, 0xDD, 0xEB, 0xC3, 0x9C, 0x03}, {0xEA, 0x64, 0x67, 0x23, 0xA9, 0x00},
- {0x21, 0x4F, 0x17, 0x39, 0x5B, 0x10}, {0x11, 0x49, 0x7C, 0x33, 0xAF, 0xE2},
- {0x49, 0x46, 0x34, 0x34, 0x76, 0x41}, {0x31, 0x45, 0x56, 0x41, 0x4F, 0x3A},
- {0x1A, 0x2B, 0x3C, 0x4D, 0x5E, 0x6F}, {0xE9, 0x82, 0x4F, 0x4A, 0x2E, 0x4C},
- {0xD7, 0x93, 0xA7, 0x52, 0xA8, 0xB7}, {0x34, 0xEE, 0xF6, 0x14, 0xCE, 0x3A},
- {0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00}, {0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF},
- {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC}, {0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56},
- {0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}, {0xFA, 0xCE, 0xB0, 0x07, 0x13, 0x37},
- {0x4A, 0x6F, 0x68, 0x6E, 0x57, 0x69}, {0x6B, 0x65, 0x79, 0x31, 0x32, 0x33},
- {0x87, 0x3E, 0x1A, 0xCF, 0x5A, 0xA3}, {0xF3, 0x21, 0x72, 0xE9, 0x89, 0x2E},
- {0x40, 0xA8, 0xE0, 0x00, 0x00, 0x00}, {0xBE, 0x6A, 0x60, 0x14, 0x96, 0x3B},
- {0xD2, 0xBA, 0x54, 0x79, 0xE1, 0x28}, {0x8E, 0x51, 0x7E, 0x70, 0xF7, 0x58},
- {0x61, 0xDA, 0x06, 0xA0, 0x55, 0xDE}, {0x37, 0x06, 0x58, 0x7C, 0xD9, 0x36},
- {0x29, 0xD2, 0x41, 0x42, 0xDA, 0x17}, {0x57, 0x27, 0x29, 0xB2, 0x7E, 0x67},
- {0x52, 0x27, 0x57, 0xC1, 0xB2, 0xA1}, {0x83, 0x4B, 0x03, 0x27, 0xB6, 0xAF},
- {0x28, 0x7E, 0xC5, 0x65, 0xFF, 0x5C}, {0x1C, 0x0E, 0xB4, 0xC7, 0x38, 0xA3},
- {0x4E, 0xE4, 0x82, 0xC5, 0xF3, 0xC5}, {0x12, 0x21, 0xB4, 0x32, 0x11, 0xD4},
- {0x96, 0x31, 0x43, 0x04, 0x5A, 0x8C}, {0x1B, 0x75, 0x5D, 0x87, 0x61, 0xA0},
- {0x3B, 0x1C, 0x3B, 0x55, 0x34, 0x88}, {0x88, 0x44, 0x40, 0x13, 0x9C, 0x22},
- {0xA3, 0xDA, 0xCC, 0x68, 0x98, 0xA3}, {0x8D, 0xD4, 0x0D, 0x2A, 0x91, 0x57},
- {0x27, 0x05, 0x67, 0x3B, 0x77, 0x84}, {0x60, 0x90, 0x6C, 0x78, 0x68, 0x73},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x05}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x0A}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x0F},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x10}, {0x00, 0x00, 0x00, 0x00, 0x00, 0xFF},
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE}, {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD},
- {0xC3, 0x7A, 0xC4, 0x3D, 0xA1, 0x00}, {0x9C, 0x46, 0x14, 0x0A, 0xA6, 0xB2},
- {0x48, 0x62, 0xCF, 0x60, 0xED, 0x62}, {0x08, 0xB9, 0xE7, 0xB2, 0xA6, 0x6B},
- {0xF1, 0x22, 0xD7, 0x3B, 0x00, 0x48}, {0x14, 0x17, 0x37, 0x23, 0x02, 0x4A},
- {0x0C, 0xF1, 0x2A, 0x80, 0xF5, 0x4A}, {0xD3, 0xC4, 0xFE, 0x46, 0xA0, 0x3B},
- {0x36, 0x25, 0x95, 0x36, 0x98, 0xDA}, {0xB8, 0xD9, 0xA6, 0x0E, 0x27, 0x4A},
- {0x7E, 0x85, 0x45, 0xCD, 0x23, 0xE4},
-};
-
-const int MF_KEY_DICT_BUILTIN_COUNT = (int)(sizeof(s_builtin_keys) / sizeof(s_builtin_keys[0]));
-
-static uint8_t s_extra_keys[MF_KEY_DICT_MAX_EXTRA][MF_KEY_SIZE];
-static int s_extra_count = 0;
-
-#define NVS_NS "nfc_dict"
-#define NVS_KEY_COUNT "extra_count"
-#define NVS_KEY_PREFIX "k_"
+#define MF_KEY_SIZE 6
-void mf_key_dict_init(void) {
- s_extra_count = 0;
+#define SD_USER_DIC TOS_PATH_NFC_DICT "/mf_classic_user.dic"
+
+#define LEGACY_NVS_NS "nfc_dict"
+#define LEGACY_NVS_KEY_COUNT "extra_count"
+#define LEGACY_NVS_KEY_PREFIX "k_"
- nvs_handle_t handle;
- esp_err_t err = nvs_open(NVS_NS, NVS_READONLY, &handle);
- if (err != ESP_OK) {
- ESP_LOGW(TAG, "NVS open failed (0x%x), starting with empty extra keys", err);
+static uint8_t s_keys[MF_KEY_DICT_MAX_KEYS][MF_KEY_SIZE];
+static int s_count = 0;
+
+static void migrate_legacy_nvs(void) {
+ nvs_handle_t ro;
+ if (nvs_open(LEGACY_NVS_NS, NVS_READONLY, &ro) != ESP_OK)
return;
- }
uint8_t count = 0;
- err = nvs_get_u8(handle, NVS_KEY_COUNT, &count);
- if (err != ESP_OK || count == 0) {
- nvs_close(handle);
+ esp_err_t err = nvs_get_u8(ro, LEGACY_NVS_KEY_COUNT, &count);
+ nvs_close(ro);
+ if (err != ESP_OK || count == 0)
return;
- }
- if (count > MF_KEY_DICT_MAX_EXTRA) {
- count = MF_KEY_DICT_MAX_EXTRA;
- }
+ nvs_handle_t rw;
+ if (nvs_open(LEGACY_NVS_NS, NVS_READWRITE, &rw) != ESP_OK)
+ return;
+ int migrated = 0;
for (uint8_t i = 0; i < count; i++) {
- char key_name[NVS_KEY_NAME_SIZE];
- snprintf(key_name, sizeof(key_name), NVS_KEY_PREFIX "%u", (unsigned)i);
+ char key_name[16];
+ snprintf(key_name, sizeof(key_name), LEGACY_NVS_KEY_PREFIX "%u", (unsigned)i);
+ uint8_t key[MF_KEY_SIZE];
size_t len = MF_KEY_SIZE;
- err = nvs_get_blob(handle, key_name, s_extra_keys[s_extra_count], &len);
- if (err == ESP_OK && len == MF_KEY_SIZE) {
- s_extra_count++;
- } else {
- ESP_LOGW(TAG, "Failed to load key %s (err 0x%x)", key_name, err);
- }
+ if (nvs_get_blob(rw, key_name, key, &len) != ESP_OK || len != MF_KEY_SIZE)
+ continue;
+
+ if (nfc_dict_append_key(SD_USER_DIC, key, MF_KEY_SIZE) == ESP_OK)
+ migrated++;
}
- nvs_close(handle);
- ESP_LOGI(TAG, "Loaded %d extra keys from NVS", s_extra_count);
+ nvs_erase_all(rw);
+ nvs_commit(rw);
+ nvs_close(rw);
+
+ ESP_LOGI(TAG, "Migrated %d legacy NVS keys into %s", migrated, SD_USER_DIC);
}
-int mf_key_dict_count(void) {
- return MF_KEY_DICT_BUILTIN_COUNT + s_extra_count;
+void mf_key_dict_init(void) {
+ s_count = 0;
+ memset(s_keys, 0, sizeof(s_keys));
+
+ migrate_legacy_nvs();
+
+ const nfc_dict_scan_params_t scan = {
+ .dir = TOS_PATH_NFC_DICT,
+ .prefix = "mf_classic_",
+ .key_size = MF_KEY_SIZE,
+ .max_keys = MF_KEY_DICT_MAX_KEYS,
+ };
+ size_t loaded = 0;
+ nfc_dict_load_dir(&scan, (uint8_t *)s_keys, &loaded);
+ s_count = (int)loaded;
+
+ if (s_count == 0)
+ ESP_LOGW(TAG, "No mf_classic_*.dic files found in %s", TOS_PATH_NFC_DICT);
+ else
+ ESP_LOGI(TAG, "Dictionary ready: %d keys", s_count);
}
-void mf_key_dict_get(int idx, uint8_t key_out[6]) {
- if (idx < 0) {
- return;
- }
+int mf_key_dict_count(void) {
+ return s_count;
+}
- if (idx < MF_KEY_DICT_BUILTIN_COUNT) {
- memcpy(key_out, s_builtin_keys[idx], MF_KEY_SIZE);
+void mf_key_dict_get(int idx, uint8_t key_out[MF_KEY_SIZE]) {
+ if (idx < 0 || idx >= s_count)
return;
- }
-
- int extra_idx = idx - MF_KEY_DICT_BUILTIN_COUNT;
- if (extra_idx < s_extra_count) {
- memcpy(key_out, s_extra_keys[extra_idx], MF_KEY_SIZE);
- }
+ memcpy(key_out, s_keys[idx], MF_KEY_SIZE);
}
-bool mf_key_dict_contains(const uint8_t key[6]) {
- for (int i = 0; i < MF_KEY_DICT_BUILTIN_COUNT; i++) {
- if (memcmp(s_builtin_keys[i], key, MF_KEY_SIZE) == 0) {
- return true;
- }
- }
-
- for (int i = 0; i < s_extra_count; i++) {
- if (memcmp(s_extra_keys[i], key, MF_KEY_SIZE) == 0) {
- return true;
- }
- }
-
- return false;
+bool mf_key_dict_contains(const uint8_t key[MF_KEY_SIZE]) {
+ return nfc_dict_contains((const uint8_t *)s_keys, (size_t)s_count, MF_KEY_SIZE, key);
}
-hb_nfc_err_t mf_key_dict_add(const uint8_t key[6]) {
- if (s_extra_count >= MF_KEY_DICT_MAX_EXTRA) {
- ESP_LOGE(TAG, "Extra key dictionary is full (%d)", MF_KEY_DICT_MAX_EXTRA);
- return HB_NFC_ERR_INTERNAL;
- }
-
- if (mf_key_dict_contains(key)) {
- ESP_LOGD(TAG, "Key already in dictionary, skipping");
+hb_nfc_err_t mf_key_dict_add(const uint8_t key[MF_KEY_SIZE]) {
+ if (mf_key_dict_contains(key))
return HB_NFC_OK;
- }
-
- memcpy(s_extra_keys[s_extra_count], key, MF_KEY_SIZE);
- s_extra_count++;
- nvs_handle_t handle;
- esp_err_t err = nvs_open(NVS_NS, NVS_READWRITE, &handle);
- if (err != ESP_OK) {
- ESP_LOGE(TAG, "NVS open for write failed (0x%x)", err);
- s_extra_count--;
+ if (s_count >= MF_KEY_DICT_MAX_KEYS) {
+ ESP_LOGE(TAG, "Dictionary full (%d), cannot add key", MF_KEY_DICT_MAX_KEYS);
return HB_NFC_ERR_INTERNAL;
}
- char key_name[16];
- snprintf(key_name, sizeof(key_name), NVS_KEY_PREFIX "%d", s_extra_count - 1);
+ memcpy(s_keys[s_count], key, MF_KEY_SIZE);
+ s_count++;
- err = nvs_set_blob(handle, key_name, key, MF_KEY_SIZE);
- if (err != ESP_OK) {
- ESP_LOGE(TAG, "NVS set_blob failed (0x%x)", err);
- s_extra_count--;
- nvs_close(handle);
+ if (nfc_dict_append_key(SD_USER_DIC, key, MF_KEY_SIZE) != ESP_OK) {
+ ESP_LOGW(TAG, "Could not persist key to %s (in-memory only)", SD_USER_DIC);
return HB_NFC_ERR_INTERNAL;
}
- err = nvs_set_u8(handle, NVS_KEY_COUNT, (uint8_t)s_extra_count);
- if (err != ESP_OK) {
- ESP_LOGE(TAG, "NVS set count failed (0x%x)", err);
- }
-
- nvs_commit(handle);
- nvs_close(handle);
-
- ESP_LOGI(TAG, "Added new key to dictionary (total extra: %d)", s_extra_count);
+ ESP_LOGI(TAG, "Persisted new key to %s (total %d)", SD_USER_DIC, s_count);
return HB_NFC_OK;
}
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_known_cards.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_known_cards.c
index 03cbbc3f..d7c9e693 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_known_cards.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_known_cards.c
@@ -1,83 +1,23 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_known_cards.h"
#include
#include
-static const char *TAG = "NFC_MF_KNOW_CARDS";
-
-static const uint8_t s_default_keys[][6] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, /* MAD / transport */
- {0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5},
- {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7}, /* NDEF */
-};
-
-static const uint8_t s_infineon_keys[][6] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x88, 0x44, 0x06, 0x30, 0x13, 0x15}, /* Infineon documented default */
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5},
-};
-
-static const uint8_t s_smartmx_keys[][6] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5},
- {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7},
- {0x4D, 0x3A, 0x99, 0xC3, 0x51, 0xDD},
-};
-
-static const uint8_t s_transit_keys[][6] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5},
- {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7},
- {0x4D, 0x3A, 0x99, 0xC3, 0x51, 0xDD},
- {0x1A, 0x98, 0x2C, 0x7E, 0x45, 0x9A},
- {0x71, 0x4C, 0x5C, 0x88, 0x6E, 0x97},
- {0x58, 0x7E, 0xE5, 0xF9, 0x35, 0x0F},
- {0xA0, 0x47, 0x8C, 0xC3, 0x90, 0x91},
- {0x53, 0x3C, 0xB6, 0xC7, 0x23, 0xF6},
- {0x8F, 0xD0, 0xA4, 0xF2, 0x56, 0xE9},
- {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
-};
-
-static const uint8_t s_access_keys[][6] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5},
- {0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0},
- {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
- {0x4D, 0x3A, 0x99, 0xC3, 0x51, 0xDD},
- {0x1A, 0x98, 0x2C, 0x7E, 0x45, 0x9A},
- {0x71, 0x4C, 0x5C, 0x88, 0x6E, 0x97},
- {0x8F, 0xD0, 0xA4, 0xF2, 0x56, 0xE9},
-};
-
-static const uint8_t s_clone_keys[][6] = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5},
- {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7},
-};
-
-#define NKEYS(arr) ((int)(sizeof(arr) / sizeof(arr[0])))
-
static const mf_known_card_t s_db[] = {
{
.name = "NXP MIFARE Classic 1K",
@@ -86,8 +26,6 @@ static const mf_known_card_t s_db[] = {
.atqa = {0x00, 0x04},
.uid_prefix = {0x04},
.uid_prefix_len = 1,
- .hint_keys = s_default_keys,
- .hint_key_count = NKEYS(s_default_keys),
},
{
.name = "NXP MIFARE Classic 4K",
@@ -96,94 +34,60 @@ static const mf_known_card_t s_db[] = {
.atqa = {0x00, 0x02},
.uid_prefix = {0x04},
.uid_prefix_len = 1,
- .hint_keys = s_default_keys,
- .hint_key_count = NKEYS(s_default_keys),
},
-
{
.name = "MIFARE Classic 1K Clone (Gen2/CUID)",
.hint = "UID changeable, writable block 0",
.sak = 0x08,
.atqa = {0x00, 0x44},
- .uid_prefix_len = 0,
- .hint_keys = s_clone_keys,
- .hint_key_count = NKEYS(s_clone_keys),
},
{
.name = "MIFARE Classic 4K Clone",
.hint = "UID changeable clone",
.sak = 0x18,
.atqa = {0x00, 0x42},
- .uid_prefix_len = 0,
- .hint_keys = s_clone_keys,
- .hint_key_count = NKEYS(s_clone_keys),
},
{
.name = "Infineon MIFARE Classic 1K",
.hint = "SLE66R35, used in older access/transit systems",
.sak = 0x88,
.atqa = {0x00, 0x04},
- .uid_prefix_len = 0,
- .hint_keys = s_infineon_keys,
- .hint_key_count = NKEYS(s_infineon_keys),
},
-
{
.name = "NXP SmartMX MIFARE Classic 1K",
.hint = "P60/P40 combo chip, SAK=0x28",
.sak = 0x28,
.atqa = {0x00, 0x04},
- .uid_prefix_len = 0,
- .hint_keys = s_smartmx_keys,
- .hint_key_count = NKEYS(s_smartmx_keys),
},
{
.name = "NXP SmartMX MIFARE Classic 4K",
.hint = "P60/P40 combo chip, SAK=0x38",
.sak = 0x38,
.atqa = {0x00, 0x02},
- .uid_prefix_len = 0,
- .hint_keys = s_smartmx_keys,
- .hint_key_count = NKEYS(s_smartmx_keys),
},
-
{
.name = "Transit/Ticketing Card (1K)",
.hint = "Common for metro/bus access systems",
.sak = 0x08,
.atqa = {0x00, 0x04},
- .uid_prefix_len = 0,
- .hint_keys = s_transit_keys,
- .hint_key_count = NKEYS(s_transit_keys),
},
{
.name = "Transit/Ticketing Card (4K)",
.hint = "Large-memory transit card",
.sak = 0x18,
.atqa = {0x00, 0x02},
- .uid_prefix_len = 0,
- .hint_keys = s_transit_keys,
- .hint_key_count = NKEYS(s_transit_keys),
},
-
{
.name = "Access Control Card (1K)",
.hint = "Building/door access system",
.sak = 0x08,
.atqa = {0x08, 0x00},
- .uid_prefix_len = 0,
- .hint_keys = s_access_keys,
- .hint_key_count = NKEYS(s_access_keys),
},
-
{
.name = "MIFARE Mini",
.hint = "320 bytes / 5 sectors",
.sak = 0x09,
.atqa = {0x00, 0x04},
- .uid_prefix_len = 0,
- .hint_keys = s_default_keys,
- .hint_key_count = NKEYS(s_default_keys),
},
};
@@ -202,15 +106,12 @@ mf_known_cards_match(uint8_t sak, const uint8_t atqa[2], const uint8_t *uid, uin
continue;
if (e->uid_prefix_len > 0) {
- /* UID-specific entry */
if (uid_len < e->uid_prefix_len)
continue;
if (memcmp(uid, e->uid_prefix, e->uid_prefix_len) != 0)
continue;
- /* Specific match wins immediately */
return e;
} else {
- /* Generic match — remember first, keep looking for specific */
if (generic_match == NULL)
generic_match = e;
}
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_nested.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_nested.c
index 7a6e4c31..c37c96c2 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_nested.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_nested.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mf_nested.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_plus.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_plus.c
index 9625772e..655b001f 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_plus.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_plus.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_plus.c
* @brief MiFARE Plus SL3 auth and crypto helpers.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_ultralight.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_ultralight.c
index 00a655b1..e1e42cc9 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mf_ultralight.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mf_ultralight.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file mf_ultralight.c
* @brief MIFARE Ultralight / Ultralight-C read, write, and auth operations.
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/mfkey.c b/firmware_p4/components/Applications/nfc/protocols/mifare/mfkey.c
index 510e783e..cf37d118 100644
--- a/firmware_p4/components/Applications/nfc/protocols/mifare/mfkey.c
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/mfkey.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mfkey.h"
diff --git a/firmware_p4/components/Applications/nfc/protocols/mifare/nfc_dict_loader.c b/firmware_p4/components/Applications/nfc/protocols/mifare/nfc_dict_loader.c
new file mode 100644
index 00000000..676d8209
--- /dev/null
+++ b/firmware_p4/components/Applications/nfc/protocols/mifare/nfc_dict_loader.c
@@ -0,0 +1,280 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "nfc_dict_loader.h"
+
+#include
+#include
+#include
+#include
+
+#include "esp_log.h"
+
+static const char *TAG = "NFC_DICT";
+
+#define MAX_LINE_LEN 96
+#define MAX_KEY_SIZE 32
+#define MAX_PATH_LEN 256
+#define DIC_EXTENSION ".dic"
+#define DIC_EXTENSION_LEN 4
+
+static int hex_nibble(char c) {
+ if (c >= '0' && c <= '9') {
+ return c - '0';
+ }
+ if (c >= 'a' && c <= 'f') {
+ return 10 + (c - 'a');
+ }
+ if (c >= 'A' && c <= 'F') {
+ return 10 + (c - 'A');
+ }
+ return -1;
+}
+
+static bool parse_hex_line(const char *line, size_t key_size, uint8_t *out_key) {
+ size_t got = 0;
+ int hi = -1;
+
+ for (const char *p = line; *p != '\0'; p++) {
+ if (*p == '#' || *p == '\n' || *p == '\r') {
+ break;
+ }
+ if (isspace((unsigned char)*p)) {
+ continue;
+ }
+
+ int n = hex_nibble(*p);
+ if (n < 0) {
+ return false;
+ }
+
+ if (hi < 0) {
+ hi = n;
+ } else {
+ if (got >= key_size) {
+ return false;
+ }
+ out_key[got++] = (uint8_t)((hi << 4) | n);
+ hi = -1;
+ }
+ }
+
+ return (hi < 0) && (got == key_size);
+}
+
+typedef struct {
+ size_t key_size;
+ size_t max_keys;
+} nfc_dict_io_t;
+
+static esp_err_t
+load_from(const char *path, const nfc_dict_io_t *io, uint8_t *out_keys, size_t *out_count) {
+ FILE *f = fopen(path, "r");
+ if (f == NULL) {
+ return ESP_ERR_NOT_FOUND;
+ }
+
+ if (io->key_size > MAX_KEY_SIZE) {
+ ESP_LOGE(TAG, "key_size %u exceeds MAX_KEY_SIZE", (unsigned)io->key_size);
+ fclose(f);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ char line[MAX_LINE_LEN];
+ size_t loaded = 0;
+ size_t lineno = 0;
+
+ while (loaded < io->max_keys && fgets(line, sizeof(line), f) != NULL) {
+ lineno++;
+
+ const char *p = line;
+ while (*p != '\0' && isspace((unsigned char)*p)) {
+ p++;
+ }
+ if (*p == '\0' || *p == '#') {
+ continue;
+ }
+
+ uint8_t key[MAX_KEY_SIZE];
+ if (!parse_hex_line(line, io->key_size, key)) {
+ ESP_LOGD(TAG, "%s:%u: skip malformed line", path, (unsigned)lineno);
+ continue;
+ }
+
+ memcpy(out_keys + loaded * io->key_size, key, io->key_size);
+ loaded++;
+ }
+
+ fclose(f);
+ *out_count = loaded;
+ return (loaded > 0) ? ESP_OK : ESP_ERR_NOT_FOUND;
+}
+
+esp_err_t
+nfc_dict_load_file(const nfc_dict_load_params_t *params, uint8_t *out_keys, size_t *out_count) {
+ if (params == NULL || out_keys == NULL || out_count == NULL || params->key_size == 0 ||
+ params->max_keys == 0) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ *out_count = 0;
+
+ const nfc_dict_io_t io = {.key_size = params->key_size, .max_keys = params->max_keys};
+
+ if (params->sd_path != NULL) {
+ esp_err_t err = load_from(params->sd_path, &io, out_keys, out_count);
+ if (err == ESP_OK) {
+ ESP_LOGI(TAG, "Loaded %u keys from %s", (unsigned)*out_count, params->sd_path);
+ return ESP_OK;
+ }
+ }
+
+ if (params->flash_path != NULL) {
+ esp_err_t err = load_from(params->flash_path, &io, out_keys, out_count);
+ if (err == ESP_OK) {
+ ESP_LOGI(
+ TAG, "Loaded %u keys from %s (flash fallback)", (unsigned)*out_count, params->flash_path);
+ return ESP_OK;
+ }
+ }
+
+ ESP_LOGW(TAG,
+ "No keys loaded (sd=%s flash=%s)",
+ params->sd_path != NULL ? params->sd_path : "(none)",
+ params->flash_path != NULL ? params->flash_path : "(none)");
+ return ESP_ERR_NOT_FOUND;
+}
+
+static bool name_has_dic_extension(const char *name) {
+ size_t nlen = strlen(name);
+ if (nlen < DIC_EXTENSION_LEN) {
+ return false;
+ }
+ return strcmp(name + nlen - DIC_EXTENSION_LEN, DIC_EXTENSION) == 0;
+}
+
+esp_err_t
+nfc_dict_load_dir(const nfc_dict_scan_params_t *params, uint8_t *out_keys, size_t *out_count) {
+ if (params == NULL || params->dir == NULL || out_keys == NULL || out_count == NULL ||
+ params->key_size == 0 || params->max_keys == 0) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ *out_count = 0;
+
+ DIR *d = opendir(params->dir);
+ if (d == NULL) {
+ ESP_LOGW(TAG, "Cannot open dir %s", params->dir);
+ return ESP_ERR_NOT_FOUND;
+ }
+
+ size_t prefix_len = (params->prefix != NULL) ? strlen(params->prefix) : 0;
+ int files_loaded = 0;
+
+ struct dirent *de;
+ while ((de = readdir(d)) != NULL) {
+ if (de->d_name[0] == '.') {
+ continue;
+ }
+ if (prefix_len > 0 && strncmp(de->d_name, params->prefix, prefix_len) != 0) {
+ continue;
+ }
+ if (!name_has_dic_extension(de->d_name)) {
+ continue;
+ }
+
+ char path[MAX_PATH_LEN];
+ int n = snprintf(path, sizeof(path), "%s/%s", params->dir, de->d_name);
+ if (n <= 0 || (size_t)n >= sizeof(path)) {
+ continue;
+ }
+
+ if (*out_count >= params->max_keys) {
+ break;
+ }
+
+ uint8_t *tail = out_keys + (*out_count) * params->key_size;
+ const nfc_dict_io_t file_io = {
+ .key_size = params->key_size,
+ .max_keys = params->max_keys - *out_count,
+ };
+ size_t file_count = 0;
+
+ if (load_from(path, &file_io, tail, &file_count) != ESP_OK) {
+ continue;
+ }
+
+ size_t kept = 0;
+ for (size_t i = 0; i < file_count; i++) {
+ const uint8_t *k = tail + i * params->key_size;
+ if (nfc_dict_contains(out_keys, *out_count + kept, params->key_size, k)) {
+ continue;
+ }
+ if (kept != i) {
+ memmove(tail + kept * params->key_size, k, params->key_size);
+ }
+ kept++;
+ }
+ *out_count += kept;
+
+ if (kept > 0) {
+ ESP_LOGI(TAG, "Loaded %u new keys from %s", (unsigned)kept, de->d_name);
+ files_loaded++;
+ }
+ }
+ closedir(d);
+
+ ESP_LOGI(TAG,
+ "%s: scanned dir, %d files contributed, %u total keys",
+ params->dir,
+ files_loaded,
+ (unsigned)*out_count);
+ return ESP_OK;
+}
+
+bool nfc_dict_contains(const uint8_t *keys, size_t count, size_t key_size, const uint8_t *key) {
+ if (keys == NULL || key == NULL || key_size == 0) {
+ return false;
+ }
+ for (size_t i = 0; i < count; i++) {
+ if (memcmp(keys + i * key_size, key, key_size) == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
+esp_err_t nfc_dict_append_key(const char *sd_path, const uint8_t *key, size_t key_size) {
+ if (sd_path == NULL || key == NULL || key_size == 0) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ FILE *f = fopen(sd_path, "a");
+ if (f == NULL) {
+ ESP_LOGE(TAG, "Cannot open %s for append", sd_path);
+ return ESP_FAIL;
+ }
+
+ for (size_t i = 0; i < key_size; i++) {
+ if (fprintf(f, "%02X", key[i]) < 0) {
+ fclose(f);
+ return ESP_FAIL;
+ }
+ }
+ fputc('\n', f);
+ fclose(f);
+
+ return ESP_OK;
+}
diff --git a/firmware_p4/components/Applications/nfc/protocols/t1t/include/t1t.h b/firmware_p4/components/Applications/nfc/protocols/t1t/include/t1t.h
index 14b940db..ab7ea305 100644
--- a/firmware_p4/components/Applications/nfc/protocols/t1t/include/t1t.h
+++ b/firmware_p4/components/Applications/nfc/protocols/t1t/include/t1t.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t1t.h
* @brief NFC Forum Type 1 Tag (Topaz) commands.
diff --git a/firmware_p4/components/Applications/nfc/protocols/t1t/t1t.c b/firmware_p4/components/Applications/nfc/protocols/t1t/t1t.c
index 3a50f84a..227a6d0a 100644
--- a/firmware_p4/components/Applications/nfc/protocols/t1t/t1t.c
+++ b/firmware_p4/components/Applications/nfc/protocols/t1t/t1t.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t1t.c
* @brief NFC Forum Type 1 Tag (Topaz) protocol (Phase 4).
diff --git a/firmware_p4/components/Applications/nfc/protocols/t2t/include/t2t_emu.h b/firmware_p4/components/Applications/nfc/protocols/t2t/include/t2t_emu.h
index 45dcb2a9..83e5a800 100644
--- a/firmware_p4/components/Applications/nfc/protocols/t2t/include/t2t_emu.h
+++ b/firmware_p4/components/Applications/nfc/protocols/t2t/include/t2t_emu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file t2t_emu.h
* @brief NFC-A Type 2 Tag (T2T) Emulation ST25R3916.
diff --git a/firmware_p4/components/Applications/nfc/protocols/t2t/t2t_emu.c b/firmware_p4/components/Applications/nfc/protocols/t2t/t2t_emu.c
index 2a089116..fd92f45f 100644
--- a/firmware_p4/components/Applications/nfc/protocols/t2t/t2t_emu.c
+++ b/firmware_p4/components/Applications/nfc/protocols/t2t/t2t_emu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "t2t_emu.h"
diff --git a/firmware_p4/components/Applications/rfid/include/rfid_manager.h b/firmware_p4/components/Applications/rfid/include/rfid_manager.h
new file mode 100644
index 00000000..9c22d5ff
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/include/rfid_manager.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef RFID_MANAGER_H
+#define RFID_MANAGER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#include "esp_err.h"
+
+#include "ys_rfid2_types.h"
+#include "rfid_types.h"
+
+/**
+ * @brief Full card event with raw + decoded data.
+ */
+typedef struct {
+ ys_rfid2_event_t driver_event;
+ rfid_decoded_data_t decoded;
+ bool is_decoded;
+} rfid_card_event_t;
+
+/**
+ * @brief Callback invoked when a card event occurs.
+ *
+ * @param event Pointer to card event. Valid only during callback scope.
+ * @param ctx User context pointer.
+ */
+typedef void (*rfid_manager_event_cb_t)(const rfid_card_event_t *event, void *ctx);
+
+/**
+ * @brief Start the RFID manager.
+ *
+ * Starts the YS-RFID2 driver and routes events through the protocol registry.
+ *
+ * @param cb Event callback. Must not be NULL.
+ * @param ctx User context pointer.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_ARG if cb is NULL
+ * - ESP_ERR_INVALID_STATE if already running
+ */
+esp_err_t rfid_manager_start(rfid_manager_event_cb_t cb, void *ctx);
+
+/**
+ * @brief Stop the RFID manager.
+ *
+ * Stops the YS-RFID2 driver.
+ */
+void rfid_manager_stop(void);
+
+/**
+ * @brief Check if the manager is running.
+ */
+bool rfid_manager_is_running(void);
+
+/**
+ * @brief Get the last card event.
+ *
+ * @param[out] out_event Pointer to receive the event.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_NOT_FOUND if no card has been detected yet
+ * - ESP_ERR_INVALID_ARG if out_event is NULL
+ */
+esp_err_t rfid_manager_get_last_card(rfid_card_event_t *out_event);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RFID_MANAGER_H
diff --git a/firmware_p4/components/Applications/rfid/include/rfid_storage.h b/firmware_p4/components/Applications/rfid/include/rfid_storage.h
new file mode 100644
index 00000000..5c76428c
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/include/rfid_storage.h
@@ -0,0 +1,140 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef RFID_STORAGE_H
+#define RFID_STORAGE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#include "esp_err.h"
+
+#include "ys_rfid2_types.h"
+#include "rfid_types.h"
+
+#define RFID_STORAGE_MAX_ENTRIES 32
+#define RFID_STORAGE_NAME_MAX 32
+
+/**
+ * @brief Full RFID card entry for save/load.
+ */
+typedef struct {
+ char name[RFID_STORAGE_NAME_MAX];
+ ys_rfid2_raw_data_t raw;
+ rfid_decoded_data_t decoded;
+ bool is_decoded;
+ int64_t timestamp_ms;
+} rfid_storage_entry_t;
+
+/**
+ * @brief Lightweight info struct for listing (no raw data).
+ */
+typedef struct {
+ char name[RFID_STORAGE_NAME_MAX];
+ const char *protocol_name;
+ uint32_t card_number;
+ uint16_t facility_code;
+} rfid_storage_info_t;
+
+/**
+ * @brief Initialize RFID storage.
+ */
+void rfid_storage_init(void);
+
+/**
+ * @brief Get number of stored entries.
+ */
+int rfid_storage_count(void);
+
+/**
+ * @brief Save a card entry to storage.
+ *
+ * @param name Entry name. Must not be NULL.
+ * @param raw Raw card data.
+ * @param decoded Decoded data (may be empty if is_decoded is false).
+ * @param is_decoded Whether decoded data is valid.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_ARG if name or raw is NULL
+ * - ESP_ERR_NO_MEM if storage is full
+ * - ESP_FAIL on write error
+ */
+esp_err_t rfid_storage_save(const char *name,
+ const ys_rfid2_raw_data_t *raw,
+ const rfid_decoded_data_t *decoded,
+ bool is_decoded);
+
+/**
+ * @brief Load a full entry by index.
+ *
+ * @param index Entry index (0-based).
+ * @param[out] out_entry Loaded entry data.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_ARG if out_entry is NULL or index out of range
+ * - ESP_ERR_NOT_FOUND if entry does not exist
+ */
+esp_err_t rfid_storage_load(int index, rfid_storage_entry_t *out_entry);
+
+/**
+ * @brief Get lightweight info for an entry.
+ *
+ * @param index Entry index.
+ * @param[out] out_info Lightweight entry info.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_NOT_FOUND if entry does not exist
+ */
+esp_err_t rfid_storage_get_info(int index, rfid_storage_info_t *out_info);
+
+/**
+ * @brief List all stored entry infos.
+ *
+ * @param[out] out_infos Output array.
+ * @param max Maximum entries to fill.
+ * @return Number of entries listed.
+ */
+int rfid_storage_list(rfid_storage_info_t *out_infos, int max);
+
+/**
+ * @brief Delete an entry by index.
+ *
+ * @param index Entry index.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_NOT_FOUND if entry does not exist
+ */
+esp_err_t rfid_storage_delete(int index);
+
+/**
+ * @brief Find an entry by raw card ID string.
+ *
+ * @param id_str 10-digit card ID string.
+ * @param[out] out_index Matching entry index.
+ * @return
+ * - ESP_OK if found
+ * - ESP_ERR_NOT_FOUND if no match
+ */
+esp_err_t rfid_storage_find_by_id(const char *id_str, int *out_index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RFID_STORAGE_H
diff --git a/firmware_p4/components/Applications/rfid/include/rfid_types.h b/firmware_p4/components/Applications/rfid/include/rfid_types.h
new file mode 100644
index 00000000..7a01c823
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/include/rfid_types.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef RFID_TYPES_H
+#define RFID_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+/**
+ * @brief Decoded card data produced by protocol plugins.
+ */
+typedef struct {
+ const char *protocol_name;
+ uint32_t card_number;
+ uint16_t facility_code;
+ uint8_t bit_count;
+ uint64_t raw_value;
+} rfid_decoded_data_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RFID_TYPES_H
diff --git a/firmware_p4/components/Applications/rfid/protocols/include/rfid_protocol_decoder.h b/firmware_p4/components/Applications/rfid/protocols/include/rfid_protocol_decoder.h
new file mode 100644
index 00000000..d07e0bb7
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/include/rfid_protocol_decoder.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef RFID_PROTOCOL_DECODER_H
+#define RFID_PROTOCOL_DECODER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#include "ys_rfid2_types.h"
+#include "rfid_types.h"
+
+/**
+ * @brief Interface for RFID 125kHz protocol decoders.
+ */
+typedef struct {
+ const char *name;
+
+ /**
+ * @brief Decode raw card data into structured fields.
+ *
+ * @param raw Raw data from the RFID reader (40-bit card ID).
+ * @param out_data Pointer to store decoded results.
+ * @return true if the protocol recognized the data.
+ */
+ bool (*decode)(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data);
+} rfid_protocol_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RFID_PROTOCOL_DECODER_H
diff --git a/firmware_p4/components/Applications/rfid/protocols/include/rfid_protocol_registry.h b/firmware_p4/components/Applications/rfid/protocols/include/rfid_protocol_registry.h
new file mode 100644
index 00000000..d58441f7
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/include/rfid_protocol_registry.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef RFID_PROTOCOL_REGISTRY_H
+#define RFID_PROTOCOL_REGISTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "rfid_protocol_decoder.h"
+
+/**
+ * @brief Initialize the protocol registry.
+ */
+void rfid_protocol_registry_init(void);
+
+/**
+ * @brief Run all registered decoders on raw card data.
+ *
+ * @param raw Raw data from the RFID reader.
+ * @param out_data Pointer to store decoded results.
+ * @return true if a protocol claimed the data.
+ */
+bool rfid_protocol_registry_decode_all(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data);
+
+/**
+ * @brief Find a protocol by name.
+ *
+ * @param name Protocol name to search for.
+ * @return Pointer to protocol structure, or NULL if not found.
+ */
+const rfid_protocol_t *rfid_protocol_registry_get_by_name(const char *name);
+
+/**
+ * @brief Get the number of registered protocols.
+ */
+size_t rfid_protocol_registry_get_count(void);
+
+/**
+ * @brief Get a protocol by index.
+ *
+ * @param index Zero-based index into the registry.
+ * @return Pointer to protocol structure, or NULL if index is out of range.
+ */
+const rfid_protocol_t *rfid_protocol_registry_get_by_index(size_t index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RFID_PROTOCOL_REGISTRY_H
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_awid.c b/firmware_p4/components/Applications/rfid/protocols/protocol_awid.c
new file mode 100644
index 00000000..e562a830
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_awid.c
@@ -0,0 +1,91 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// AWID — 26-bit Wiegand format
+// Identical structure to HID H10301:
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code (0-255)
+// Bits 16-1: 16-bit card number (0-65535)
+// Bit 0: odd parity (covers bits 12-0)
+// Distinguished from HID by the EM4100 customer code byte.
+// AWID cards typically have customer code 0x01.
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_AWID";
+
+#define AWID_BITS 26
+#define AWID_CUSTOMER_ID 0x01
+#define AWID_FC_SHIFT 17
+#define AWID_FC_MASK 0xFF
+#define AWID_CARD_SHIFT 1
+#define AWID_CARD_MASK 0xFFFF
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_awid_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ // Check AWID customer code in the upper byte
+ if (raw->data[0] != AWID_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ uint8_t facility_code = (wiegand >> AWID_FC_SHIFT) & AWID_FC_MASK;
+ uint16_t card_number = (wiegand >> AWID_CARD_SHIFT) & AWID_CARD_MASK;
+
+ // Validate even parity (bits 25-13)
+ if ((count_bits(wiegand, 13, 25) % 2) != 0) {
+ return false;
+ }
+
+ // Validate odd parity (bits 12-0)
+ if ((count_bits(wiegand, 0, 12) % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "AWID";
+ out_data->facility_code = facility_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = AWID_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %u", facility_code, card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_awid = {
+ .name = "AWID",
+ .decode = protocol_awid_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_em4100.c b/firmware_p4/components/Applications/rfid/protocols/protocol_em4100.c
new file mode 100644
index 00000000..f5aa5a16
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_em4100.c
@@ -0,0 +1,57 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// EM4100 / EM-Marin / TK4100 — 125kHz read-only RFID
+// 40-bit data: 8-bit customer/version code + 32-bit unique card ID
+// Ref: https://www.priority1design.com.au/em4100_protocol.html
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_EM4100";
+
+#define EM4100_CUSTOMER_SHIFT 32
+#define EM4100_CUSTOMER_MASK 0xFF
+#define EM4100_CARD_MASK 0xFFFFFFFF
+
+static bool protocol_em4100_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ // Reconstruct 40-bit value from raw bytes (big-endian)
+ uint64_t value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ value = (value << 8) | raw->data[i];
+ }
+
+ uint8_t customer_code = (uint8_t)((value >> EM4100_CUSTOMER_SHIFT) & EM4100_CUSTOMER_MASK);
+ uint32_t card_id = (uint32_t)(value & EM4100_CARD_MASK);
+
+ out_data->protocol_name = "EM4100";
+ out_data->facility_code = customer_code;
+ out_data->card_number = card_id;
+ out_data->bit_count = 40;
+ out_data->raw_value = value;
+
+ ESP_LOGD(TAG, "Customer: %u, Card: %lu", customer_code, (unsigned long)card_id);
+ return true;
+}
+
+rfid_protocol_t protocol_em4100 = {
+ .name = "EM4100",
+ .decode = protocol_em4100_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_fdxb.c b/firmware_p4/components/Applications/rfid/protocols/protocol_fdxb.c
new file mode 100644
index 00000000..0147f545
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_fdxb.c
@@ -0,0 +1,67 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// FDX-B — ISO 11784/11785 Animal Identification
+// 134.2kHz carrier (may not be directly readable by 125kHz YS-RFID2)
+// When raw 40-bit data is available, attempt to extract:
+// - 10-bit country code
+// - 38-bit national ID (lower 32 bits stored as card_number)
+// This is a best-effort decoder for cloned/compatible data.
+// Ref: https://www.priority1design.com.au/fdx-b_animal_identification_protocol.html
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_FDXB";
+
+#define FDXB_BITS 40
+#define FDXB_COUNTRY_MASK 0x3FF
+#define FDXB_COUNTRY_SHIFT 32
+
+static bool protocol_fdxb_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ // Upper 8 bits as country hint (only 10 bits in full FDX-B, we have 8)
+ uint16_t country_code = (uint16_t)((full_value >> FDXB_COUNTRY_SHIFT) & FDXB_COUNTRY_MASK);
+ uint32_t national_id = (uint32_t)(full_value & 0xFFFFFFFF);
+
+ // FDX-B country codes are in range 1-999 (ISO 3166)
+ // If the upper byte doesn't look like a valid country code range, skip
+ if (country_code == 0 || country_code > 999) {
+ return false;
+ }
+
+ out_data->protocol_name = "FDX-B";
+ out_data->facility_code = country_code;
+ out_data->card_number = national_id;
+ out_data->bit_count = FDXB_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "Country: %u, ID: %lu", country_code, (unsigned long)national_id);
+ return true;
+}
+
+rfid_protocol_t protocol_fdxb = {
+ .name = "FDX-B",
+ .decode = protocol_fdxb_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_gallagher.c b/firmware_p4/components/Applications/rfid/protocols/protocol_gallagher.c
new file mode 100644
index 00000000..78a724f3
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_gallagher.c
@@ -0,0 +1,81 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Gallagher — Enterprise access control
+// Uses EM4100 customer code 0x09.
+// Data layout in lower 32 bits:
+// Bits [31:24] = 8-bit region code
+// Bits [23:8] = 16-bit cardholder number
+// Bits [7:4] = 4-bit issue level
+// Bits [3:0] = 4-bit checksum nibble
+// Ref: https://github.com/megabug/gallagher-research
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_GALLAGHER";
+
+#define GALLAGHER_BITS 40
+#define GALLAGHER_CUSTOMER_ID 0x09
+#define GALLAGHER_REGION_MASK 0xFF
+#define GALLAGHER_CARD_MASK 0xFFFF
+#define GALLAGHER_ISSUE_MASK 0x0F
+
+static bool protocol_gallagher_decode(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != GALLAGHER_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint8_t region = raw->data[1];
+ uint16_t card_number = ((uint16_t)raw->data[2] << 8) | raw->data[3];
+ uint8_t issue_level = (raw->data[4] >> 4) & GALLAGHER_ISSUE_MASK;
+ uint8_t checksum = raw->data[4] & 0x0F;
+
+ // Simple checksum: XOR of all nibbles should produce a known value
+ uint8_t calc = 0;
+ for (int i = 0; i < 4; i++) {
+ calc ^= (raw->data[i] >> 4) ^ (raw->data[i] & 0x0F);
+ }
+ calc ^= (raw->data[4] >> 4);
+
+ if ((calc & 0x0F) != checksum) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ out_data->protocol_name = "Gallagher";
+ out_data->facility_code = region;
+ out_data->card_number = card_number;
+ out_data->bit_count = GALLAGHER_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "Region: %u, Card: %u, Issue: %u", region, card_number, issue_level);
+ return true;
+}
+
+rfid_protocol_t protocol_gallagher = {
+ .name = "Gallagher",
+ .decode = protocol_gallagher_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_hid.c b/firmware_p4/components/Applications/rfid/protocols/protocol_hid.c
new file mode 100644
index 00000000..af5436d7
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_hid.c
@@ -0,0 +1,91 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// HID Prox H10301 — 26-bit Wiegand format
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code (0-255)
+// Bits 16-1: 16-bit card number (0-65535)
+// Bit 0: odd parity (covers bits 12-0)
+// Ref: https://www.proxcards.com/hid-26-bit-h10301-format/
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_HID";
+
+#define HID_WIEGAND_BITS 26
+#define HID_FC_SHIFT 17
+#define HID_FC_MASK 0xFF
+#define HID_CARD_SHIFT 1
+#define HID_CARD_MASK 0xFFFF
+#define HID_EVEN_PARITY_BIT 25
+#define HID_ODD_PARITY_BIT 0
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_hid_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ // Use lower 26 bits of the 40-bit raw value
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ // Extract fields
+ uint8_t even_parity = (wiegand >> HID_EVEN_PARITY_BIT) & 1;
+ uint8_t facility_code = (wiegand >> HID_FC_SHIFT) & HID_FC_MASK;
+ uint16_t card_number = (wiegand >> HID_CARD_SHIFT) & HID_CARD_MASK;
+ uint8_t odd_parity = (wiegand >> HID_ODD_PARITY_BIT) & 1;
+
+ // Validate even parity (bits 25-13, including parity bit itself)
+ int even_count = count_bits(wiegand, 13, HID_EVEN_PARITY_BIT);
+ if ((even_count % 2) != 0) {
+ return false;
+ }
+
+ // Validate odd parity (bits 12-0, including parity bit itself)
+ int odd_count = count_bits(wiegand, HID_ODD_PARITY_BIT, 12);
+ if ((odd_count % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "HID Prox";
+ out_data->facility_code = facility_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = HID_WIEGAND_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %u", facility_code, card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_hid = {
+ .name = "HID Prox",
+ .decode = protocol_hid_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_hid_corp.c b/firmware_p4/components/Applications/rfid/protocols/protocol_hid_corp.c
new file mode 100644
index 00000000..c4a6773a
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_hid_corp.c
@@ -0,0 +1,94 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// HID Corporate 1000 H10302 — 35-bit format
+// Bit 34: even parity (covers bits 34-18)
+// Bits 33-22: 12-bit company/site code (0-4095)
+// Bits 21-2: 20-bit card number (0-1048575)
+// Bit 1: odd parity (covers bits 17-1)
+// Bit 0: odd parity (covers bits 34-2, full frame)
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_HID_CORP";
+
+#define HID_CORP_BITS 35
+#define HID_CORP_SITE_SHIFT 22
+#define HID_CORP_SITE_MASK 0xFFF
+#define HID_CORP_CARD_SHIFT 2
+#define HID_CORP_CARD_MASK 0xFFFFF
+
+static int count_bits_64(uint64_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1ULL << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_hid_corp_decode(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ // Use lower 35 bits
+ uint64_t corp = full_value & 0x7FFFFFFFFULL;
+
+ // Extract fields
+ uint16_t site_code = (uint16_t)((corp >> HID_CORP_SITE_SHIFT) & HID_CORP_SITE_MASK);
+ uint32_t card_number = (uint32_t)((corp >> HID_CORP_CARD_SHIFT) & HID_CORP_CARD_MASK);
+
+ // Validate even parity (bit 34 covers bits 34-18)
+ int even_count = count_bits_64(corp, 18, 34);
+ if ((even_count % 2) != 0) {
+ return false;
+ }
+
+ // Validate odd parity (bit 1 covers bits 17-1)
+ int odd_count = count_bits_64(corp, 1, 17);
+ if ((odd_count % 2) != 1) {
+ return false;
+ }
+
+ // Validate frame parity (bit 0 covers bits 34-2)
+ int frame_count = count_bits_64(corp, 0, 34);
+ if ((frame_count % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "HID Corp 1000";
+ out_data->facility_code = site_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = HID_CORP_BITS;
+ out_data->raw_value = corp;
+
+ ESP_LOGD(TAG, "Site: %u, Card: %lu", site_code, (unsigned long)card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_hid_corp = {
+ .name = "HID Corp 1000",
+ .decode = protocol_hid_corp_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_indala.c b/firmware_p4/components/Applications/rfid/protocols/protocol_indala.c
new file mode 100644
index 00000000..b8334a09
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_indala.c
@@ -0,0 +1,88 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Indala 26-bit (Motorola/Identiv format 40134)
+// 26 bits with proprietary bit scrambling:
+// 1 even parity + 12-bit site code + 12-bit card number + 1 odd parity
+// The bit positions are scrambled within the raw data.
+// Ref: Identiv 4000/4020 clamshell card specs
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_INDALA";
+
+#define INDALA_BITS 26
+#define INDALA_SITE_MASK 0xFFF
+#define INDALA_CARD_MASK 0xFFF
+
+static bool protocol_indala_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ // Use lower 26 bits
+ uint32_t indala = (uint32_t)(full_value & 0x03FFFFFF);
+
+ // Extract parity bits
+ uint8_t even_parity = (indala >> 25) & 1;
+ uint8_t odd_parity = indala & 1;
+
+ // Extract site code (bits 24-13) and card number (bits 12-1)
+ uint16_t site_code = (uint16_t)((indala >> 13) & INDALA_SITE_MASK);
+ uint16_t card_number = (uint16_t)((indala >> 1) & INDALA_CARD_MASK);
+
+ // Validate even parity (covers upper half: bits 25-13)
+ int even_count = 0;
+ for (int i = 13; i <= 25; i++) {
+ if (indala & (1u << i)) {
+ even_count++;
+ }
+ }
+ if ((even_count % 2) != 0) {
+ return false;
+ }
+
+ // Validate odd parity (covers lower half: bits 12-0)
+ int odd_count = 0;
+ for (int i = 0; i <= 12; i++) {
+ if (indala & (1u << i)) {
+ odd_count++;
+ }
+ }
+ if ((odd_count % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "Indala";
+ out_data->facility_code = site_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = INDALA_BITS;
+ out_data->raw_value = indala;
+
+ ESP_LOGD(TAG, "Site: %u, Card: %u", site_code, card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_indala = {
+ .name = "Indala",
+ .decode = protocol_indala_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_jablotron.c b/firmware_p4/components/Applications/rfid/protocols/protocol_jablotron.c
new file mode 100644
index 00000000..546c4a30
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_jablotron.c
@@ -0,0 +1,83 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Jablotron — Czech security system 26-bit format
+// Uses 26-bit Wiegand with EM4100 customer code 0x07.
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code
+// Bits 16-1: 16-bit card number
+// Bit 0: odd parity (covers bits 12-0)
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_JABLOTRON";
+
+#define JABLOTRON_BITS 26
+#define JABLOTRON_CUSTOMER_ID 0x07
+#define JABLOTRON_FC_SHIFT 17
+#define JABLOTRON_FC_MASK 0xFF
+#define JABLOTRON_CARD_SHIFT 1
+#define JABLOTRON_CARD_MASK 0xFFFF
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_jablotron_decode(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != JABLOTRON_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ if ((count_bits(wiegand, 13, 25) % 2) != 0) {
+ return false;
+ }
+ if ((count_bits(wiegand, 0, 12) % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "Jablotron";
+ out_data->facility_code = (wiegand >> JABLOTRON_FC_SHIFT) & JABLOTRON_FC_MASK;
+ out_data->card_number = (wiegand >> JABLOTRON_CARD_SHIFT) & JABLOTRON_CARD_MASK;
+ out_data->bit_count = JABLOTRON_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", out_data->facility_code, (unsigned long)out_data->card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_jablotron = {
+ .name = "Jablotron",
+ .decode = protocol_jablotron_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_kantech.c b/firmware_p4/components/Applications/rfid/protocols/protocol_kantech.c
new file mode 100644
index 00000000..eb9a8814
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_kantech.c
@@ -0,0 +1,61 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Kantech ioProx XSF — 26-bit proprietary format
+// Uses EM4100 customer code 0x08.
+// Bits [31:24] = 8-bit family code
+// Bits [23:16] = 8-bit facility code
+// Bits [15:0] = 16-bit card number
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_KANTECH";
+
+#define KANTECH_BITS 40
+#define KANTECH_CUSTOMER_ID 0x08
+
+static bool protocol_kantech_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != KANTECH_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint8_t facility_code = raw->data[2];
+ uint16_t card_number = ((uint16_t)raw->data[3] << 8) | raw->data[4];
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ out_data->protocol_name = "Kantech ioProx";
+ out_data->facility_code = facility_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = KANTECH_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %u", facility_code, card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_kantech = {
+ .name = "Kantech ioProx",
+ .decode = protocol_kantech_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_keri.c b/firmware_p4/components/Applications/rfid/protocols/protocol_keri.c
new file mode 100644
index 00000000..b74dda2d
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_keri.c
@@ -0,0 +1,82 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Keri — 26-bit Wiegand format
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code (0-255)
+// Bits 16-1: 16-bit card number (0-65535)
+// Bit 0: odd parity (covers bits 12-0)
+// Distinguished from HID by EM4100 customer code 0x04.
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_KERI";
+
+#define KERI_BITS 26
+#define KERI_CUSTOMER_ID 0x04
+#define KERI_FC_SHIFT 17
+#define KERI_FC_MASK 0xFF
+#define KERI_CARD_SHIFT 1
+#define KERI_CARD_MASK 0xFFFF
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_keri_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != KERI_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ if ((count_bits(wiegand, 13, 25) % 2) != 0) {
+ return false;
+ }
+ if ((count_bits(wiegand, 0, 12) % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "Keri";
+ out_data->facility_code = (wiegand >> KERI_FC_SHIFT) & KERI_FC_MASK;
+ out_data->card_number = (wiegand >> KERI_CARD_SHIFT) & KERI_CARD_MASK;
+ out_data->bit_count = KERI_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", out_data->facility_code, (unsigned long)out_data->card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_keri = {
+ .name = "Keri",
+ .decode = protocol_keri_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_nexwatch.c b/firmware_p4/components/Applications/rfid/protocols/protocol_nexwatch.c
new file mode 100644
index 00000000..bc0c1084
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_nexwatch.c
@@ -0,0 +1,65 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Honeywell Nexwatch — 32-bit QuadraKey format
+// Uses EM4100 customer code 0x0A.
+// Lower 32 bits:
+// Bits [31:24] = 8-bit facility code
+// Bits [23:0] = 24-bit card number
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_NEXWATCH";
+
+#define NEXWATCH_BITS 32
+#define NEXWATCH_CUSTOMER_ID 0x0A
+#define NEXWATCH_FC_MASK 0xFF
+#define NEXWATCH_CARD_MASK 0x00FFFFFF
+
+static bool protocol_nexwatch_decode(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != NEXWATCH_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint8_t facility_code = raw->data[1];
+ uint32_t card_number =
+ ((uint32_t)raw->data[2] << 16) | ((uint32_t)raw->data[3] << 8) | raw->data[4];
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ out_data->protocol_name = "Nexwatch";
+ out_data->facility_code = facility_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = NEXWATCH_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", facility_code, (unsigned long)card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_nexwatch = {
+ .name = "Nexwatch",
+ .decode = protocol_nexwatch_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_noralsy.c b/firmware_p4/components/Applications/rfid/protocols/protocol_noralsy.c
new file mode 100644
index 00000000..dbabc9cf
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_noralsy.c
@@ -0,0 +1,61 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Noralsy — French access control system
+// Uses EM4100 customer code 0x0B.
+// Lower 32 bits:
+// Bits [31:16] = 16-bit site code
+// Bits [15:0] = 16-bit card number
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_NORALSY";
+
+#define NORALSY_BITS 40
+#define NORALSY_CUSTOMER_ID 0x0B
+
+static bool protocol_noralsy_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != NORALSY_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint16_t site_code = ((uint16_t)raw->data[1] << 8) | raw->data[2];
+ uint16_t card_number = ((uint16_t)raw->data[3] << 8) | raw->data[4];
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ out_data->protocol_name = "Noralsy";
+ out_data->facility_code = site_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = NORALSY_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "Site: %u, Card: %u", site_code, card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_noralsy = {
+ .name = "Noralsy",
+ .decode = protocol_noralsy_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_pac_stanley.c b/firmware_p4/components/Applications/rfid/protocols/protocol_pac_stanley.c
new file mode 100644
index 00000000..7983d5b9
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_pac_stanley.c
@@ -0,0 +1,83 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// PAC / Stanley — 26-bit Wiegand format
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code (0-255)
+// Bits 16-1: 16-bit card number (0-65535)
+// Bit 0: odd parity (covers bits 12-0)
+// Distinguished from HID by EM4100 customer code 0x03.
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_PAC";
+
+#define PAC_BITS 26
+#define PAC_CUSTOMER_ID 0x03
+#define PAC_FC_SHIFT 17
+#define PAC_FC_MASK 0xFF
+#define PAC_CARD_SHIFT 1
+#define PAC_CARD_MASK 0xFFFF
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_pac_stanley_decode(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != PAC_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ if ((count_bits(wiegand, 13, 25) % 2) != 0) {
+ return false;
+ }
+ if ((count_bits(wiegand, 0, 12) % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "PAC/Stanley";
+ out_data->facility_code = (wiegand >> PAC_FC_SHIFT) & PAC_FC_MASK;
+ out_data->card_number = (wiegand >> PAC_CARD_SHIFT) & PAC_CARD_MASK;
+ out_data->bit_count = PAC_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", out_data->facility_code, (unsigned long)out_data->card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_pac_stanley = {
+ .name = "PAC/Stanley",
+ .decode = protocol_pac_stanley_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_paradox.c b/firmware_p4/components/Applications/rfid/protocols/protocol_paradox.c
new file mode 100644
index 00000000..c5666b4f
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_paradox.c
@@ -0,0 +1,66 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Paradox — Proprietary security system format
+// Uses the full 40 bits from EM4100:
+// Bits [39:32] = 8-bit facility/site code
+// Bits [31:16] = 16-bit card number
+// Bits [15:0] = 16-bit checksum/serial
+// Distinguished by EM4100 customer code 0x05.
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_PARADOX";
+
+#define PARADOX_BITS 40
+#define PARADOX_CUSTOMER_ID 0x05
+#define PARADOX_FC_SHIFT 24
+#define PARADOX_FC_MASK 0xFF
+#define PARADOX_CARD_SHIFT 8
+#define PARADOX_CARD_MASK 0xFFFF
+
+static bool protocol_paradox_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != PARADOX_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ // Strip customer code byte, work with lower 32 bits
+ uint32_t payload = (uint32_t)(full_value & 0xFFFFFFFF);
+
+ out_data->protocol_name = "Paradox";
+ out_data->facility_code = (payload >> PARADOX_FC_SHIFT) & PARADOX_FC_MASK;
+ out_data->card_number = (payload >> PARADOX_CARD_SHIFT) & PARADOX_CARD_MASK;
+ out_data->bit_count = PARADOX_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", out_data->facility_code, (unsigned long)out_data->card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_paradox = {
+ .name = "Paradox",
+ .decode = protocol_paradox_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_pyramid.c b/firmware_p4/components/Applications/rfid/protocols/protocol_pyramid.c
new file mode 100644
index 00000000..f4ea3f6a
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_pyramid.c
@@ -0,0 +1,82 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Pyramid / Farpointe Data — 26-bit format
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code (0-255)
+// Bits 16-1: 16-bit card number (0-65535)
+// Bit 0: odd parity (covers bits 12-0)
+// Distinguished from HID by EM4100 customer code 0x02.
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_PYRAMID";
+
+#define PYRAMID_BITS 26
+#define PYRAMID_CUSTOMER_ID 0x02
+#define PYRAMID_FC_SHIFT 17
+#define PYRAMID_FC_MASK 0xFF
+#define PYRAMID_CARD_SHIFT 1
+#define PYRAMID_CARD_MASK 0xFFFF
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_pyramid_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != PYRAMID_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ if ((count_bits(wiegand, 13, 25) % 2) != 0) {
+ return false;
+ }
+ if ((count_bits(wiegand, 0, 12) % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "Pyramid";
+ out_data->facility_code = (wiegand >> PYRAMID_FC_SHIFT) & PYRAMID_FC_MASK;
+ out_data->card_number = (wiegand >> PYRAMID_CARD_SHIFT) & PYRAMID_CARD_MASK;
+ out_data->bit_count = PYRAMID_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", out_data->facility_code, (unsigned long)out_data->card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_pyramid = {
+ .name = "Pyramid",
+ .decode = protocol_pyramid_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_securakey.c b/firmware_p4/components/Applications/rfid/protocols/protocol_securakey.c
new file mode 100644
index 00000000..4d16da03
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_securakey.c
@@ -0,0 +1,62 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Securakey — Proprietary access control format
+// Uses EM4100 customer code 0x0C.
+// Lower 32 bits:
+// Bits [31:16] = 16-bit facility code
+// Bits [15:0] = 16-bit card number
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_SECURAKEY";
+
+#define SECURAKEY_BITS 40
+#define SECURAKEY_CUSTOMER_ID 0x0C
+
+static bool protocol_securakey_decode(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != SECURAKEY_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint16_t facility_code = ((uint16_t)raw->data[1] << 8) | raw->data[2];
+ uint16_t card_number = ((uint16_t)raw->data[3] << 8) | raw->data[4];
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ out_data->protocol_name = "Securakey";
+ out_data->facility_code = facility_code;
+ out_data->card_number = card_number;
+ out_data->bit_count = SECURAKEY_BITS;
+ out_data->raw_value = full_value;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %u", facility_code, card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_securakey = {
+ .name = "Securakey",
+ .decode = protocol_securakey_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/protocol_viking.c b/firmware_p4/components/Applications/rfid/protocols/protocol_viking.c
new file mode 100644
index 00000000..c9e243f4
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/protocol_viking.c
@@ -0,0 +1,82 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+// Viking — 26-bit Wiegand format for Nordic access control
+// Bit 25: even parity (covers bits 25-13)
+// Bits 24-17: 8-bit facility code (0-255)
+// Bits 16-1: 16-bit card number (0-65535)
+// Bit 0: odd parity (covers bits 12-0)
+// Distinguished from HID by EM4100 customer code 0x06.
+
+#include "rfid_protocol_decoder.h"
+
+#include "esp_log.h"
+
+static const char *TAG = "PROTO_VIKING";
+
+#define VIKING_BITS 26
+#define VIKING_CUSTOMER_ID 0x06
+#define VIKING_FC_SHIFT 17
+#define VIKING_FC_MASK 0xFF
+#define VIKING_CARD_SHIFT 1
+#define VIKING_CARD_MASK 0xFFFF
+
+static int count_bits(uint32_t value, int from_bit, int to_bit) {
+ int count = 0;
+ for (int i = from_bit; i <= to_bit; i++) {
+ if (value & (1u << i)) {
+ count++;
+ }
+ }
+ return count;
+}
+
+static bool protocol_viking_decode(const ys_rfid2_raw_data_t *raw, rfid_decoded_data_t *out_data) {
+ if (raw->bit_count != 40) {
+ return false;
+ }
+
+ if (raw->data[0] != VIKING_CUSTOMER_ID) {
+ return false;
+ }
+
+ uint64_t full_value = 0;
+ for (int i = 0; i < YS_RFID2_RAW_DATA_LEN; i++) {
+ full_value = (full_value << 8) | raw->data[i];
+ }
+
+ uint32_t wiegand = (uint32_t)(full_value & 0x03FFFFFF);
+
+ if ((count_bits(wiegand, 13, 25) % 2) != 0) {
+ return false;
+ }
+ if ((count_bits(wiegand, 0, 12) % 2) != 1) {
+ return false;
+ }
+
+ out_data->protocol_name = "Viking";
+ out_data->facility_code = (wiegand >> VIKING_FC_SHIFT) & VIKING_FC_MASK;
+ out_data->card_number = (wiegand >> VIKING_CARD_SHIFT) & VIKING_CARD_MASK;
+ out_data->bit_count = VIKING_BITS;
+ out_data->raw_value = wiegand;
+
+ ESP_LOGD(TAG, "FC: %u, Card: %lu", out_data->facility_code, (unsigned long)out_data->card_number);
+ return true;
+}
+
+rfid_protocol_t protocol_viking = {
+ .name = "Viking",
+ .decode = protocol_viking_decode,
+};
diff --git a/firmware_p4/components/Applications/rfid/protocols/rfid_protocol_registry.c b/firmware_p4/components/Applications/rfid/protocols/rfid_protocol_registry.c
new file mode 100644
index 00000000..92dfed4b
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/protocols/rfid_protocol_registry.c
@@ -0,0 +1,99 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rfid_protocol_registry.h"
+
+#include
+#include
+
+#include "esp_log.h"
+
+static const char *TAG = "RFID_REGISTRY";
+
+extern rfid_protocol_t protocol_em4100;
+extern rfid_protocol_t protocol_hid;
+extern rfid_protocol_t protocol_hid_corp;
+extern rfid_protocol_t protocol_indala;
+extern rfid_protocol_t protocol_awid;
+extern rfid_protocol_t protocol_fdxb;
+extern rfid_protocol_t protocol_viking;
+extern rfid_protocol_t protocol_pyramid;
+extern rfid_protocol_t protocol_keri;
+extern rfid_protocol_t protocol_pac_stanley;
+extern rfid_protocol_t protocol_paradox;
+extern rfid_protocol_t protocol_jablotron;
+extern rfid_protocol_t protocol_kantech;
+extern rfid_protocol_t protocol_gallagher;
+extern rfid_protocol_t protocol_nexwatch;
+extern rfid_protocol_t protocol_noralsy;
+extern rfid_protocol_t protocol_securakey;
+
+static const rfid_protocol_t *REGISTERED_PROTOCOLS[] = {
+ &protocol_em4100,
+ &protocol_hid,
+ &protocol_hid_corp,
+ &protocol_indala,
+ &protocol_awid,
+ &protocol_fdxb,
+ &protocol_viking,
+ &protocol_pyramid,
+ &protocol_keri,
+ &protocol_pac_stanley,
+ &protocol_paradox,
+ &protocol_jablotron,
+ &protocol_kantech,
+ &protocol_gallagher,
+ &protocol_nexwatch,
+ &protocol_noralsy,
+ &protocol_securakey,
+};
+
+#define REGISTERED_PROTOCOLS_COUNT (sizeof(REGISTERED_PROTOCOLS) / sizeof(REGISTERED_PROTOCOLS[0]))
+
+void rfid_protocol_registry_init(void) {}
+
+bool rfid_protocol_registry_decode_all(const ys_rfid2_raw_data_t *raw,
+ rfid_decoded_data_t *out_data) {
+ for (size_t i = 0; i < REGISTERED_PROTOCOLS_COUNT; i++) {
+ if (REGISTERED_PROTOCOLS[i]->decode != NULL && REGISTERED_PROTOCOLS[i]->decode(raw, out_data)) {
+ ESP_LOGD(TAG, "Decoded protocol: %s", REGISTERED_PROTOCOLS[i]->name);
+ return true;
+ }
+ }
+ return false;
+}
+
+const rfid_protocol_t *rfid_protocol_registry_get_by_name(const char *name) {
+ if (name == NULL) {
+ return NULL;
+ }
+ for (size_t i = 0; i < REGISTERED_PROTOCOLS_COUNT; i++) {
+ if (strcmp(REGISTERED_PROTOCOLS[i]->name, name) == 0) {
+ return REGISTERED_PROTOCOLS[i];
+ }
+ }
+ return NULL;
+}
+
+size_t rfid_protocol_registry_get_count(void) {
+ return REGISTERED_PROTOCOLS_COUNT;
+}
+
+const rfid_protocol_t *rfid_protocol_registry_get_by_index(size_t index) {
+ if (index >= REGISTERED_PROTOCOLS_COUNT) {
+ return NULL;
+ }
+ return REGISTERED_PROTOCOLS[index];
+}
diff --git a/firmware_p4/components/Applications/rfid/rfid_manager.c b/firmware_p4/components/Applications/rfid/rfid_manager.c
new file mode 100644
index 00000000..0928f674
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/rfid_manager.c
@@ -0,0 +1,123 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rfid_manager.h"
+
+#include
+
+#include "esp_log.h"
+
+#include "ys_rfid2.h"
+#include "rfid_protocol_registry.h"
+
+static const char *TAG = "RFID_MANAGER";
+
+static struct {
+ rfid_manager_event_cb_t cb;
+ void *ctx;
+ bool is_running;
+ rfid_card_event_t last_event;
+ bool has_last_event;
+} s_mgr = {0};
+
+static void driver_event_handler(const ys_rfid2_event_t *event, void *ctx);
+
+esp_err_t rfid_manager_start(rfid_manager_event_cb_t cb, void *ctx) {
+ if (cb == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (s_mgr.is_running) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ rfid_protocol_registry_init();
+
+ s_mgr.cb = cb;
+ s_mgr.ctx = ctx;
+ s_mgr.has_last_event = false;
+
+ esp_err_t ret = ys_rfid2_start(driver_event_handler, NULL);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to start driver: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ s_mgr.is_running = true;
+ ESP_LOGI(TAG, "Started");
+ return ESP_OK;
+}
+
+void rfid_manager_stop(void) {
+ if (!s_mgr.is_running) {
+ return;
+ }
+
+ ys_rfid2_stop();
+
+ s_mgr.is_running = false;
+ s_mgr.cb = NULL;
+ s_mgr.ctx = NULL;
+
+ ESP_LOGI(TAG, "Stopped");
+}
+
+bool rfid_manager_is_running(void) {
+ return s_mgr.is_running;
+}
+
+esp_err_t rfid_manager_get_last_card(rfid_card_event_t *out_event) {
+ if (out_event == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (!s_mgr.has_last_event) {
+ return ESP_ERR_NOT_FOUND;
+ }
+
+ *out_event = s_mgr.last_event;
+ return ESP_OK;
+}
+
+static void driver_event_handler(const ys_rfid2_event_t *event, void *ctx) {
+ (void)ctx;
+
+ rfid_card_event_t card_event = {
+ .driver_event = *event,
+ .decoded = {0},
+ .is_decoded = false,
+ };
+
+ if (event->type == YS_RFID2_EVENT_CARD_DETECTED) {
+ card_event.is_decoded = rfid_protocol_registry_decode_all(&event->raw, &card_event.decoded);
+
+ if (card_event.is_decoded) {
+ ESP_LOGI(TAG,
+ "Card: %s — FC:%u ID:%u",
+ card_event.decoded.protocol_name,
+ (unsigned)card_event.decoded.facility_code,
+ (unsigned)card_event.decoded.card_number);
+ } else {
+ ESP_LOGI(TAG, "Card: unknown — raw: %s", event->raw.id_str);
+ }
+
+ s_mgr.last_event = card_event;
+ s_mgr.has_last_event = true;
+ }
+
+ if (s_mgr.cb != NULL) {
+ s_mgr.cb(&card_event, s_mgr.ctx);
+ }
+}
diff --git a/firmware_p4/components/Applications/rfid/rfid_storage.c b/firmware_p4/components/Applications/rfid/rfid_storage.c
new file mode 100644
index 00000000..5c06d3c6
--- /dev/null
+++ b/firmware_p4/components/Applications/rfid/rfid_storage.c
@@ -0,0 +1,222 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "rfid_storage.h"
+
+#include
+
+#include "esp_log.h"
+#include "nvs_flash.h"
+#include "nvs.h"
+
+static const char *TAG = "RFID_STORAGE";
+
+#define NVS_NAMESPACE "rfid_cards"
+#define NVS_KEY_COUNT "count"
+#define NVS_KEY_PREFIX "card_"
+#define NVS_KEY_MAX 16
+
+static int s_count = 0;
+static bool s_is_init = false;
+
+static void build_key(int index, char *out_key) {
+ snprintf(out_key, NVS_KEY_MAX, "%s%d", NVS_KEY_PREFIX, index);
+}
+
+void rfid_storage_init(void) {
+ if (s_is_init) {
+ return;
+ }
+
+ nvs_handle_t handle;
+ esp_err_t ret = nvs_open(NVS_NAMESPACE, NVS_READONLY, &handle);
+ if (ret == ESP_OK) {
+ int32_t count = 0;
+ if (nvs_get_i32(handle, NVS_KEY_COUNT, &count) == ESP_OK) {
+ s_count = (int)count;
+ }
+ nvs_close(handle);
+ }
+
+ s_is_init = true;
+ ESP_LOGI(TAG, "Initialized — %d entries", s_count);
+}
+
+int rfid_storage_count(void) {
+ return s_count;
+}
+
+esp_err_t rfid_storage_save(const char *name,
+ const ys_rfid2_raw_data_t *raw,
+ const rfid_decoded_data_t *decoded,
+ bool is_decoded) {
+ if (name == NULL || raw == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (s_count >= RFID_STORAGE_MAX_ENTRIES) {
+ ESP_LOGW(TAG, "Storage full (%d entries)", s_count);
+ return ESP_ERR_NO_MEM;
+ }
+
+ rfid_storage_entry_t entry = {0};
+ strncpy(entry.name, name, RFID_STORAGE_NAME_MAX - 1);
+ entry.raw = *raw;
+ entry.is_decoded = is_decoded;
+ if (is_decoded && decoded != NULL) {
+ entry.decoded = *decoded;
+ }
+
+ nvs_handle_t handle;
+ esp_err_t ret = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &handle);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to open NVS: %s", esp_err_to_name(ret));
+ return ESP_FAIL;
+ }
+
+ char key[NVS_KEY_MAX];
+ build_key(s_count, key);
+
+ ret = nvs_set_blob(handle, key, &entry, sizeof(entry));
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to write entry: %s", esp_err_to_name(ret));
+ nvs_close(handle);
+ return ESP_FAIL;
+ }
+
+ s_count++;
+ nvs_set_i32(handle, NVS_KEY_COUNT, (int32_t)s_count);
+ nvs_commit(handle);
+ nvs_close(handle);
+
+ ESP_LOGI(TAG, "Saved '%s' at index %d", name, s_count - 1);
+ return ESP_OK;
+}
+
+esp_err_t rfid_storage_load(int index, rfid_storage_entry_t *out_entry) {
+ if (out_entry == NULL || index < 0 || index >= s_count) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ nvs_handle_t handle;
+ esp_err_t ret = nvs_open(NVS_NAMESPACE, NVS_READONLY, &handle);
+ if (ret != ESP_OK) {
+ return ESP_FAIL;
+ }
+
+ char key[NVS_KEY_MAX];
+ build_key(index, key);
+
+ size_t len = sizeof(rfid_storage_entry_t);
+ ret = nvs_get_blob(handle, key, out_entry, &len);
+ nvs_close(handle);
+
+ if (ret != ESP_OK) {
+ return ESP_ERR_NOT_FOUND;
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t rfid_storage_get_info(int index, rfid_storage_info_t *out_info) {
+ if (out_info == NULL || index < 0 || index >= s_count) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ rfid_storage_entry_t entry = {0};
+ esp_err_t ret = rfid_storage_load(index, &entry);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ strncpy(out_info->name, entry.name, RFID_STORAGE_NAME_MAX - 1);
+ out_info->protocol_name = entry.is_decoded ? entry.decoded.protocol_name : "Unknown";
+ out_info->card_number = entry.decoded.card_number;
+ out_info->facility_code = entry.decoded.facility_code;
+
+ return ESP_OK;
+}
+
+int rfid_storage_list(rfid_storage_info_t *out_infos, int max) {
+ if (out_infos == NULL) {
+ return 0;
+ }
+
+ int listed = 0;
+ for (int i = 0; i < s_count && listed < max; i++) {
+ if (rfid_storage_get_info(i, &out_infos[listed]) == ESP_OK) {
+ listed++;
+ }
+ }
+
+ return listed;
+}
+
+esp_err_t rfid_storage_delete(int index) {
+ if (index < 0 || index >= s_count) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ nvs_handle_t handle;
+ esp_err_t ret = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &handle);
+ if (ret != ESP_OK) {
+ return ESP_FAIL;
+ }
+
+ // Shift entries down to fill the gap
+ for (int i = index; i < s_count - 1; i++) {
+ rfid_storage_entry_t entry = {0};
+ char src_key[NVS_KEY_MAX];
+ char dst_key[NVS_KEY_MAX];
+ build_key(i + 1, src_key);
+ build_key(i, dst_key);
+
+ size_t len = sizeof(rfid_storage_entry_t);
+ if (nvs_get_blob(handle, src_key, &entry, &len) == ESP_OK) {
+ nvs_set_blob(handle, dst_key, &entry, sizeof(entry));
+ }
+ }
+
+ // Remove last entry
+ char last_key[NVS_KEY_MAX];
+ build_key(s_count - 1, last_key);
+ nvs_erase_key(handle, last_key);
+
+ s_count--;
+ nvs_set_i32(handle, NVS_KEY_COUNT, (int32_t)s_count);
+ nvs_commit(handle);
+ nvs_close(handle);
+
+ ESP_LOGI(TAG, "Deleted index %d, %d entries remaining", index, s_count);
+ return ESP_OK;
+}
+
+esp_err_t rfid_storage_find_by_id(const char *id_str, int *out_index) {
+ if (id_str == NULL || out_index == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ for (int i = 0; i < s_count; i++) {
+ rfid_storage_entry_t entry = {0};
+ if (rfid_storage_load(i, &entry) == ESP_OK) {
+ if (strcmp(entry.raw.id_str, id_str) == 0) {
+ *out_index = i;
+ return ESP_OK;
+ }
+ }
+ }
+
+ return ESP_ERR_NOT_FOUND;
+}
diff --git a/firmware_p4/components/Applications/ui/assets_manager.c b/firmware_p4/components/Applications/ui/assets_manager.c
index b67a09cf..80d47358 100644
--- a/firmware_p4/components/Applications/ui/assets_manager.c
+++ b/firmware_p4/components/Applications/ui/assets_manager.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "assets_manager.h"
diff --git a/firmware_p4/components/Applications/ui/components/button/button_ui.c b/firmware_p4/components/Applications/ui/components/button/button_ui.c
index a6e5cf49..a67b96b4 100644
--- a/firmware_p4/components/Applications/ui/components/button/button_ui.c
+++ b/firmware_p4/components/Applications/ui/components/button/button_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "button_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/button/include/button_ui.h b/firmware_p4/components/Applications/ui/components/button/include/button_ui.h
index cd98ab2e..5b11ccd6 100644
--- a/firmware_p4/components/Applications/ui/components/button/include/button_ui.h
+++ b/firmware_p4/components/Applications/ui/components/button/include/button_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BUTTON_H
#define UI_BUTTON_H
diff --git a/firmware_p4/components/Applications/ui/components/chart/area_chart_ui.c b/firmware_p4/components/Applications/ui/components/chart/area_chart_ui.c
index 8a65164a..85f1b0b0 100644
--- a/firmware_p4/components/Applications/ui/components/chart/area_chart_ui.c
+++ b/firmware_p4/components/Applications/ui/components/chart/area_chart_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "area_chart_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/chart/chart_ui.c b/firmware_p4/components/Applications/ui/components/chart/chart_ui.c
index 59a8896f..cbb0a584 100644
--- a/firmware_p4/components/Applications/ui/components/chart/chart_ui.c
+++ b/firmware_p4/components/Applications/ui/components/chart/chart_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "chart_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/chart/include/area_chart_ui.h b/firmware_p4/components/Applications/ui/components/chart/include/area_chart_ui.h
index 56353ff4..a8d59200 100644
--- a/firmware_p4/components/Applications/ui/components/chart/include/area_chart_ui.h
+++ b/firmware_p4/components/Applications/ui/components/chart/include/area_chart_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_AREA_CHART_H
#define UI_AREA_CHART_H
diff --git a/firmware_p4/components/Applications/ui/components/chart/include/chart_ui.h b/firmware_p4/components/Applications/ui/components/chart/include/chart_ui.h
index 8940a017..c8e88558 100644
--- a/firmware_p4/components/Applications/ui/components/chart/include/chart_ui.h
+++ b/firmware_p4/components/Applications/ui/components/chart/include/chart_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_CHART_H
#define UI_CHART_H
diff --git a/firmware_p4/components/Applications/ui/components/dropdown/dropdown_ui.c b/firmware_p4/components/Applications/ui/components/dropdown/dropdown_ui.c
index f3336eb8..e373f445 100644
--- a/firmware_p4/components/Applications/ui/components/dropdown/dropdown_ui.c
+++ b/firmware_p4/components/Applications/ui/components/dropdown/dropdown_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "dropdown_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/dropdown/include/dropdown_ui.h b/firmware_p4/components/Applications/ui/components/dropdown/include/dropdown_ui.h
index a68762a1..4973fd8c 100644
--- a/firmware_p4/components/Applications/ui/components/dropdown/include/dropdown_ui.h
+++ b/firmware_p4/components/Applications/ui/components/dropdown/include/dropdown_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_DROPDOWN_H
#define UI_DROPDOWN_H
diff --git a/firmware_p4/components/Applications/ui/components/footer/footer_ui.c b/firmware_p4/components/Applications/ui/components/footer/footer_ui.c
index f342e227..a47e88cb 100644
--- a/firmware_p4/components/Applications/ui/components/footer/footer_ui.c
+++ b/firmware_p4/components/Applications/ui/components/footer/footer_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "footer_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/footer/include/footer_ui.h b/firmware_p4/components/Applications/ui/components/footer/include/footer_ui.h
index 98c395d2..a5f990d0 100644
--- a/firmware_p4/components/Applications/ui/components/footer/include/footer_ui.h
+++ b/firmware_p4/components/Applications/ui/components/footer/include/footer_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_FOOTER_H
#define UI_FOOTER_H
diff --git a/firmware_p4/components/Applications/ui/components/header/header_ui.c b/firmware_p4/components/Applications/ui/components/header/header_ui.c
index ed4bff9c..06dc749e 100644
--- a/firmware_p4/components/Applications/ui/components/header/header_ui.c
+++ b/firmware_p4/components/Applications/ui/components/header/header_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "header_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/header/include/header_ui.h b/firmware_p4/components/Applications/ui/components/header/include/header_ui.h
index f803039a..e5d924c2 100644
--- a/firmware_p4/components/Applications/ui/components/header/include/header_ui.h
+++ b/firmware_p4/components/Applications/ui/components/header/include/header_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_HEADER_H
#define UI_HEADER_H
diff --git a/firmware_p4/components/Applications/ui/components/intensity_bar/include/intensity_bar_ui.h b/firmware_p4/components/Applications/ui/components/intensity_bar/include/intensity_bar_ui.h
index 906da2a6..270b77c4 100644
--- a/firmware_p4/components/Applications/ui/components/intensity_bar/include/intensity_bar_ui.h
+++ b/firmware_p4/components/Applications/ui/components/intensity_bar/include/intensity_bar_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_INTENSITY_BAR_H
#define UI_INTENSITY_BAR_H
diff --git a/firmware_p4/components/Applications/ui/components/intensity_bar/intensity_bar_ui.c b/firmware_p4/components/Applications/ui/components/intensity_bar/intensity_bar_ui.c
index bb63e4f6..e36463f0 100644
--- a/firmware_p4/components/Applications/ui/components/intensity_bar/intensity_bar_ui.c
+++ b/firmware_p4/components/Applications/ui/components/intensity_bar/intensity_bar_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "intensity_bar_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/keyboard/include/keyboard_ui.h b/firmware_p4/components/Applications/ui/components/keyboard/include/keyboard_ui.h
index 1af0ff39..45385581 100644
--- a/firmware_p4/components/Applications/ui/components/keyboard/include/keyboard_ui.h
+++ b/firmware_p4/components/Applications/ui/components/keyboard/include/keyboard_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef KEYBOARD_UI_H
#define KEYBOARD_UI_H
diff --git a/firmware_p4/components/Applications/ui/components/keyboard/keyboard_ui.c b/firmware_p4/components/Applications/ui/components/keyboard/keyboard_ui.c
index 0193d81a..5c7cebf8 100644
--- a/firmware_p4/components/Applications/ui/components/keyboard/keyboard_ui.c
+++ b/firmware_p4/components/Applications/ui/components/keyboard/keyboard_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "keyboard_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/menu_component/include/menu_component_ui.h b/firmware_p4/components/Applications/ui/components/menu_component/include/menu_component_ui.h
index 55aa7d28..b06ba18a 100644
--- a/firmware_p4/components/Applications/ui/components/menu_component/include/menu_component_ui.h
+++ b/firmware_p4/components/Applications/ui/components/menu_component/include/menu_component_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_MENU_COMPONENT_H
#define UI_MENU_COMPONENT_H
diff --git a/firmware_p4/components/Applications/ui/components/menu_component/menu_component_ui.c b/firmware_p4/components/Applications/ui/components/menu_component/menu_component_ui.c
index 704e3bd4..246af12a 100644
--- a/firmware_p4/components/Applications/ui/components/menu_component/menu_component_ui.c
+++ b/firmware_p4/components/Applications/ui/components/menu_component/menu_component_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "menu_component_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/message_box/include/msgbox_ui.h b/firmware_p4/components/Applications/ui/components/message_box/include/msgbox_ui.h
index 37f2dd46..193374b5 100644
--- a/firmware_p4/components/Applications/ui/components/message_box/include/msgbox_ui.h
+++ b/firmware_p4/components/Applications/ui/components/message_box/include/msgbox_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef MSGBOX_UI_H
#define MSGBOX_UI_H
diff --git a/firmware_p4/components/Applications/ui/components/message_box/msgbox_ui.c b/firmware_p4/components/Applications/ui/components/message_box/msgbox_ui.c
index 6ae88763..167dfe67 100644
--- a/firmware_p4/components/Applications/ui/components/message_box/msgbox_ui.c
+++ b/firmware_p4/components/Applications/ui/components/message_box/msgbox_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "msgbox_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/page_dots/include/page_dots_ui.h b/firmware_p4/components/Applications/ui/components/page_dots/include/page_dots_ui.h
index f73c3698..b2736258 100644
--- a/firmware_p4/components/Applications/ui/components/page_dots/include/page_dots_ui.h
+++ b/firmware_p4/components/Applications/ui/components/page_dots/include/page_dots_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_PAGE_DOTS_H
#define UI_PAGE_DOTS_H
diff --git a/firmware_p4/components/Applications/ui/components/page_dots/page_dots_ui.c b/firmware_p4/components/Applications/ui/components/page_dots/page_dots_ui.c
index 39c5e917..0a24e3e0 100644
--- a/firmware_p4/components/Applications/ui/components/page_dots/page_dots_ui.c
+++ b/firmware_p4/components/Applications/ui/components/page_dots/page_dots_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "page_dots_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/spinner/include/spinner_ui.h b/firmware_p4/components/Applications/ui/components/spinner/include/spinner_ui.h
index c996f9c5..fbc53dcd 100644
--- a/firmware_p4/components/Applications/ui/components/spinner/include/spinner_ui.h
+++ b/firmware_p4/components/Applications/ui/components/spinner/include/spinner_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SPINNER_UI_H
#define SPINNER_UI_H
diff --git a/firmware_p4/components/Applications/ui/components/spinner/spinner_ui.c b/firmware_p4/components/Applications/ui/components/spinner/spinner_ui.c
index 64ba367d..a34fba48 100644
--- a/firmware_p4/components/Applications/ui/components/spinner/spinner_ui.c
+++ b/firmware_p4/components/Applications/ui/components/spinner/spinner_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "spinner_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/terminal/include/terminal_ui.h b/firmware_p4/components/Applications/ui/components/terminal/include/terminal_ui.h
index b8f2aa75..530a8929 100644
--- a/firmware_p4/components/Applications/ui/components/terminal/include/terminal_ui.h
+++ b/firmware_p4/components/Applications/ui/components/terminal/include/terminal_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_TERMINAL_H
#define UI_TERMINAL_H
diff --git a/firmware_p4/components/Applications/ui/components/terminal/terminal_ui.c b/firmware_p4/components/Applications/ui/components/terminal/terminal_ui.c
index 5caa1a0d..cac236de 100644
--- a/firmware_p4/components/Applications/ui/components/terminal/terminal_ui.c
+++ b/firmware_p4/components/Applications/ui/components/terminal/terminal_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "terminal_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/text_viewer/include/text_viewer_ui.h b/firmware_p4/components/Applications/ui/components/text_viewer/include/text_viewer_ui.h
index 309fc66b..2a3adeaa 100644
--- a/firmware_p4/components/Applications/ui/components/text_viewer/include/text_viewer_ui.h
+++ b/firmware_p4/components/Applications/ui/components/text_viewer/include/text_viewer_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_TEXT_VIEWER_H
#define UI_TEXT_VIEWER_H
diff --git a/firmware_p4/components/Applications/ui/components/text_viewer/text_viewer_ui.c b/firmware_p4/components/Applications/ui/components/text_viewer/text_viewer_ui.c
index 634209f9..2551ed14 100644
--- a/firmware_p4/components/Applications/ui/components/text_viewer/text_viewer_ui.c
+++ b/firmware_p4/components/Applications/ui/components/text_viewer/text_viewer_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "text_viewer_ui.h"
diff --git a/firmware_p4/components/Applications/ui/components/toggle/include/toggle_ui.h b/firmware_p4/components/Applications/ui/components/toggle/include/toggle_ui.h
index 616e7494..c80c6773 100644
--- a/firmware_p4/components/Applications/ui/components/toggle/include/toggle_ui.h
+++ b/firmware_p4/components/Applications/ui/components/toggle/include/toggle_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_TOGGLE_H
#define UI_TOGGLE_H
diff --git a/firmware_p4/components/Applications/ui/components/toggle/toggle_ui.c b/firmware_p4/components/Applications/ui/components/toggle/toggle_ui.c
index d6213771..6a83a4be 100644
--- a/firmware_p4/components/Applications/ui/components/toggle/toggle_ui.c
+++ b/firmware_p4/components/Applications/ui/components/toggle/toggle_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "toggle_ui.h"
diff --git a/firmware_p4/components/Applications/ui/include/assets_manager.h b/firmware_p4/components/Applications/ui/include/assets_manager.h
index fbd9a4bc..162eeeea 100644
--- a/firmware_p4/components/Applications/ui/include/assets_manager.h
+++ b/firmware_p4/components/Applications/ui/include/assets_manager.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ASSETS_MANAGER_H
#define ASSETS_MANAGER_H
diff --git a/firmware_p4/components/Applications/ui/include/ui_manager.h b/firmware_p4/components/Applications/ui/include/ui_manager.h
index d4a41bad..b12ab5d5 100644
--- a/firmware_p4/components/Applications/ui/include/ui_manager.h
+++ b/firmware_p4/components/Applications/ui/include/ui_manager.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_MANAGER_H
#define UI_MANAGER_H
diff --git a/firmware_p4/components/Applications/ui/include/ui_theme.h b/firmware_p4/components/Applications/ui/include/ui_theme.h
index 40ebfbbc..cd6b499e 100644
--- a/firmware_p4/components/Applications/ui/include/ui_theme.h
+++ b/firmware_p4/components/Applications/ui/include/ui_theme.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_THEME_H
#define UI_THEME_H
diff --git a/firmware_p4/components/Applications/ui/screens/SubGhz/include/subghz_spectrum_ui.h b/firmware_p4/components/Applications/ui/screens/SubGhz/include/subghz_spectrum_ui.h
index efa5ca88..dcb7c2a9 100644
--- a/firmware_p4/components/Applications/ui/screens/SubGhz/include/subghz_spectrum_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/SubGhz/include/subghz_spectrum_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUBGHZ_SPECTRUM_UI_H
#define SUBGHZ_SPECTRUM_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/SubGhz/subghz_spectrum_ui.c b/firmware_p4/components/Applications/ui/screens/SubGhz/subghz_spectrum_ui.c
index 7a2c8a1e..ec6f7458 100644
--- a/firmware_p4/components/Applications/ui/screens/SubGhz/subghz_spectrum_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/SubGhz/subghz_spectrum_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "subghz_spectrum_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/about_settings/about_settings_ui.c b/firmware_p4/components/Applications/ui/screens/about_settings/about_settings_ui.c
index 66f6d758..f6d89600 100644
--- a/firmware_p4/components/Applications/ui/screens/about_settings/about_settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/about_settings/about_settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "about_settings_ui.h"
@@ -73,7 +74,7 @@ void ui_about_settings_open(void) {
lv_obj_set_style_text_color(version, current_theme.text_main, 0);
lv_obj_t *hardware = lv_label_create(info_box);
- lv_label_set_text(hardware, "HW: ESP32-S3");
+ lv_label_set_text(hardware, "HW: ESP32-P4");
lv_obj_set_style_text_color(hardware, current_theme.text_main, 0);
lv_obj_t *build = lv_label_create(info_box);
diff --git a/firmware_p4/components/Applications/ui/screens/about_settings/include/about_settings_ui.h b/firmware_p4/components/Applications/ui/screens/about_settings/include/about_settings_ui.h
index a8a0c663..805d336a 100644
--- a/firmware_p4/components/Applications/ui/screens/about_settings/include/about_settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/about_settings/include/about_settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ABOUT_SETTINGS_UI_H
#define ABOUT_SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_browser.h b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_browser.h
index 1af82811..f4ec567a 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_browser.h
+++ b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_browser.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BADUSB_BROWSER_H
#define UI_BADUSB_BROWSER_H
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_connect.h b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_connect.h
index 766a37b7..7b063116 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_connect.h
+++ b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_connect.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BADUSB_CONNECT_H
#define UI_BADUSB_CONNECT_H
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_layout.h b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_layout.h
index 3661db69..9b5abc2d 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_layout.h
+++ b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_layout.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BADUSB_LAYOUT_H
#define UI_BADUSB_LAYOUT_H
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_menu.h b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_menu.h
index 1eb90b4d..ba7ed0e6 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_menu.h
+++ b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_menu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BADUSB_MENU_H
#define UI_BADUSB_MENU_H
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_running.h b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_running.h
index 5619871e..1addf2ad 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_running.h
+++ b/firmware_p4/components/Applications/ui/screens/badusb/include/ui_badusb_running.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BADUSB_RUNNING_H
#define UI_BADUSB_RUNNING_H
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_browser.c b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_browser.c
index f01d9062..a4d4d38d 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_browser.c
+++ b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_browser.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_badusb_browser.h"
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_connect.c b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_connect.c
index eae003c4..9a7efb08 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_connect.c
+++ b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_connect.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_badusb_connect.h"
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_layout.c b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_layout.c
index 019937ff..60df26d9 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_layout.c
+++ b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_layout.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_badusb_layout.h"
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_menu.c b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_menu.c
index 651c96f6..97b95593 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_menu.c
+++ b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_menu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_badusb_menu.h"
diff --git a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_running.c b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_running.c
index 8a108d0d..24788500 100644
--- a/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_running.c
+++ b/firmware_p4/components/Applications/ui/screens/badusb/ui_badusb_running.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_badusb_running.h"
diff --git a/firmware_p4/components/Applications/ui/screens/battery_settings/battery_settings_ui.c b/firmware_p4/components/Applications/ui/screens/battery_settings/battery_settings_ui.c
index 3aa128ec..1f65cac9 100644
--- a/firmware_p4/components/Applications/ui/screens/battery_settings/battery_settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/battery_settings/battery_settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "battery_settings_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/battery_settings/include/battery_settings_ui.h b/firmware_p4/components/Applications/ui/screens/battery_settings/include/battery_settings_ui.h
index 7ea3fe24..a221fcfb 100644
--- a/firmware_p4/components/Applications/ui/screens/battery_settings/include/battery_settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/battery_settings/include/battery_settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BATTERY_SETTINGS_UI_H
#define BATTERY_SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_menu.h b/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_menu.h
index 1537743a..4cbbb3ca 100644
--- a/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_menu.h
+++ b/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_menu.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BLE_MENU_H
#define UI_BLE_MENU_H
diff --git a/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam.h b/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam.h
index c479be55..249aa824 100644
--- a/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam.h
+++ b/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BLE_SPAM_H
#define UI_BLE_SPAM_H
diff --git a/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam_select.h b/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam_select.h
index afa46d5b..f2a774c6 100644
--- a/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam_select.h
+++ b/firmware_p4/components/Applications/ui/screens/bluetooth/include/ui_ble_spam_select.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef UI_BLE_SPAM_SELECT_H
#define UI_BLE_SPAM_SELECT_H
diff --git a/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_menu.c b/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_menu.c
index 91ba7c7f..7fd33e3d 100644
--- a/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_menu.c
+++ b/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_menu.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_ble_menu.h"
diff --git a/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam.c b/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam.c
index 856d4585..f997a348 100644
--- a/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam.c
+++ b/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_ble_spam.h"
diff --git a/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam_select.c b/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam_select.c
index 3d0b0787..6841520a 100644
--- a/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam_select.c
+++ b/firmware_p4/components/Applications/ui/screens/bluetooth/ui_ble_spam_select.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_ble_spam_select.h"
diff --git a/firmware_p4/components/Applications/ui/screens/boot/boot_ui.c b/firmware_p4/components/Applications/ui/screens/boot/boot_ui.c
index 8a462a9f..66cf50b6 100644
--- a/firmware_p4/components/Applications/ui/screens/boot/boot_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/boot/boot_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "boot_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/boot/include/boot_ui.h b/firmware_p4/components/Applications/ui/screens/boot/include/boot_ui.h
index b7eb9389..90bc147d 100644
--- a/firmware_p4/components/Applications/ui/screens/boot/include/boot_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/boot/include/boot_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BOOT_UI_H
#define BOOT_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/connect_bluetooth/connect_bt_ui.c b/firmware_p4/components/Applications/ui/screens/connect_bluetooth/connect_bt_ui.c
index ebe3d7fe..d6bee2f7 100644
--- a/firmware_p4/components/Applications/ui/screens/connect_bluetooth/connect_bt_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/connect_bluetooth/connect_bt_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "connect_bt_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/connect_bluetooth/include/connect_bt_ui.h b/firmware_p4/components/Applications/ui/screens/connect_bluetooth/include/connect_bt_ui.h
index 1b961319..df7e9d8e 100644
--- a/firmware_p4/components/Applications/ui/screens/connect_bluetooth/include/connect_bt_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/connect_bluetooth/include/connect_bt_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef CONNECT_BT_UI_H
#define CONNECT_BT_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/connect_wifi/connect_wifi_ui.c b/firmware_p4/components/Applications/ui/screens/connect_wifi/connect_wifi_ui.c
index 35d0a975..a57a356e 100644
--- a/firmware_p4/components/Applications/ui/screens/connect_wifi/connect_wifi_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/connect_wifi/connect_wifi_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "connect_wifi_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/connect_wifi/include/connect_wifi_ui.h b/firmware_p4/components/Applications/ui/screens/connect_wifi/include/connect_wifi_ui.h
index 3befefc3..a9ccd0d4 100644
--- a/firmware_p4/components/Applications/ui/screens/connect_wifi/include/connect_wifi_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/connect_wifi/include/connect_wifi_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef CONNECT_WIFI_UI_H
#define CONNECT_WIFI_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/connection_settings/connection_settings_ui.c b/firmware_p4/components/Applications/ui/screens/connection_settings/connection_settings_ui.c
index c8dfd9ed..bdf13754 100644
--- a/firmware_p4/components/Applications/ui/screens/connection_settings/connection_settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/connection_settings/connection_settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "connection_settings_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/connection_settings/include/connection_settings_ui.h b/firmware_p4/components/Applications/ui/screens/connection_settings/include/connection_settings_ui.h
index 36f75dc3..8184341f 100644
--- a/firmware_p4/components/Applications/ui/screens/connection_settings/include/connection_settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/connection_settings/include/connection_settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef CONNECTION_SETTINGS_UI_H
#define CONNECTION_SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/display_settings/display_settings_ui.c b/firmware_p4/components/Applications/ui/screens/display_settings/display_settings_ui.c
index 345a7078..47d4c94e 100644
--- a/firmware_p4/components/Applications/ui/screens/display_settings/display_settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/display_settings/display_settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "display_settings_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/display_settings/include/display_settings_ui.h b/firmware_p4/components/Applications/ui/screens/display_settings/include/display_settings_ui.h
index 3e97b792..3fee9870 100644
--- a/firmware_p4/components/Applications/ui/screens/display_settings/include/display_settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/display_settings/include/display_settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef DISPLAY_SETTINGS_UI_H
#define DISPLAY_SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/files/files_ui.c b/firmware_p4/components/Applications/ui/screens/files/files_ui.c
index e0bae45b..755cb519 100644
--- a/firmware_p4/components/Applications/ui/screens/files/files_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/files/files_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "files_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/files/include/files_ui.h b/firmware_p4/components/Applications/ui/screens/files/include/files_ui.h
index 1688554c..9b47a3dc 100644
--- a/firmware_p4/components/Applications/ui/screens/files/include/files_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/files/include/files_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef FILES_UI_H
#define FILES_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/home/home_ui.c b/firmware_p4/components/Applications/ui/screens/home/home_ui.c
index 6700359b..f7ae0efb 100644
--- a/firmware_p4/components/Applications/ui/screens/home/home_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/home/home_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "home_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/home/include/home_ui.h b/firmware_p4/components/Applications/ui/screens/home/include/home_ui.h
index 0205bfa7..1064c616 100644
--- a/firmware_p4/components/Applications/ui/screens/home/include/home_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/home/include/home_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HOME_UI_H
#define HOME_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_burst_ui.h b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_burst_ui.h
index d40013db..7202e504 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_burst_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_burst_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_BURST_UI_H
#define IR_BURST_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_controller_ui.h b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_controller_ui.h
index 85604e74..e27eec77 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_controller_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_controller_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_CONTROLLER_UI_H
#define IR_CONTROLLER_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_menu_ui.h b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_menu_ui.h
index 430a66ba..d2b898ee 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_menu_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_menu_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_MENU_UI_H
#define IR_MENU_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_receive_ui.h b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_receive_ui.h
index 58939e9c..a9a8c56a 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_receive_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_receive_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_RECEIVE_UI_H
#define IR_RECEIVE_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_saved_ui.h b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_saved_ui.h
index 50ee4e08..7fd00526 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_saved_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_saved_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_SAVED_UI_H
#define IR_SAVED_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_send_ui.h b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_send_ui.h
index 493b7234..1081222a 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/include/ir_send_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/infrared/include/ir_send_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_SEND_UI_H
#define IR_SEND_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/ir_burst_ui.c b/firmware_p4/components/Applications/ui/screens/infrared/ir_burst_ui.c
index 88feb8b3..d7315a72 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/ir_burst_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/infrared/ir_burst_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_burst_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/ir_controller_ui.c b/firmware_p4/components/Applications/ui/screens/infrared/ir_controller_ui.c
index f7dca875..2f884c43 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/ir_controller_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/infrared/ir_controller_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_controller_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/ir_menu_ui.c b/firmware_p4/components/Applications/ui/screens/infrared/ir_menu_ui.c
index 41f7a661..37caa905 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/ir_menu_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/infrared/ir_menu_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_menu_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/ir_receive_ui.c b/firmware_p4/components/Applications/ui/screens/infrared/ir_receive_ui.c
index 56c736d2..dbf02e31 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/ir_receive_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/infrared/ir_receive_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_receive_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/ir_saved_ui.c b/firmware_p4/components/Applications/ui/screens/infrared/ir_saved_ui.c
index 50845daf..7bbc4026 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/ir_saved_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/infrared/ir_saved_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_saved_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/infrared/ir_send_ui.c b/firmware_p4/components/Applications/ui/screens/infrared/ir_send_ui.c
index de6c34f3..7199ba7b 100644
--- a/firmware_p4/components/Applications/ui/screens/infrared/ir_send_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/infrared/ir_send_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_send_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/interface_settings/include/interface_settings_ui.h b/firmware_p4/components/Applications/ui/screens/interface_settings/include/interface_settings_ui.h
index 6da7040b..0f82fb12 100644
--- a/firmware_p4/components/Applications/ui/screens/interface_settings/include/interface_settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/interface_settings/include/interface_settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef INTERFACE_SETTINGS_UI_H
#define INTERFACE_SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/interface_settings/interface_settings_ui.c b/firmware_p4/components/Applications/ui/screens/interface_settings/interface_settings_ui.c
index 5e99ec3a..d990c3a6 100644
--- a/firmware_p4/components/Applications/ui/screens/interface_settings/interface_settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/interface_settings/interface_settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "interface_settings_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/menu/include/menu_ui.h b/firmware_p4/components/Applications/ui/screens/menu/include/menu_ui.h
index e95513e2..c9607703 100644
--- a/firmware_p4/components/Applications/ui/screens/menu/include/menu_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/menu/include/menu_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef MENU_UI_H
#define MENU_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/menu/menu_ui.c b/firmware_p4/components/Applications/ui/screens/menu/menu_ui.c
index a84edef5..7325727f 100644
--- a/firmware_p4/components/Applications/ui/screens/menu/menu_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/menu/menu_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "menu_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/nfc/include/nfc_menu_ui.h b/firmware_p4/components/Applications/ui/screens/nfc/include/nfc_menu_ui.h
index 36686ac8..7b7c9be9 100644
--- a/firmware_p4/components/Applications/ui/screens/nfc/include/nfc_menu_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/nfc/include/nfc_menu_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef NFC_MENU_UI_H
#define NFC_MENU_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/nfc/nfc_menu_ui.c b/firmware_p4/components/Applications/ui/screens/nfc/nfc_menu_ui.c
index 830c4977..412a53d4 100644
--- a/firmware_p4/components/Applications/ui/screens/nfc/nfc_menu_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/nfc/nfc_menu_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "nfc_menu_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/settings/include/settings_ui.h b/firmware_p4/components/Applications/ui/screens/settings/include/settings_ui.h
index 28d44efb..5258c9ba 100644
--- a/firmware_p4/components/Applications/ui/screens/settings/include/settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/settings/include/settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SETTINGS_UI_H
#define SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/settings/settings_ui.c b/firmware_p4/components/Applications/ui/screens/settings/settings_ui.c
index 56a68154..78cbd525 100644
--- a/firmware_p4/components/Applications/ui/screens/settings/settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/settings/settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "settings_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/sound_settings/include/sound_settings_ui.h b/firmware_p4/components/Applications/ui/screens/sound_settings/include/sound_settings_ui.h
index 3296de26..f3afd09e 100644
--- a/firmware_p4/components/Applications/ui/screens/sound_settings/include/sound_settings_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/sound_settings/include/sound_settings_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SOUND_SETTINGS_UI_H
#define SOUND_SETTINGS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/sound_settings/sound_settings_ui.c b/firmware_p4/components/Applications/ui/screens/sound_settings/sound_settings_ui.c
index 4f3d6350..ecf61cdd 100644
--- a/firmware_p4/components/Applications/ui/screens/sound_settings/sound_settings_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/sound_settings/sound_settings_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sound_settings_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/sub_example/include/sub_example_ui.h b/firmware_p4/components/Applications/ui/screens/sub_example/include/sub_example_ui.h
index b63ddc90..99b772a6 100644
--- a/firmware_p4/components/Applications/ui/screens/sub_example/include/sub_example_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/sub_example/include/sub_example_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SUB_EXAMPLE_UI_H
#define SUB_EXAMPLE_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/sub_example/sub_example_ui.c b/firmware_p4/components/Applications/ui/screens/sub_example/sub_example_ui.c
index 347b02f4..1f55609f 100644
--- a/firmware_p4/components/Applications/ui/screens/sub_example/sub_example_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/sub_example/sub_example_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sub_example_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/theme_selector/include/theme_selector_ui.h b/firmware_p4/components/Applications/ui/screens/theme_selector/include/theme_selector_ui.h
index 4f167b47..cd25c823 100644
--- a/firmware_p4/components/Applications/ui/screens/theme_selector/include/theme_selector_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/theme_selector/include/theme_selector_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef THEME_SELECTOR_UI_H
#define THEME_SELECTOR_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/theme_selector/theme_selector_ui.c b/firmware_p4/components/Applications/ui/screens/theme_selector/theme_selector_ui.c
index 6cfddcbc..1bf7c2a4 100644
--- a/firmware_p4/components/Applications/ui/screens/theme_selector/theme_selector_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/theme_selector/theme_selector_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "theme_selector_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ap_list_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ap_list_ui.h
index 0fb168a6..5b48dc7c 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ap_list_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ap_list_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_AP_LIST_UI_H
#define WIFI_AP_LIST_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_attack_menu_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_attack_menu_ui.h
index 607cc232..bd78b42f 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_attack_menu_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_attack_menu_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_ATTACK_MENU_UI_H
#define WIFI_ATTACK_MENU_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_auth_flood_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_auth_flood_ui.h
index 607b5a37..861877b7 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_auth_flood_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_auth_flood_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_AUTH_FLOOD_UI_H
#define WIFI_AUTH_FLOOD_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_simple_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_simple_ui.h
index b5e3d3c1..ad5102f5 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_simple_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_simple_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_BEACON_SPAM_SIMPLE_UI_H
#define WIFI_BEACON_SPAM_SIMPLE_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_ui.h
index aeac425d..d1abd1d6 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_beacon_spam_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_BEACON_SPAM_UI_H
#define WIFI_BEACON_SPAM_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_attack_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_attack_ui.h
index 889c2f89..447e314d 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_attack_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_attack_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_DEAUTH_ATTACK_UI_H
#define WIFI_DEAUTH_ATTACK_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_ui.h
index c239a898..ed6b7298 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_deauth_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_DEAUTH_UI_H
#define WIFI_DEAUTH_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_evil_twin_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_evil_twin_ui.h
index c2bc1820..b80db737 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_evil_twin_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_evil_twin_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_EVIL_TWIN_UI_H
#define WIFI_EVIL_TWIN_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_packets_menu_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_packets_menu_ui.h
index 57be4bc3..347fb2a9 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_packets_menu_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_packets_menu_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_PACKETS_MENU_UI_H
#define WIFI_PACKETS_MENU_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_flood_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_flood_ui.h
index 538d3f38..c8299dd0 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_flood_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_flood_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_PROBE_FLOOD_UI_H
#define WIFI_PROBE_FLOOD_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_ui.h
index 8fd82526..6a3798f8 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_probe_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_PROBE_UI_H
#define WIFI_PROBE_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ap_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ap_ui.h
index 688de135..f7c69896 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ap_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ap_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_AP_UI_H
#define WIFI_SCAN_AP_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_menu_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_menu_ui.h
index 7b629f46..7e1981d0 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_menu_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_menu_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_MENU_UI_H
#define WIFI_SCAN_MENU_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_monitor_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_monitor_ui.h
index 354f7ee7..9704a4a6 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_monitor_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_monitor_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_MONITOR_UI_H
#define WIFI_SCAN_MONITOR_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_probe_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_probe_ui.h
index 481d2998..c95181ae 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_probe_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_probe_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_PROBE_UI_H
#define WIFI_SCAN_PROBE_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_stations_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_stations_ui.h
index f5df9702..db7402d7 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_stations_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_stations_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_STATIONS_UI_H
#define WIFI_SCAN_STATIONS_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_target_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_target_ui.h
index 7838d162..ebd682ec 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_target_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_target_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_TARGET_UI_H
#define WIFI_SCAN_TARGET_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ui.h
index 45703aa3..a231c87a 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_scan_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SCAN_UI_H
#define WIFI_SCAN_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_attack_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_attack_ui.h
index 55c021b8..0a32abf4 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_attack_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_attack_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SNIFFER_ATTACK_UI_H
#define WIFI_SNIFFER_ATTACK_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_handshake_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_handshake_ui.h
index 6b9c25e9..c3dee5ba 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_handshake_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_handshake_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SNIFFER_HANDSHAKE_UI_H
#define WIFI_SNIFFER_HANDSHAKE_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_raw_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_raw_ui.h
index a5570d3a..73a5361a 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_raw_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_sniffer_raw_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SNIFFER_RAW_UI_H
#define WIFI_SNIFFER_RAW_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ui.h b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ui.h
index 3a798455..9daffcde 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ui.h
+++ b/firmware_p4/components/Applications/ui/screens/wifi/include/wifi_ui.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_UI_H
#define WIFI_UI_H
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_ap_list_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_ap_list_ui.c
index 588c2eb2..d833f1d2 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_ap_list_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_ap_list_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_ap_list_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_attack_menu_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_attack_menu_ui.c
index a3e37924..80c5df6b 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_attack_menu_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_attack_menu_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_attack_menu_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_auth_flood_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_auth_flood_ui.c
index 8c61822c..6644e7ab 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_auth_flood_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_auth_flood_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_auth_flood_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_simple_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_simple_ui.c
index 824d4127..d0093f2a 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_simple_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_simple_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_beacon_spam_simple_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_ui.c
index ec9cf6f0..775cbe2a 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_beacon_spam_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_beacon_spam_ui.h"
#include "esp_log.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_attack_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_attack_ui.c
index ed2797a0..e7c5487c 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_attack_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_attack_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_deauth_attack_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_ui.c
index f40bd82a..b44953ed 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_deauth_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_deauth_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_evil_twin_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_evil_twin_ui.c
index e752fec3..a13dcd71 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_evil_twin_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_evil_twin_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_evil_twin_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_packets_menu_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_packets_menu_ui.c
index 9c916efc..73d7781b 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_packets_menu_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_packets_menu_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_packets_menu_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_flood_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_flood_ui.c
index 69b927e9..cfafb42a 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_flood_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_flood_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_probe_flood_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_ui.c
index 984feb81..0a704c8a 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_probe_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_probe_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ap_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ap_ui.c
index 58ed35d5..d5c1d7aa 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ap_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ap_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_ap_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_menu_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_menu_ui.c
index 29c618ac..5d413951 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_menu_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_menu_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_menu_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_monitor_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_monitor_ui.c
index 06841c14..fce1acb6 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_monitor_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_monitor_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_monitor_ui.h"
@@ -103,7 +104,7 @@ void ui_wifi_scan_monitor_open(void) {
s_update_timer = NULL;
}
- wifi_sniffer_start(WIFI_SNIFFER_TYPE_RAW, 0);
+ wifi_sniffer_start_monitor(0);
s_last_pkt_count = 0;
s_screen = lv_obj_create(NULL);
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_probe_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_probe_ui.c
index 701992c7..8d9bf4f7 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_probe_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_probe_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_probe_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_stations_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_stations_ui.c
index f9337958..15d456d0 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_stations_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_stations_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_stations_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_target_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_target_ui.c
index cfb6e4a7..7c7decac 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_target_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_target_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_target_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ui.c
index 24b65ab4..3da0e0d3 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_scan_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_scan_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_attack_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_attack_ui.c
index 7397088f..b13ed463 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_attack_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_attack_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_sniffer_attack_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_handshake_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_handshake_ui.c
index e07b5351..5575b3a7 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_handshake_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_handshake_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_sniffer_handshake_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_raw_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_raw_ui.c
index 1aa56fdc..77b82b65 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_raw_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_sniffer_raw_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_sniffer_raw_ui.h"
diff --git a/firmware_p4/components/Applications/ui/screens/wifi/wifi_ui.c b/firmware_p4/components/Applications/ui/screens/wifi/wifi_ui.c
index 2554cbc8..c66fb656 100644
--- a/firmware_p4/components/Applications/ui/screens/wifi/wifi_ui.c
+++ b/firmware_p4/components/Applications/ui/screens/wifi/wifi_ui.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_ui.h"
diff --git a/firmware_p4/components/Applications/ui/ui_manager.c b/firmware_p4/components/Applications/ui/ui_manager.c
index 4c481ab8..13c3800d 100644
--- a/firmware_p4/components/Applications/ui/ui_manager.c
+++ b/firmware_p4/components/Applications/ui/ui_manager.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_manager.h"
diff --git a/firmware_p4/components/Applications/ui/ui_theme.c b/firmware_p4/components/Applications/ui/ui_theme.c
index 8b9223b7..b20c75f1 100644
--- a/firmware_p4/components/Applications/ui/ui_theme.c
+++ b/firmware_p4/components/Applications/ui/ui_theme.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ui_theme.h"
diff --git a/firmware_p4/components/Applications/wifi/ap_scanner.c b/firmware_p4/components/Applications/wifi/ap_scanner.c
index 342df540..31dccf15 100644
--- a/firmware_p4/components/Applications/wifi/ap_scanner.c
+++ b/firmware_p4/components/Applications/wifi/ap_scanner.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ap_scanner.h"
diff --git a/firmware_p4/components/Applications/wifi/beacon_spam.c b/firmware_p4/components/Applications/wifi/beacon_spam.c
index ee22f054..85aa6166 100644
--- a/firmware_p4/components/Applications/wifi/beacon_spam.c
+++ b/firmware_p4/components/Applications/wifi/beacon_spam.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "beacon_spam.h"
@@ -19,33 +20,38 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "BEACON_SPAM";
static bool s_is_running = false;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
bool beacon_spam_start_custom(const char *json_path) {
if (json_path == NULL)
return false;
size_t len = strnlen(json_path, SPI_MAX_PAYLOAD - 1);
- esp_err_t err = spi_bridge_send_command(
- SPI_ID_WIFI_APP_BEACON_SPAM, (uint8_t *)json_path, (uint8_t)len, NULL, NULL, 2000);
- s_is_running = (err == ESP_OK);
+ s_session_id = spi_session_start(
+ SPI_ID_WIFI_APP_BEACON_SPAM, (uint8_t *)json_path, (uint8_t)len, NULL, NULL);
+ s_is_running = (s_session_id != SPI_SESSION_INVALID_ID);
if (!s_is_running)
ESP_LOGW(TAG, "Failed to start beacon spam (custom list) over SPI");
return s_is_running;
}
bool beacon_spam_start_random(void) {
- esp_err_t err = spi_bridge_send_command(SPI_ID_WIFI_APP_BEACON_SPAM, NULL, 0, NULL, NULL, 2000);
- s_is_running = (err == ESP_OK);
+ s_session_id = spi_session_start(SPI_ID_WIFI_APP_BEACON_SPAM, NULL, 0, NULL, NULL);
+ s_is_running = (s_session_id != SPI_SESSION_INVALID_ID);
if (!s_is_running)
ESP_LOGW(TAG, "Failed to start beacon spam (random) over SPI");
return s_is_running;
}
void beacon_spam_stop(void) {
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
s_is_running = false;
}
diff --git a/firmware_p4/components/Applications/wifi/client_scanner.c b/firmware_p4/components/Applications/wifi/client_scanner.c
index e935d365..c3812b50 100644
--- a/firmware_p4/components/Applications/wifi/client_scanner.c
+++ b/firmware_p4/components/Applications/wifi/client_scanner.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "client_scanner.h"
diff --git a/firmware_p4/components/Applications/wifi/deauther_detector.c b/firmware_p4/components/Applications/wifi/deauther_detector.c
index c01ac592..05bf6198 100644
--- a/firmware_p4/components/Applications/wifi/deauther_detector.c
+++ b/firmware_p4/components/Applications/wifi/deauther_detector.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "deauther_detector.h"
@@ -19,17 +20,24 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "DEAUTHER_DETECTOR";
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
+
void deauther_detector_start(void) {
- if (spi_bridge_send_command(SPI_ID_WIFI_APP_DEAUTH_DET, NULL, 0, NULL, NULL, 2000) != ESP_OK) {
+ s_session_id = spi_session_start(SPI_ID_WIFI_APP_DEAUTH_DET, NULL, 0, NULL, NULL);
+ if (s_session_id == SPI_SESSION_INVALID_ID) {
ESP_LOGW(TAG, "Failed to start deauth detector over SPI");
}
}
void deauther_detector_stop(void) {
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
}
uint32_t deauther_detector_get_count(void) {
diff --git a/firmware_p4/components/Applications/wifi/evil_twin.c b/firmware_p4/components/Applications/wifi/evil_twin.c
index 99f73b15..0248380b 100644
--- a/firmware_p4/components/Applications/wifi/evil_twin.c
+++ b/firmware_p4/components/Applications/wifi/evil_twin.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "evil_twin.h"
@@ -21,6 +22,7 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
#include "tos_storage_paths.h"
#include "storage_read.h"
#include "storage_write.h"
@@ -37,13 +39,15 @@ static const char *TAG = "EVIL_TWIN";
#define EVIL_TWIN_PASSWORD_BUF_SIZE 2048
static bool s_has_password = false;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
void evil_twin_start_attack(const char *ssid) {
if (ssid == NULL)
return;
size_t len = strnlen(ssid, EVIL_TWIN_MAX_SSID_LEN);
- if (spi_bridge_send_command(
- SPI_ID_WIFI_APP_EVIL_TWIN, (uint8_t *)ssid, (uint8_t)len, NULL, NULL, 2000) == ESP_OK) {
+ s_session_id =
+ spi_session_start(SPI_ID_WIFI_APP_EVIL_TWIN, (uint8_t *)ssid, (uint8_t)len, NULL, NULL);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
s_has_password = false;
} else {
ESP_LOGW(TAG, "Failed to start Evil Twin over SPI");
@@ -80,7 +84,10 @@ void evil_twin_start_attack_with_template(const char *ssid, const char *template
}
void evil_twin_stop_attack(void) {
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
}
void evil_twin_reset_capture(void) {
diff --git a/firmware_p4/components/Applications/wifi/include/ap_scanner.h b/firmware_p4/components/Applications/wifi/include/ap_scanner.h
index 8ce1266e..ecd60a27 100644
--- a/firmware_p4/components/Applications/wifi/include/ap_scanner.h
+++ b/firmware_p4/components/Applications/wifi/include/ap_scanner.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef AP_SCANNER_H
#define AP_SCANNER_H
diff --git a/firmware_p4/components/Applications/wifi/include/beacon_spam.h b/firmware_p4/components/Applications/wifi/include/beacon_spam.h
index 1b426655..e55c0f55 100644
--- a/firmware_p4/components/Applications/wifi/include/beacon_spam.h
+++ b/firmware_p4/components/Applications/wifi/include/beacon_spam.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BEACON_SPAM_H
#define BEACON_SPAM_H
diff --git a/firmware_p4/components/Applications/wifi/include/client_scanner.h b/firmware_p4/components/Applications/wifi/include/client_scanner.h
index 1d6b9544..af720e78 100644
--- a/firmware_p4/components/Applications/wifi/include/client_scanner.h
+++ b/firmware_p4/components/Applications/wifi/include/client_scanner.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef CLIENT_SCANNER_H
#define CLIENT_SCANNER_H
diff --git a/firmware_p4/components/Applications/wifi/include/deauther_detector.h b/firmware_p4/components/Applications/wifi/include/deauther_detector.h
index 01d6e2d6..dc1ad853 100644
--- a/firmware_p4/components/Applications/wifi/include/deauther_detector.h
+++ b/firmware_p4/components/Applications/wifi/include/deauther_detector.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef DEAUTHER_DETECTOR_H
#define DEAUTHER_DETECTOR_H
diff --git a/firmware_p4/components/Applications/wifi/include/evil_twin.h b/firmware_p4/components/Applications/wifi/include/evil_twin.h
index 48718e91..3e29c4cf 100644
--- a/firmware_p4/components/Applications/wifi/include/evil_twin.h
+++ b/firmware_p4/components/Applications/wifi/include/evil_twin.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef EVIL_TWIN_H
#define EVIL_TWIN_H
diff --git a/firmware_p4/components/Applications/wifi/include/pcap_serializer.h b/firmware_p4/components/Applications/wifi/include/pcap_serializer.h
index 45e617c4..a568b21f 100644
--- a/firmware_p4/components/Applications/wifi/include/pcap_serializer.h
+++ b/firmware_p4/components/Applications/wifi/include/pcap_serializer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef PCAP_SERIALIZER_H
#define PCAP_SERIALIZER_H
diff --git a/firmware_p4/components/Applications/wifi/include/port_scan.h b/firmware_p4/components/Applications/wifi/include/port_scan.h
index 56b58206..b807a45c 100644
--- a/firmware_p4/components/Applications/wifi/include/port_scan.h
+++ b/firmware_p4/components/Applications/wifi/include/port_scan.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef PORT_SCAN_H
#define PORT_SCAN_H
diff --git a/firmware_p4/components/Applications/wifi/include/probe_monitor.h b/firmware_p4/components/Applications/wifi/include/probe_monitor.h
index 37e015f8..c70cc6bd 100644
--- a/firmware_p4/components/Applications/wifi/include/probe_monitor.h
+++ b/firmware_p4/components/Applications/wifi/include/probe_monitor.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef PROBE_MONITOR_H
#define PROBE_MONITOR_H
diff --git a/firmware_p4/components/Applications/wifi/include/signal_monitor.h b/firmware_p4/components/Applications/wifi/include/signal_monitor.h
index c808d849..28868e6e 100644
--- a/firmware_p4/components/Applications/wifi/include/signal_monitor.h
+++ b/firmware_p4/components/Applications/wifi/include/signal_monitor.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SIGNAL_MONITOR_H
#define SIGNAL_MONITOR_H
diff --git a/firmware_p4/components/Applications/wifi/include/target_scanner.h b/firmware_p4/components/Applications/wifi/include/target_scanner.h
index 54d2a5a3..a4fab673 100644
--- a/firmware_p4/components/Applications/wifi/include/target_scanner.h
+++ b/firmware_p4/components/Applications/wifi/include/target_scanner.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TARGET_SCANNER_H
#define TARGET_SCANNER_H
diff --git a/firmware_p4/components/Applications/wifi/include/wifi_deauther.h b/firmware_p4/components/Applications/wifi/include/wifi_deauther.h
index 9781b8d6..a2450cd7 100644
--- a/firmware_p4/components/Applications/wifi/include/wifi_deauther.h
+++ b/firmware_p4/components/Applications/wifi/include/wifi_deauther.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_DEAUTHER_H
#define WIFI_DEAUTHER_H
diff --git a/firmware_p4/components/Applications/wifi/include/wifi_flood.h b/firmware_p4/components/Applications/wifi/include/wifi_flood.h
index e4a3a6a9..9d178e52 100644
--- a/firmware_p4/components/Applications/wifi/include/wifi_flood.h
+++ b/firmware_p4/components/Applications/wifi/include/wifi_flood.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_FLOOD_H
#define WIFI_FLOOD_H
diff --git a/firmware_p4/components/Applications/wifi/include/wifi_sniffer.h b/firmware_p4/components/Applications/wifi/include/wifi_sniffer.h
index 2c5eb731..9cc2297e 100644
--- a/firmware_p4/components/Applications/wifi/include/wifi_sniffer.h
+++ b/firmware_p4/components/Applications/wifi/include/wifi_sniffer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SNIFFER_H
#define WIFI_SNIFFER_H
@@ -64,6 +65,18 @@ bool wifi_sniffer_start(wifi_sniffer_type_t type, uint8_t channel);
*/
bool wifi_sniffer_start_stream(wifi_sniffer_type_t type, uint8_t channel, wifi_sniffer_cb_t cb);
+/**
+ * @brief Start the sniffer in Packet Monitor mode (counter-only).
+ *
+ * Same as `wifi_sniffer_start(WIFI_SNIFFER_TYPE_RAW, channel)` but tells
+ * the C5 to recycle the PCAP buffer when full (instead of dropping new
+ * packets). Use this for the Packet Monitor screen which only reads
+ * counters and never saves the PCAP.
+ *
+ * @param channel Wi-Fi channel (0 for hopping).
+ */
+bool wifi_sniffer_start_monitor(uint8_t channel);
+
/**
* @brief Stop the sniffer and release stream resources.
*/
diff --git a/firmware_p4/components/Applications/wifi/port_scan.c b/firmware_p4/components/Applications/wifi/port_scan.c
index 02798c29..2a75d490 100644
--- a/firmware_p4/components/Applications/wifi/port_scan.c
+++ b/firmware_p4/components/Applications/wifi/port_scan.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "port_scan.h"
diff --git a/firmware_p4/components/Applications/wifi/probe_monitor.c b/firmware_p4/components/Applications/wifi/probe_monitor.c
index 4a65b70b..c4bf44bc 100644
--- a/firmware_p4/components/Applications/wifi/probe_monitor.c
+++ b/firmware_p4/components/Applications/wifi/probe_monitor.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "probe_monitor.h"
@@ -20,6 +21,7 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "PROBE_MONITOR";
@@ -30,14 +32,19 @@ static probe_monitor_record_t *s_cached_results = NULL;
static uint16_t s_cached_count = 0;
static uint16_t s_cached_capacity = 0;
static probe_monitor_record_t s_empty_record;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
bool probe_monitor_start(void) {
probe_monitor_free_results();
- return (spi_bridge_send_command(SPI_ID_WIFI_APP_PROBE_MON, NULL, 0, NULL, NULL, 2000) == ESP_OK);
+ s_session_id = spi_session_start(SPI_ID_WIFI_APP_PROBE_MON, NULL, 0, NULL, NULL);
+ return s_session_id != SPI_SESSION_INVALID_ID;
}
void probe_monitor_stop(void) {
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
probe_monitor_free_results();
}
diff --git a/firmware_p4/components/Applications/wifi/signal_monitor.c b/firmware_p4/components/Applications/wifi/signal_monitor.c
index 27b53e7d..14824d6f 100644
--- a/firmware_p4/components/Applications/wifi/signal_monitor.c
+++ b/firmware_p4/components/Applications/wifi/signal_monitor.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "signal_monitor.h"
@@ -19,6 +20,7 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "SIGNAL_MONITOR";
@@ -27,19 +29,23 @@ static const char *TAG = "SIGNAL_MONITOR";
#define SIGNAL_MONITOR_STATS_INDEX 0xEEEE
static int8_t s_last_rssi = SIGNAL_MONITOR_DEFAULT_RSSI;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
void signal_monitor_start(const uint8_t *bssid, uint8_t channel) {
ESP_LOGI(TAG, "Signal monitor started");
uint8_t payload[SIGNAL_MONITOR_PAYLOAD_SIZE];
memcpy(payload, bssid, 6);
payload[6] = channel;
- spi_bridge_send_command(
- SPI_ID_WIFI_APP_SIGNAL_MON, payload, SIGNAL_MONITOR_PAYLOAD_SIZE, NULL, NULL, 2000);
+ s_session_id = spi_session_start(
+ SPI_ID_WIFI_APP_SIGNAL_MON, payload, SIGNAL_MONITOR_PAYLOAD_SIZE, NULL, NULL);
}
void signal_monitor_stop(void) {
ESP_LOGI(TAG, "Signal monitor stopped");
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
}
int8_t signal_monitor_get_rssi(void) {
diff --git a/firmware_p4/components/Applications/wifi/target_scanner.c b/firmware_p4/components/Applications/wifi/target_scanner.c
index c8432299..6782350f 100644
--- a/firmware_p4/components/Applications/wifi/target_scanner.c
+++ b/firmware_p4/components/Applications/wifi/target_scanner.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "target_scanner.h"
diff --git a/firmware_p4/components/Applications/wifi/wifi_deauther.c b/firmware_p4/components/Applications/wifi/wifi_deauther.c
index 9583ff3d..6fcdd8a7 100644
--- a/firmware_p4/components/Applications/wifi/wifi_deauther.c
+++ b/firmware_p4/components/Applications/wifi/wifi_deauther.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_deauther.h"
@@ -19,9 +20,12 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "WIFI_DEAUTHER";
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
+
bool wifi_deauther_start(const wifi_ap_record_t *ap_record,
wifi_deauther_frame_type_t type,
bool is_broadcast) {
@@ -31,8 +35,8 @@ bool wifi_deauther_start(const wifi_ap_record_t *ap_record,
memset(payload + 6, is_broadcast ? 0xFF : 0x00, 6);
payload[12] = (uint8_t)type;
payload[13] = ap_record->primary;
- return (spi_bridge_send_command(
- SPI_ID_WIFI_APP_DEAUTHER, payload, sizeof(payload), NULL, NULL, 2000) == ESP_OK);
+ s_session_id = spi_session_start(SPI_ID_WIFI_APP_DEAUTHER, payload, sizeof(payload), NULL, NULL);
+ return s_session_id != SPI_SESSION_INVALID_ID;
}
bool wifi_deauther_start_targeted(const wifi_ap_record_t *ap_record,
@@ -43,13 +47,16 @@ bool wifi_deauther_start_targeted(const wifi_ap_record_t *ap_record,
memcpy(payload + 6, client_mac, 6);
payload[12] = (uint8_t)type;
payload[13] = ap_record->primary;
- return (spi_bridge_send_command(
- SPI_ID_WIFI_APP_DEAUTHER, payload, sizeof(payload), NULL, NULL, 2000) == ESP_OK);
+ s_session_id = spi_session_start(SPI_ID_WIFI_APP_DEAUTHER, payload, sizeof(payload), NULL, NULL);
+ return s_session_id != SPI_SESSION_INVALID_ID;
}
void wifi_deauther_stop(void) {
ESP_LOGI(TAG, "Deauth stopped");
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
}
bool wifi_deauther_is_running(void) {
diff --git a/firmware_p4/components/Applications/wifi/wifi_flood.c b/firmware_p4/components/Applications/wifi/wifi_flood.c
index 8eec4baf..14a7ec70 100644
--- a/firmware_p4/components/Applications/wifi/wifi_flood.c
+++ b/firmware_p4/components/Applications/wifi/wifi_flood.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_flood.h"
@@ -19,6 +20,7 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "WIFI_FLOOD";
@@ -27,8 +29,9 @@ static const char *TAG = "WIFI_FLOOD";
#define WIFI_FLOOD_TYPE_PROBE 2
static bool s_is_running = false;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
-static esp_err_t send_flood(uint8_t type, const uint8_t *target_bssid, uint8_t channel) {
+static bool start_flood(uint8_t type, const uint8_t *target_bssid, uint8_t channel) {
uint8_t payload[8];
payload[0] = type;
if (target_bssid != NULL)
@@ -36,35 +39,34 @@ static esp_err_t send_flood(uint8_t type, const uint8_t *target_bssid, uint8_t c
else
memset(payload + 1, 0xFF, 6);
payload[7] = channel;
- return spi_bridge_send_command(SPI_ID_WIFI_APP_FLOOD, payload, sizeof(payload), NULL, NULL, 2000);
+ s_session_id = spi_session_start(SPI_ID_WIFI_APP_FLOOD, payload, sizeof(payload), NULL, NULL);
+ s_is_running = (s_session_id != SPI_SESSION_INVALID_ID);
+ return s_is_running;
}
bool wifi_flood_auth_start(const uint8_t *target_bssid, uint8_t channel) {
- esp_err_t err = send_flood(WIFI_FLOOD_TYPE_AUTH, target_bssid, channel);
- s_is_running = (err == ESP_OK);
- if (!s_is_running)
+ if (!start_flood(WIFI_FLOOD_TYPE_AUTH, target_bssid, channel))
ESP_LOGW(TAG, "Wi-Fi auth flood failed over SPI");
return s_is_running;
}
bool wifi_flood_assoc_start(const uint8_t *target_bssid, uint8_t channel) {
- esp_err_t err = send_flood(WIFI_FLOOD_TYPE_ASSOC, target_bssid, channel);
- s_is_running = (err == ESP_OK);
- if (!s_is_running)
+ if (!start_flood(WIFI_FLOOD_TYPE_ASSOC, target_bssid, channel))
ESP_LOGW(TAG, "Wi-Fi assoc flood failed over SPI");
return s_is_running;
}
bool wifi_flood_probe_start(const uint8_t *target_bssid, uint8_t channel) {
- esp_err_t err = send_flood(WIFI_FLOOD_TYPE_PROBE, target_bssid, channel);
- s_is_running = (err == ESP_OK);
- if (!s_is_running)
+ if (!start_flood(WIFI_FLOOD_TYPE_PROBE, target_bssid, channel))
ESP_LOGW(TAG, "Wi-Fi probe flood failed over SPI");
return s_is_running;
}
void wifi_flood_stop(void) {
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
s_is_running = false;
}
diff --git a/firmware_p4/components/Applications/wifi/wifi_sniffer.c b/firmware_p4/components/Applications/wifi/wifi_sniffer.c
index 96bec527..344bb268 100644
--- a/firmware_p4/components/Applications/wifi/wifi_sniffer.c
+++ b/firmware_p4/components/Applications/wifi/wifi_sniffer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_sniffer.h"
@@ -19,6 +20,7 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
#include "storage_stream.h"
static const char *TAG = "WIFI_SNIFFER";
@@ -28,11 +30,11 @@ static const char *TAG = "WIFI_SNIFFER";
static spi_sniffer_stats_t s_cached_stats;
static wifi_sniffer_cb_t s_stream_cb = NULL;
static storage_stream_t s_capture_stream = NULL;
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
bool wifi_sniffer_stop_capture(void);
-static void stream_callback(spi_id_t id, const uint8_t *payload, uint8_t len) {
- (void)id;
+static void session_stream_cb(const uint8_t *payload, uint8_t len) {
if (payload == NULL || len < WIFI_SNIFFER_MIN_FRAME_LEN)
return;
const spi_wifi_sniffer_frame_t *frame = (const spi_wifi_sniffer_frame_t *)payload;
@@ -49,6 +51,15 @@ static void stream_callback(spi_id_t id, const uint8_t *payload, uint8_t len) {
}
}
+static void session_lost_cb(uint32_t session_id, spi_id_t op_id) {
+ (void)op_id;
+ if (session_id == s_session_id) {
+ s_session_id = SPI_SESSION_INVALID_ID;
+ wifi_sniffer_stop_capture();
+ s_stream_cb = NULL;
+ }
+}
+
static void update_stats(void) {
spi_header_t resp;
uint16_t magic_stats = SPI_DATA_INDEX_STATS;
@@ -56,31 +67,40 @@ static void update_stats(void) {
SPI_ID_SYSTEM_DATA, (uint8_t *)&magic_stats, 2, &resp, (uint8_t *)&s_cached_stats, 1000);
}
-bool wifi_sniffer_start(wifi_sniffer_type_t type, uint8_t channel) {
- uint8_t payload[2];
+static bool
+start_internal(wifi_sniffer_type_t type, uint8_t channel, bool monitor_mode, wifi_sniffer_cb_t cb) {
+ uint8_t payload[3];
payload[0] = (uint8_t)type;
payload[1] = channel;
+ payload[2] = monitor_mode ? 1 : 0;
memset(&s_cached_stats, 0, sizeof(s_cached_stats));
- return (spi_bridge_send_command(SPI_ID_WIFI_APP_SNIFFER, payload, 2, NULL, NULL, 2000) == ESP_OK);
-}
-
-bool wifi_sniffer_start_stream(wifi_sniffer_type_t type, uint8_t channel, wifi_sniffer_cb_t cb) {
- if (cb == NULL) {
- return wifi_sniffer_start(type, channel);
- }
s_stream_cb = cb;
- spi_bridge_register_stream_cb(SPI_ID_WIFI_APP_SNIFFER, stream_callback);
- if (!wifi_sniffer_start(type, channel)) {
- spi_bridge_unregister_stream_cb(SPI_ID_WIFI_APP_SNIFFER);
+ s_session_id = spi_session_start(
+ SPI_ID_WIFI_APP_SNIFFER, payload, sizeof(payload), session_stream_cb, session_lost_cb);
+ if (s_session_id == SPI_SESSION_INVALID_ID) {
s_stream_cb = NULL;
return false;
}
return true;
}
+bool wifi_sniffer_start(wifi_sniffer_type_t type, uint8_t channel) {
+ return start_internal(type, channel, false, NULL);
+}
+
+bool wifi_sniffer_start_stream(wifi_sniffer_type_t type, uint8_t channel, wifi_sniffer_cb_t cb) {
+ return start_internal(type, channel, false, cb);
+}
+
+bool wifi_sniffer_start_monitor(uint8_t channel) {
+ return start_internal(WIFI_SNIFFER_TYPE_RAW, channel, true, NULL);
+}
+
void wifi_sniffer_stop(void) {
- spi_bridge_send_command(SPI_ID_WIFI_APP_ATTACK_STOP, NULL, 0, NULL, NULL, 2000);
- spi_bridge_unregister_stream_cb(SPI_ID_WIFI_APP_SNIFFER);
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
wifi_sniffer_stop_capture();
s_stream_cb = NULL;
}
diff --git a/firmware_p4/components/Core/CMakeLists.txt b/firmware_p4/components/Core/CMakeLists.txt
index 08d3efbb..52212351 100644
--- a/firmware_p4/components/Core/CMakeLists.txt
+++ b/firmware_p4/components/Core/CMakeLists.txt
@@ -1,16 +1,17 @@
# Copyright (c) 2025 HIGH CODE LLC
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
idf_component_register(SRCS
diff --git a/firmware_p4/components/Core/include/kernel.h b/firmware_p4/components/Core/include/kernel.h
index 45bc06a2..975ca628 100644
--- a/firmware_p4/components/Core/include/kernel.h
+++ b/firmware_p4/components/Core/include/kernel.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef KERNEL_H
#define KERNEL_H
diff --git a/firmware_p4/components/Core/include/sys_monitor.h b/firmware_p4/components/Core/include/sys_monitor.h
index c2740eb2..78d3a322 100644
--- a/firmware_p4/components/Core/include/sys_monitor.h
+++ b/firmware_p4/components/Core/include/sys_monitor.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SYS_MONITOR_H
#define SYS_MONITOR_H
diff --git a/firmware_p4/components/Core/kernel.c b/firmware_p4/components/Core/kernel.c
index 4182d20a..ae03e99d 100644
--- a/firmware_p4/components/Core/kernel.c
+++ b/firmware_p4/components/Core/kernel.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "kernel.h"
@@ -26,6 +27,7 @@
#include "bq25896.h"
#include "led_control.h"
#include "buttons_gpio.h"
+#include "ys_rfid2.h"
#include "bridge_manager.h"
#include "storage_init.h"
#include "storage_assets.h"
@@ -83,6 +85,7 @@ void kernel_init(void) {
cc1101_init();
bridge_manager_init();
buttons_init();
+ ys_rfid2_init(NULL);
// 6. Display + LVGL + UI
st7789_init();
diff --git a/firmware_p4/components/Core/sys_monitor.c b/firmware_p4/components/Core/sys_monitor.c
index ecb170f4..9bcc2a69 100644
--- a/firmware_p4/components/Core/sys_monitor.c
+++ b/firmware_p4/components/Core/sys_monitor.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sys_monitor.h"
diff --git a/firmware_p4/components/Drivers/CMakeLists.txt b/firmware_p4/components/Drivers/CMakeLists.txt
index fcf949e4..39d34c4e 100644
--- a/firmware_p4/components/Drivers/CMakeLists.txt
+++ b/firmware_p4/components/Drivers/CMakeLists.txt
@@ -1,21 +1,24 @@
# Copyright (c) 2025 HIGH CODE LLC
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
file(GLOB_RECURSE ST25R3916_SRCS "st25r3916/*.c")
+file(GLOB_RECURSE YS_RFID2_SRCS "ys_rfid2/*.c")
+file(GLOB_RECURSE SX1262_SRCS "sx1262/*.c")
-idf_component_register(SRCS
+idf_component_register(SRCS
"bq25896/bq25896.c"
"cc1101/cc1101.c"
"st7789/st7789.c"
@@ -26,8 +29,10 @@ idf_component_register(SRCS
"buttons_gpio/buttons_gpio.c"
"spi_bridge_phy/spi_bridge_phy.c"
${ST25R3916_SRCS}
+ ${YS_RFID2_SRCS}
+ ${SX1262_SRCS}
- INCLUDE_DIRS
+ INCLUDE_DIRS
"bq25896/include"
"cc1101/include"
"st7789/include"
@@ -40,8 +45,11 @@ idf_component_register(SRCS
"spi_bridge_phy/include"
"st25r3916/include"
"st25r3916/hal/include"
+ "ys_rfid2/include"
+ "ys_rfid2/hal/include"
+ "sx1262/include"
- REQUIRES
+ REQUIRES
driver
Service
esp_lcd
diff --git a/firmware_p4/components/Drivers/bq25896/bq25896.c b/firmware_p4/components/Drivers/bq25896/bq25896.c
index a920554d..bd1d2f03 100644
--- a/firmware_p4/components/Drivers/bq25896/bq25896.c
+++ b/firmware_p4/components/Drivers/bq25896/bq25896.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "bq25896.h"
diff --git a/firmware_p4/components/Drivers/bq25896/include/bq25896.h b/firmware_p4/components/Drivers/bq25896/include/bq25896.h
index b2d3d466..633c0008 100644
--- a/firmware_p4/components/Drivers/bq25896/include/bq25896.h
+++ b/firmware_p4/components/Drivers/bq25896/include/bq25896.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BQ25896_H
#define BQ25896_H
diff --git a/firmware_p4/components/Drivers/buttons_gpio/buttons_gpio.c b/firmware_p4/components/Drivers/buttons_gpio/buttons_gpio.c
index 61fc7b49..de9679d3 100644
--- a/firmware_p4/components/Drivers/buttons_gpio/buttons_gpio.c
+++ b/firmware_p4/components/Drivers/buttons_gpio/buttons_gpio.c
@@ -1,25 +1,29 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "buttons_gpio.h"
#include "driver/gpio.h"
+#include "esp_log.h"
static const char *TAG = "BUTTONS_GPIO";
#define BUTTON_PRESSED_LEVEL 0
+static const char *const s_button_names[] = {"UP", "DOWN", "LEFT", "RIGHT", "OK", "BACK"};
+
static button_t s_buttons[] = {
{GPIO_BTN_UP_PIN, true, false},
{GPIO_BTN_DOWN_PIN, true, false},
@@ -31,10 +35,21 @@ static button_t s_buttons[] = {
#define NUM_BUTTONS (sizeof(s_buttons) / sizeof(s_buttons[0]))
+static bool s_last_down[6] = {false};
+
static bool get_raw_level(uint32_t gpio) {
return gpio_get_level(gpio) == BUTTON_PRESSED_LEVEL;
}
+static bool check_and_log(int idx, uint32_t gpio) {
+ bool now = gpio_get_level(gpio) == BUTTON_PRESSED_LEVEL;
+ if (now && !s_last_down[idx]) {
+ ESP_LOGI(TAG, "Pressed: %s (GPIO %lu)", s_button_names[idx], (unsigned long)gpio);
+ }
+ s_last_down[idx] = now;
+ return now;
+}
+
bool up_button_pressed(void) {
return s_buttons[0].pressed_flag &&
(__atomic_test_and_set(&s_buttons[0].pressed_flag, __ATOMIC_RELAXED), false);
@@ -61,22 +76,22 @@ bool back_button_pressed(void) {
}
bool up_button_is_down(void) {
- return get_raw_level(GPIO_BTN_UP_PIN);
+ return check_and_log(0, GPIO_BTN_UP_PIN);
}
bool down_button_is_down(void) {
- return get_raw_level(GPIO_BTN_DOWN_PIN);
+ return check_and_log(1, GPIO_BTN_DOWN_PIN);
}
bool left_button_is_down(void) {
- return get_raw_level(GPIO_BTN_LEFT_PIN);
+ return check_and_log(2, GPIO_BTN_LEFT_PIN);
}
bool right_button_is_down(void) {
- return get_raw_level(GPIO_BTN_RIGHT_PIN);
+ return check_and_log(3, GPIO_BTN_RIGHT_PIN);
}
bool ok_button_is_down(void) {
- return get_raw_level(GPIO_BTN_OK_PIN);
+ return check_and_log(4, GPIO_BTN_OK_PIN);
}
bool back_button_is_down(void) {
- return get_raw_level(GPIO_BTN_BACK_PIN);
+ return check_and_log(5, GPIO_BTN_BACK_PIN);
}
void buttons_task(void) {
@@ -85,6 +100,7 @@ void buttons_task(void) {
if (s_buttons[i].last_state == true && current == false) {
s_buttons[i].pressed_flag = true;
+ ESP_LOGI(TAG, "Pressed: %s (GPIO %lu)", s_button_names[i], (unsigned long)s_buttons[i].gpio);
}
s_buttons[i].last_state = current;
diff --git a/firmware_p4/components/Drivers/buttons_gpio/include/buttons_gpio.h b/firmware_p4/components/Drivers/buttons_gpio/include/buttons_gpio.h
index ab9ee858..6eb63b7e 100644
--- a/firmware_p4/components/Drivers/buttons_gpio/include/buttons_gpio.h
+++ b/firmware_p4/components/Drivers/buttons_gpio/include/buttons_gpio.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BUTTONS_GPIO_H
#define BUTTONS_GPIO_H
diff --git a/firmware_p4/components/Drivers/cc1101/cc1101.c b/firmware_p4/components/Drivers/cc1101/cc1101.c
index e3aa935d..ea77ff09 100644
--- a/firmware_p4/components/Drivers/cc1101/cc1101.c
+++ b/firmware_p4/components/Drivers/cc1101/cc1101.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "cc1101.h"
diff --git a/firmware_p4/components/Drivers/cc1101/include/cc1101.h b/firmware_p4/components/Drivers/cc1101/include/cc1101.h
index b2fbf676..4c7dad00 100644
--- a/firmware_p4/components/Drivers/cc1101/include/cc1101.h
+++ b/firmware_p4/components/Drivers/cc1101/include/cc1101.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file cc1101.h
diff --git a/firmware_p4/components/Drivers/i2c_init/i2c_init.c b/firmware_p4/components/Drivers/i2c_init/i2c_init.c
index 83713885..af54a27a 100644
--- a/firmware_p4/components/Drivers/i2c_init/i2c_init.c
+++ b/firmware_p4/components/Drivers/i2c_init/i2c_init.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "i2c_init.h"
diff --git a/firmware_p4/components/Drivers/i2c_init/include/i2c_init.h b/firmware_p4/components/Drivers/i2c_init/include/i2c_init.h
index 89f7b0ff..f1ce7d2e 100644
--- a/firmware_p4/components/Drivers/i2c_init/include/i2c_init.h
+++ b/firmware_p4/components/Drivers/i2c_init/include/i2c_init.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef I2C_INIT_H
#define I2C_INIT_H
diff --git a/firmware_p4/components/Drivers/led/include/led_control.h b/firmware_p4/components/Drivers/led/include/led_control.h
index 3294eb4d..4d78acab 100644
--- a/firmware_p4/components/Drivers/led/include/led_control.h
+++ b/firmware_p4/components/Drivers/led/include/led_control.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef LED_CONTROL_H
#define LED_CONTROL_H
diff --git a/firmware_p4/components/Drivers/led/led_control.c b/firmware_p4/components/Drivers/led/led_control.c
index 9f0a0f4f..e8de45c1 100644
--- a/firmware_p4/components/Drivers/led/led_control.c
+++ b/firmware_p4/components/Drivers/led/led_control.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "led_control.h"
diff --git a/firmware_p4/components/Drivers/pins/include/pin_def.h b/firmware_p4/components/Drivers/pins/include/pin_def.h
index e05563fc..9a20610a 100644
--- a/firmware_p4/components/Drivers/pins/include/pin_def.h
+++ b/firmware_p4/components/Drivers/pins/include/pin_def.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file pin_def.h
@@ -80,6 +81,22 @@ extern "C" {
#define GPIO_C5_RESET_PIN 48
#define GPIO_C5_BOOT_PIN 33
+// SX1262 LoRa (SPI3_HOST, separate from C5 bridge)
+#define GPIO_LORA_SCLK_PIN 18
+#define GPIO_LORA_MOSI_PIN 19
+#define GPIO_LORA_MISO_PIN 14
+#define GPIO_LORA_CS_PIN 26
+#define GPIO_LORA_RESET_PIN 27
+#define GPIO_LORA_BUSY_PIN 17
+#define GPIO_LORA_DIO1_PIN 54
+#define GPIO_LORA_TXEN_PIN 3
+#define GPIO_LORA_RXEN_PIN 5
+
+// YS-RFID2 125kHz RFID Reader (UART)
+// TODO: placeholder pins — definir com base no schematic do board
+#define GPIO_RFID_UART_TX_PIN 24
+#define GPIO_RFID_UART_RX_PIN 25
+
#ifdef __cplusplus
}
#endif
diff --git a/firmware_p4/components/Drivers/spi/include/spi.h b/firmware_p4/components/Drivers/spi/include/spi.h
index bee3a514..79bf52d1 100644
--- a/firmware_p4/components/Drivers/spi/include/spi.h
+++ b/firmware_p4/components/Drivers/spi/include/spi.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SPI_H
#define SPI_H
diff --git a/firmware_p4/components/Drivers/spi/spi.c b/firmware_p4/components/Drivers/spi/spi.c
index ffbd61de..4dca4414 100644
--- a/firmware_p4/components/Drivers/spi/spi.c
+++ b/firmware_p4/components/Drivers/spi/spi.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "spi.h"
diff --git a/firmware_p4/components/Drivers/spi_bridge_phy/include/spi_bridge_phy.h b/firmware_p4/components/Drivers/spi_bridge_phy/include/spi_bridge_phy.h
index b16f7d93..5fc3666f 100644
--- a/firmware_p4/components/Drivers/spi_bridge_phy/include/spi_bridge_phy.h
+++ b/firmware_p4/components/Drivers/spi_bridge_phy/include/spi_bridge_phy.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SPI_BRIDGE_PHY_H
#define SPI_BRIDGE_PHY_H
diff --git a/firmware_p4/components/Drivers/spi_bridge_phy/spi_bridge_phy.c b/firmware_p4/components/Drivers/spi_bridge_phy/spi_bridge_phy.c
index e4837812..960a72ca 100644
--- a/firmware_p4/components/Drivers/spi_bridge_phy/spi_bridge_phy.c
+++ b/firmware_p4/components/Drivers/spi_bridge_phy/spi_bridge_phy.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "spi_bridge_phy.h"
diff --git a/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_gpio.c b/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_gpio.c
index 84c8454b..8d0d4121 100644
--- a/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_gpio.c
+++ b/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_gpio.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "hb_nfc_gpio.h"
diff --git a/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_spi.c b/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_spi.c
index 3a0cf82a..04271cf3 100644
--- a/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_spi.c
+++ b/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_spi.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "hb_nfc_spi.h"
diff --git a/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_timer.c b/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_timer.c
index 42f1c40e..38ce5018 100644
--- a/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_timer.c
+++ b/firmware_p4/components/Drivers/st25r3916/hal/hb_nfc_timer.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file hb_nfc_timer.c
diff --git a/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_gpio.h b/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_gpio.h
index 4aff70b4..62f1a8f6 100644
--- a/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_gpio.h
+++ b/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_gpio.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HB_NFC_GPIO_H
#define HB_NFC_GPIO_H
diff --git a/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_spi.h b/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_spi.h
index b324d655..e2e74f0d 100644
--- a/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_spi.h
+++ b/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_spi.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file hb_nfc_spi.h
diff --git a/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_timer.h b/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_timer.h
index 5acb2997..04f719b0 100644
--- a/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_timer.h
+++ b/firmware_p4/components/Drivers/st25r3916/hal/include/hb_nfc_timer.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HB_NFC_TIMER_H
#define HB_NFC_TIMER_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc.h b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc.h
index 297c7d68..d2c5c2cb 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HIGHBOY_NFC_H
#define HIGHBOY_NFC_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_compat.h b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_compat.h
index 91634036..6dc6c809 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_compat.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_compat.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HIGHBOY_NFC_COMPAT_H
#define HIGHBOY_NFC_COMPAT_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_error.h b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_error.h
index b20f6134..ca6ef7a0 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_error.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_error.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HIGHBOY_NFC_ERROR_H
#define HIGHBOY_NFC_ERROR_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_types.h b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_types.h
index e2ad6ac9..830fc10c 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_types.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/highboy_nfc_types.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef HIGHBOY_NFC_TYPES_H
#define HIGHBOY_NFC_TYPES_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_aat.h b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_aat.h
index c077d9c6..ae6f8566 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_aat.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_aat.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST25R3916_AAT_H
#define ST25R3916_AAT_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_cmd.h b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_cmd.h
index f95914f5..bec60d7e 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_cmd.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_cmd.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST25R3916_CMD_H
#define ST25R3916_CMD_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_core.h b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_core.h
index 9e7ded40..989446f9 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_core.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_core.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST25R3916_CORE_H
#define ST25R3916_CORE_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_fifo.h b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_fifo.h
index ad225638..eb01f165 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_fifo.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_fifo.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST25R3916_FIFO_H
#define ST25R3916_FIFO_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_irq.h b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_irq.h
index 581c6b43..4dc1590b 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_irq.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_irq.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST25R3916_IRQ_H
#define ST25R3916_IRQ_H
diff --git a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_reg.h b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_reg.h
index 020a1678..f3d65103 100644
--- a/firmware_p4/components/Drivers/st25r3916/include/st25r3916_reg.h
+++ b/firmware_p4/components/Drivers/st25r3916/include/st25r3916_reg.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST25R3916_REG_H
#define ST25R3916_REG_H
diff --git a/firmware_p4/components/Drivers/st25r3916/st25r3916_aat.c b/firmware_p4/components/Drivers/st25r3916/st25r3916_aat.c
index ad468b86..fb0ba192 100644
--- a/firmware_p4/components/Drivers/st25r3916/st25r3916_aat.c
+++ b/firmware_p4/components/Drivers/st25r3916/st25r3916_aat.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "st25r3916_aat.h"
diff --git a/firmware_p4/components/Drivers/st25r3916/st25r3916_core.c b/firmware_p4/components/Drivers/st25r3916/st25r3916_core.c
index 3600a5a0..726c0ba8 100644
--- a/firmware_p4/components/Drivers/st25r3916/st25r3916_core.c
+++ b/firmware_p4/components/Drivers/st25r3916/st25r3916_core.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "st25r3916_core.h"
diff --git a/firmware_p4/components/Drivers/st25r3916/st25r3916_fifo.c b/firmware_p4/components/Drivers/st25r3916/st25r3916_fifo.c
index 64c142e9..19177976 100644
--- a/firmware_p4/components/Drivers/st25r3916/st25r3916_fifo.c
+++ b/firmware_p4/components/Drivers/st25r3916/st25r3916_fifo.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "st25r3916_fifo.h"
diff --git a/firmware_p4/components/Drivers/st25r3916/st25r3916_irq.c b/firmware_p4/components/Drivers/st25r3916/st25r3916_irq.c
index 8f5912a4..c9e266d0 100644
--- a/firmware_p4/components/Drivers/st25r3916/st25r3916_irq.c
+++ b/firmware_p4/components/Drivers/st25r3916/st25r3916_irq.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "st25r3916_irq.h"
diff --git a/firmware_p4/components/Drivers/st7789/include/st7789.h b/firmware_p4/components/Drivers/st7789/include/st7789.h
index 9c0ee78a..d031449a 100644
--- a/firmware_p4/components/Drivers/st7789/include/st7789.h
+++ b/firmware_p4/components/Drivers/st7789/include/st7789.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ST7789_H
#define ST7789_H
diff --git a/firmware_p4/components/Drivers/st7789/st7789.c b/firmware_p4/components/Drivers/st7789/st7789.c
index 5d095aea..568d572b 100644
--- a/firmware_p4/components/Drivers/st7789/st7789.c
+++ b/firmware_p4/components/Drivers/st7789/st7789.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "st7789.h"
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262.h b/firmware_p4/components/Drivers/sx1262/include/sx1262.h
new file mode 100644
index 00000000..ff535832
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262.h
@@ -0,0 +1,228 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_H
+#define SX1262_H
+
+#include "esp_err.h"
+#include "sx1262_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize the SX1262 driver.
+ *
+ * Validates HAL callbacks and config, performs hardware reset,
+ * calibration, workarounds, and configures the radio.
+ * DS Section 14.5 init sequence.
+ *
+ * @param config Pointer to configuration (includes HAL). Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if config/HAL invalid.
+ */
+esp_err_t sx1262_init(const sx1262_config_t *config);
+
+/**
+ * @brief Start the IRQ processing task.
+ *
+ * Creates the ISR task and enables DIO1 interrupt.
+ *
+ * @return ESP_OK on success, ESP_ERR_INVALID_STATE if already running.
+ */
+esp_err_t sx1262_start(void);
+
+/**
+ * @brief Stop the IRQ processing task gracefully.
+ *
+ * Waits for task to exit via task notification. Safe to call if not running.
+ */
+void sx1262_stop(void);
+
+/**
+ * @brief Reconfigure LoRa parameters at runtime.
+ *
+ * Validates all parameters before any SPI transaction.
+ * Applies workaround W4 (IQ polarity) on every call.
+ *
+ * @param config Pointer to new configuration. Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid.
+ */
+esp_err_t sx1262_config_lora(const sx1262_config_t *config);
+
+/**
+ * @brief Register event callbacks.
+ *
+ * @param cbs Pointer to callback struct. Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if cbs is NULL.
+ */
+esp_err_t sx1262_set_callbacks(const sx1262_callbacks_t *cbs);
+
+/* ── FSM ──────────────────────────────────────────────────────────── */
+
+/**
+ * @brief Get current FSM state.
+ *
+ * @return Current state (sx1262_state_t).
+ */
+sx1262_state_t sx1262_get_state(void);
+
+/* ── Status ───────────────────────────────────────────────────────── */
+
+/**
+ * @brief Check if the IRQ processing task is running.
+ *
+ * @return true if running, false otherwise.
+ */
+bool sx1262_is_running(void);
+
+/**
+ * @brief Read chip status byte. DS Section 13.5.1.
+ *
+ * @param out_status Pointer to receive status byte. Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if out_status is NULL.
+ */
+esp_err_t sx1262_get_status(uint8_t *out_status);
+
+/**
+ * @brief Read device error bitmask. DS Section 13.5.7.
+ *
+ * @param out_errors Pointer to receive error bitmask. Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if out_errors is NULL.
+ */
+esp_err_t sx1262_get_device_errors(uint16_t *out_errors);
+
+/**
+ * @brief Read instantaneous RSSI of the channel. DS Section 13.5.4.
+ *
+ * @param out_rssi_dbm Pointer to receive RSSI in dBm. Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if out_rssi_dbm is NULL.
+ */
+esp_err_t sx1262_get_rssi_inst(int16_t *out_rssi_dbm);
+
+/**
+ * @brief Read packet statistics (received, CRC errors, header errors).
+ * DS Section 13.5.5.
+ *
+ * @param out_stats Pointer to receive statistics. Must not be NULL.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if out_stats is NULL.
+ */
+esp_err_t sx1262_get_stats(sx1262_stats_t *out_stats);
+
+/* ── TX ───────────────────────────────────────────────────────────── */
+
+/**
+ * @brief Transmit data via LoRa. Non-blocking.
+ *
+ * Applies workaround W1 (BW500 sensitivity) before each TX.
+ * Completion notified via on_tx_done callback.
+ *
+ * @param data Payload bytes. Must not be NULL.
+ * @param len Payload length (1-255). 0 returns ESP_ERR_INVALID_ARG.
+ * @param timeout_ms TX timeout in ms. 0 = no timeout.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if data is NULL or len is 0.
+ */
+esp_err_t sx1262_transmit(const uint8_t *data, uint8_t len, uint32_t timeout_ms);
+
+/* ── RX ───────────────────────────────────────────────────────────── */
+
+/**
+ * @brief Start single RX. Returns to STDBY after one packet or timeout.
+ *
+ * @param timeout_ms 0 = no timeout (wait forever). >0 = timeout in ms.
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_receive_single(uint32_t timeout_ms);
+
+/**
+ * @brief Start continuous RX. Stays in RX until sx1262_stop_rx() is called.
+ *
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_receive_continuous(void);
+
+/**
+ * @brief Stop RX and return to STDBY_RC.
+ */
+void sx1262_stop_rx(void);
+
+/**
+ * @brief Dequeue next received packet from the ring buffer.
+ *
+ * Thread-safe via enter_critical/exit_critical.
+ *
+ * @param out_packet Destination for packet data. Must not be NULL.
+ * @return ESP_OK if packet available, ESP_ERR_NOT_FOUND if empty.
+ */
+esp_err_t sx1262_get_packet(sx1262_packet_t *out_packet);
+
+/* ── CAD & Power ──────────────────────────────────────────────────── */
+
+/**
+ * @brief Start Channel Activity Detection. DS Section 13.4.7.
+ *
+ * CAD parameters adjusted per SF. Result via on_cad_done callback.
+ *
+ * @return ESP_OK on success, ESP_ERR_INVALID_STATE if in TX or UNKNOWN.
+ */
+esp_err_t sx1262_cad_start(void);
+
+/**
+ * @brief Enter sleep mode. DS Section 9.3.
+ *
+ * @param is_warm true = warm start (retain config), false = cold start.
+ * Cold start sets s_needs_reinit — TX/RX require re-init.
+ * @return ESP_OK on success, ESP_ERR_INVALID_STATE if transition not allowed.
+ */
+esp_err_t sx1262_sleep(bool is_warm);
+
+/**
+ * @brief Wake from sleep and enter STDBY_RC. DS Section 9.3.
+ *
+ * Toggles NSS LOW to wake chip, waits for BUSY, sends SetStandby(RC).
+ *
+ * @return ESP_OK on success, ESP_ERR_INVALID_STATE if not in SLEEP.
+ */
+esp_err_t sx1262_wakeup(void);
+
+/**
+ * @brief Start RX duty cycle (wake-on-radio). DS Table 13-12.
+ *
+ * Chip alternates between RX and sleep automatically.
+ * Period conversion: ticks = ms * 64 (1 tick = 15.625 us).
+ *
+ * @param rx_ms RX window in ms. Must be > 0.
+ * @param sleep_ms Sleep window in ms.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if rx_ms is 0.
+ */
+esp_err_t sx1262_set_rx_duty_cycle(uint32_t rx_ms, uint32_t sleep_ms);
+
+/* ── IRQ Processing ──────────────────────────────────────────────── */
+
+/**
+ * @brief Process pending IRQ flags from the SX1262.
+ *
+ * Called by ISR task when DIO1 rises. Never call directly from ISR.
+ * Sequence: GetIrqStatus -> ClearIrqStatus -> dispatch -> callbacks -> FSM.
+ *
+ * @return ESP_OK on success, ESP_ERR_INVALID_STATE if not initialized.
+ */
+esp_err_t sx1262_process_irq(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_cmd.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_cmd.h
new file mode 100644
index 00000000..88ebdcc9
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_cmd.h
@@ -0,0 +1,125 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_CMD_H
+#define SX1262_CMD_H
+
+#include
+#include
+#include "esp_err.h"
+#include "sx1262_hal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Wait for BUSY pin to go LOW with timeout.
+ *
+ * DS Section 8.3.1: BUSY must be LOW before any SPI transaction.
+ *
+ * @param hal Pointer to HAL.
+ * @param timeout_ms Maximum wait time. 0 = use default (100ms).
+ * @return ESP_OK if BUSY went LOW, ESP_ERR_TIMEOUT otherwise.
+ */
+esp_err_t sx1262_cmd_wait_busy(sx1262_hal_t *hal, uint32_t timeout_ms);
+
+/**
+ * @brief Write a command to the SX1262.
+ *
+ * DS Section 10.1: [opcode][param0][param1]...[paramN]
+ * lock() → wait_busy → cs_low → spi_transfer → cs_high → unlock()
+ *
+ * @param hal Pointer to HAL.
+ * @param opcode Command opcode from sx1262_regs.h.
+ * @param params Parameter bytes (may be NULL if len == 0).
+ * @param len Number of parameter bytes.
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_cmd_write(sx1262_hal_t *hal, uint8_t opcode, const uint8_t *params, size_t len);
+
+/**
+ * @brief Read response from the SX1262.
+ *
+ * DS Section 10.1: [opcode][NOP(status)][data0]...[dataN]
+ * lock() → wait_busy → cs_low → spi_transfer → cs_high → unlock()
+ *
+ * @param hal Pointer to HAL.
+ * @param opcode Command opcode.
+ * @param out_result Buffer for response bytes (excluding status).
+ * @param len Number of bytes to read.
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_cmd_read(sx1262_hal_t *hal, uint8_t opcode, uint8_t *out_result, size_t len);
+
+/**
+ * @brief Write to registers via direct access.
+ *
+ * DS Section 13.2.1: [0x0D][addr_msb][addr_lsb][data0]...[dataN]
+ *
+ * @param hal Pointer to HAL.
+ * @param addr 16-bit register address.
+ * @param data Data bytes to write. Must not be NULL.
+ * @param len Number of bytes. Must be > 0.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if data is NULL or len is 0.
+ */
+esp_err_t
+sx1262_cmd_write_register(sx1262_hal_t *hal, uint16_t addr, const uint8_t *data, size_t len);
+
+/**
+ * @brief Read from registers via direct access.
+ *
+ * DS Section 13.2.2: [0x1D][addr_msb][addr_lsb][NOP][data0]...[dataN]
+ *
+ * @param hal Pointer to HAL.
+ * @param addr 16-bit register address.
+ * @param out_data Buffer for read data. Must not be NULL.
+ * @param len Number of bytes to read. Must be > 0.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if out_data is NULL or len is 0.
+ */
+esp_err_t sx1262_cmd_read_register(sx1262_hal_t *hal, uint16_t addr, uint8_t *out_data, size_t len);
+
+/**
+ * @brief Write to data buffer.
+ *
+ * DS Section 13.2.3: [0x0E][offset][data0]...[dataN]
+ *
+ * @param hal Pointer to HAL.
+ * @param offset Buffer start offset.
+ * @param data Data bytes to write. Must not be NULL.
+ * @param len Number of bytes. Must be > 0.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if data is NULL or len is 0.
+ */
+esp_err_t
+sx1262_cmd_write_buffer(sx1262_hal_t *hal, uint8_t offset, const uint8_t *data, size_t len);
+
+/**
+ * @brief Read from data buffer.
+ *
+ * DS Section 13.2.4: [0x1E][offset][NOP][data0]...[dataN]
+ *
+ * @param hal Pointer to HAL.
+ * @param offset Buffer start offset.
+ * @param out_data Buffer for read data. Must not be NULL.
+ * @param len Number of bytes to read. Must be > 0.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if out_data is NULL or len is 0.
+ */
+esp_err_t sx1262_cmd_read_buffer(sx1262_hal_t *hal, uint8_t offset, uint8_t *out_data, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_CMD_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_fsm.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_fsm.h
new file mode 100644
index 00000000..380edfc2
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_fsm.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_FSM_H
+#define SX1262_FSM_H
+
+#include "esp_err.h"
+#include "sx1262_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize FSM to a known state.
+ */
+void sx1262_fsm_init(sx1262_state_t initial_state);
+
+/**
+ * @brief Get current FSM state.
+ */
+sx1262_state_t sx1262_fsm_get_state(void);
+
+/**
+ * @brief Validate and execute a state transition.
+ *
+ * Based strictly on DS Fig. 9-1 transition diagram.
+ * Returns ESP_ERR_INVALID_STATE if the transition is not allowed.
+ *
+ * @param target Desired target state.
+ * @return ESP_OK if transition is valid and state was updated.
+ */
+esp_err_t sx1262_fsm_transition(sx1262_state_t target);
+
+/**
+ * @brief Called after IRQ completes (TxDone, RxDone, Timeout).
+ *
+ * Sets state to fallback mode (STDBY_RC by default).
+ * DS Section 13.1.15: SetRxTxFallbackMode.
+ */
+void sx1262_fsm_on_irq_complete(void);
+
+/**
+ * @brief Check if a transition from current state to target is valid.
+ *
+ * Does NOT modify state. For query/validation only.
+ */
+bool sx1262_fsm_can_transition(sx1262_state_t target);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_FSM_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_hal.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_hal.h
new file mode 100644
index 00000000..d76d8c5c
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_hal.h
@@ -0,0 +1,139 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_HAL_H
+#define SX1262_HAL_H
+
+#include
+#include
+#include "esp_err.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief HAL contract for SX1262 driver.
+ *
+ * All hardware access is delegated through these function pointers.
+ * The driver core never includes platform headers.
+ * To port to a new platform, implement all callbacks in a new port/ file.
+ *
+ * ctx is an opaque pointer — the driver never inspects its contents.
+ */
+typedef struct sx1262_hal {
+ /**
+ * @brief Full-duplex SPI transfer. CS must be managed separately.
+ * @param ctx Opaque context.
+ * @param tx TX buffer (may be NULL for read-only).
+ * @param rx RX buffer (may be NULL for write-only).
+ * @param len Number of bytes to transfer.
+ * @return 0 on success, < 0 on failure.
+ */
+ int (*spi_transfer)(void *ctx, const uint8_t *tx, uint8_t *rx, size_t len);
+
+ /**
+ * @brief Assert chip select (NSS LOW).
+ * @param ctx Opaque context.
+ */
+ void (*cs_low)(void *ctx);
+
+ /**
+ * @brief De-assert chip select (NSS HIGH).
+ * @param ctx Opaque context.
+ */
+ void (*cs_high)(void *ctx);
+
+ /**
+ * @brief Write NRESET pin level. 0 = reset active (LOW).
+ * @param ctx Opaque context.
+ * @param level Pin level (0 or 1).
+ */
+ void (*reset_write)(void *ctx, uint8_t level);
+
+ /**
+ * @brief Read BUSY pin. Returns 1 if busy, 0 if ready. DS Section 8.3.1.
+ * @param ctx Opaque context.
+ * @return 1 if busy, 0 if ready.
+ */
+ uint8_t (*busy_read)(void *ctx);
+
+ /**
+ * @brief Blocking delay in milliseconds. Used only during reset and boot.
+ * @param ctx Opaque context.
+ * @param ms Delay in milliseconds.
+ */
+ void (*delay_ms)(void *ctx, uint32_t ms);
+
+ /**
+ * @brief Monotonic timestamp in milliseconds for timeout calculations.
+ * @param ctx Opaque context.
+ * @return Current tick count in milliseconds.
+ */
+ uint32_t (*get_tick_ms)(void *ctx);
+
+ /**
+ * @brief Lock SPI bus mutex. Called before every transaction.
+ * @param ctx Opaque context.
+ */
+ void (*lock)(void *ctx);
+
+ /**
+ * @brief Unlock SPI bus mutex. Called after every transaction.
+ * @param ctx Opaque context.
+ */
+ void (*unlock)(void *ctx);
+
+ /**
+ * @brief Disable interrupts. For ISR/task boundary protection.
+ * @param ctx Opaque context.
+ */
+ void (*enter_critical)(void *ctx);
+
+ /**
+ * @brief Re-enable interrupts.
+ * @param ctx Opaque context.
+ */
+ void (*exit_critical)(void *ctx);
+
+ /**
+ * @brief Set antenna switch mode.
+ * @param ctx Opaque context.
+ * @param mode 0 = OFF, 1 = RX, 2 = TX. Platform-specific pin control.
+ */
+ void (*set_antenna)(void *ctx, uint8_t mode);
+
+ /**
+ * @brief Opaque context pointer. Driver never inspects.
+ */
+ void *ctx;
+} sx1262_hal_t;
+
+/**
+ * @brief Create and initialize the HAL for SX1262.
+ *
+ * Configures SPI bus, GPIOs, and mutex. Fills out_hal with
+ * all callback pointers and context.
+ *
+ * @param out_hal Pointer to HAL struct to populate. Must not be NULL.
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_hal_create(sx1262_hal_t *out_hal);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_HAL_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_irq.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_irq.h
new file mode 100644
index 00000000..62f8eb41
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_irq.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_IRQ_H
+#define SX1262_IRQ_H
+
+#include "esp_err.h"
+#include "sx1262_types.h"
+#include "sx1262_hal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ── Ring Buffer Config ───────────────────────────────────────────── */
+#define SX1262_RX_RING_SIZE 8
+
+/**
+ * @brief Initialize IRQ subsystem. Resets ring buffer.
+ */
+void sx1262_irq_init(sx1262_hal_t *hal,
+ const sx1262_config_t *config,
+ const sx1262_callbacks_t *cbs);
+
+/**
+ * @brief Process pending IRQ flags.
+ *
+ * Called by ISR task when DIO1 rises. Never from ISR directly.
+ * Sequence: GetIrqStatus → ClearIrqStatus → process → callbacks → FSM update.
+ *
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_irq_process(void);
+
+/**
+ * @brief Dequeue next received packet from ring buffer.
+ *
+ * Thread-safe via enter_critical/exit_critical.
+ *
+ * @param out_packet Destination for packet data. Must not be NULL.
+ * @return ESP_OK if packet available, ESP_ERR_NOT_FOUND if empty.
+ */
+esp_err_t sx1262_irq_get_packet(sx1262_packet_t *out_packet);
+
+/**
+ * @brief Check if ring buffer has packets available.
+ */
+bool sx1262_irq_has_packet(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_IRQ_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_radio.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_radio.h
new file mode 100644
index 00000000..cf3aab2e
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_radio.h
@@ -0,0 +1,117 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_RADIO_H
+#define SX1262_RADIO_H
+
+#include "esp_err.h"
+#include "sx1262_types.h"
+#include "sx1262_hal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize radio subsystem with HAL and config pointers.
+ */
+void sx1262_radio_init(sx1262_hal_t *hal, sx1262_config_t *config);
+
+/**
+ * @brief Transmit data via LoRa. Applies W1 before each TX.
+ *
+ * Non-blocking: returns after SetTx command. Completion via TxDone IRQ.
+ *
+ * @param data Payload bytes. Must not be NULL.
+ * @param len Payload length (1–255).
+ * @param timeout_ms TX timeout in ms. 0 = no timeout.
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_radio_transmit(const uint8_t *data, uint8_t len, uint32_t timeout_ms);
+
+/**
+ * @brief Start single RX. Chip returns to STDBY after one packet or timeout.
+ *
+ * @param timeout_ms 0 = no timeout (single, wait forever). >0 = timeout in ms.
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_radio_receive_single(uint32_t timeout_ms);
+
+/**
+ * @brief Start continuous RX. Chip stays in RX until stop_rx().
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_radio_receive_continuous(void);
+
+/**
+ * @brief Stop RX and return to STDBY_RC.
+ */
+void sx1262_radio_stop_rx(void);
+
+/**
+ * @brief Start Channel Activity Detection.
+ * Result via on_cad_done callback (is_channel_active).
+ * CAD params adjusted per SF — DS Table 13-71.
+ */
+esp_err_t sx1262_radio_cad_start(void);
+
+/**
+ * @brief Read instantaneous RSSI. DS Section 13.5.4.
+ * @param out_rssi_dbm Result in dBm. Must not be NULL.
+ */
+esp_err_t sx1262_radio_get_rssi_inst(int16_t *out_rssi_dbm);
+
+/**
+ * @brief Read packet statistics. DS Section 13.5.5.
+ */
+esp_err_t sx1262_radio_get_stats(sx1262_stats_t *out_stats);
+
+/**
+ * @brief Reset packet statistics. DS Section 13.5.6.
+ */
+esp_err_t sx1262_radio_reset_stats(void);
+
+/**
+ * @brief Enter sleep mode. DS Section 9.3, Table 13-1.
+ *
+ * @param is_warm true = warm start (retain config), false = cold start (needs re-init).
+ * @return ESP_OK on success.
+ */
+esp_err_t sx1262_radio_sleep(bool is_warm);
+
+/**
+ * @brief Wake from sleep and enter STDBY_RC. DS Section 9.3.
+ *
+ * Toggles NSS to wake chip, waits for BUSY LOW, sends SetStandby(RC).
+ * @return ESP_OK on success, ESP_ERR_INVALID_STATE if not in SLEEP.
+ */
+esp_err_t sx1262_radio_wakeup(void);
+
+/**
+ * @brief Start RX duty cycle (wake-on-radio). DS Table 13-12.
+ *
+ * Chip alternates RX/sleep automatically. 1 tick = 15.625 us.
+ *
+ * @param rx_ms RX window in ms. Must be > 0.
+ * @param sleep_ms Sleep window in ms.
+ * @return ESP_OK on success, ESP_ERR_INVALID_ARG if rx_ms == 0.
+ */
+esp_err_t sx1262_radio_set_rx_duty_cycle(uint32_t rx_ms, uint32_t sleep_ms);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_RADIO_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_regs.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_regs.h
new file mode 100644
index 00000000..33a52583
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_regs.h
@@ -0,0 +1,263 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_REGS_H
+#define SX1262_REGS_H
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ── Opcodes: Operational Modes ───────────────────────────────────── */
+#define SX1262_OP_SET_SLEEP 0x84 /* Enter sleep mode (warm/cold) */
+#define SX1262_OP_SET_STANDBY 0x80 /* Enter standby (RC or XOSC) */
+#define SX1262_OP_SET_FS 0xC1 /* Enter frequency synthesis mode */
+#define SX1262_OP_SET_TX 0x83 /* Start transmission */
+#define SX1262_OP_SET_RX 0x82 /* Start reception */
+#define SX1262_OP_STOP_TIMER_ON_PREAMBLE 0x9F /* Stop RX timer on preamble detect */
+#define SX1262_OP_SET_RX_DUTY_CYCLE 0x94 /* RX/sleep duty cycle (wake-on-radio) */
+#define SX1262_OP_SET_CAD 0xC5 /* Start channel activity detection */
+#define SX1262_OP_SET_TX_CONTINUOUS_WAVE 0xD1 /* Continuous wave (test mode) */
+#define SX1262_OP_SET_TX_INFINITE_PREAMBLE 0xD2 /* Infinite preamble (test mode) */
+#define SX1262_OP_SET_REGULATOR_MODE 0x96 /* Select LDO or DC-DC regulator */
+#define SX1262_OP_CALIBRATE 0x89 /* Calibrate RC, PLL, ADC blocks */
+#define SX1262_OP_CALIBRATE_IMAGE 0x98 /* Calibrate image rejection for freq */
+#define SX1262_OP_SET_PA_CONFIG 0x95 /* Configure power amplifier */
+#define SX1262_OP_SET_RX_TX_FALLBACK_MODE 0x93 /* State after TX/RX complete */
+
+/* ── Opcodes: Register and Buffer Access ─────────────────────────── */
+#define SX1262_OP_WRITE_REGISTER 0x0D /* Write to internal register */
+#define SX1262_OP_READ_REGISTER 0x1D /* Read from internal register */
+#define SX1262_OP_WRITE_BUFFER 0x0E /* Write payload to data buffer */
+#define SX1262_OP_READ_BUFFER 0x1E /* Read payload from data buffer */
+
+/* ── Opcodes: DIO and IRQ Control ────────────────────────────────── */
+#define SX1262_OP_SET_DIO_IRQ_PARAMS 0x08 /* Map IRQ flags to DIO1/2/3 pins */
+#define SX1262_OP_GET_IRQ_STATUS 0x12 /* Read pending IRQ flags */
+#define SX1262_OP_CLEAR_IRQ_STATUS 0x02 /* Clear IRQ flags */
+#define SX1262_OP_SET_DIO2_AS_RF_SWITCH 0x9D /* DIO2 controls external RF switch */
+#define SX1262_OP_SET_DIO3_AS_TCXO 0x97 /* DIO3 powers external TCXO */
+
+/* ── Opcodes: RF, Modulation and Packet ──────────────────────────── */
+#define SX1262_OP_SET_RF_FREQUENCY 0x86 /* Set carrier frequency in Hz */
+#define SX1262_OP_SET_PACKET_TYPE 0x8A /* Select LoRa or FSK modulation */
+#define SX1262_OP_GET_PACKET_TYPE 0x11 /* Read current modulation type */
+#define SX1262_OP_SET_TX_PARAMS 0x8E /* Set TX power and PA ramp time */
+#define SX1262_OP_SET_MODULATION_PARAMS 0x8B /* Set SF, BW, CR, LDRO */
+#define SX1262_OP_SET_PACKET_PARAMS 0x8C /* Set preamble, header, CRC, IQ */
+#define SX1262_OP_SET_CAD_PARAMS 0x88 /* Set CAD detection thresholds */
+#define SX1262_OP_SET_BUFFER_BASE_ADDR 0x8F /* Set TX/RX buffer start offsets */
+#define SX1262_OP_SET_LORA_SYMB_NUM_TIMEOUT 0xA0 /* Set symbol timeout for RX */
+
+/* ── Opcodes: Status ─────────────────────────────────────────────── */
+#define SX1262_OP_GET_STATUS 0xC0 /* Read chip mode and command status */
+#define SX1262_OP_GET_RX_BUFFER_STATUS 0x13 /* Read RX payload length and offset */
+#define SX1262_OP_GET_PACKET_STATUS 0x14 /* Read RSSI, SNR of last packet */
+#define SX1262_OP_GET_RSSI_INST 0x15 /* Read instantaneous channel RSSI */
+#define SX1262_OP_GET_STATS 0x10 /* Read RX packet/error counters */
+#define SX1262_OP_RESET_STATS 0x00 /* Reset RX packet/error counters */
+#define SX1262_OP_GET_DEVICE_ERRORS 0x17 /* Read hardware error bitmask */
+#define SX1262_OP_CLEAR_DEVICE_ERRORS 0x07 /* Clear hardware error bitmask */
+
+/* ── Standby Modes ───────────────────────────────────────────────── */
+#define SX1262_STDBY_RC 0x00 /* 13 MHz RC oscillator */
+#define SX1262_STDBY_XOSC 0x01 /* External crystal oscillator */
+
+/* ── Packet Type ─────────────────────────────────────────────────── */
+#define SX1262_PACKET_TYPE_GFSK 0x00 /* FSK modulation */
+#define SX1262_PACKET_TYPE_LORA 0x01 /* LoRa modulation */
+
+/* ── Regulator Mode ──────────────────────────────────────────────── */
+#define SX1262_REGULATOR_LDO 0x00 /* LDO regulator (higher consumption) */
+#define SX1262_REGULATOR_DCDC 0x01 /* DC-DC regulator (lower consumption) */
+
+/* ── PA Ramp Time ────────────────────────────────────────────────── */
+#define SX1262_PA_RAMP_10U 0x00 /* 10 us */
+#define SX1262_PA_RAMP_20U 0x01 /* 20 us */
+#define SX1262_PA_RAMP_40U 0x02 /* 40 us */
+#define SX1262_PA_RAMP_80U 0x03 /* 80 us */
+#define SX1262_PA_RAMP_200U 0x04 /* 200 us */
+#define SX1262_PA_RAMP_800U 0x05 /* 800 us */
+#define SX1262_PA_RAMP_1700U 0x06 /* 1.7 ms */
+#define SX1262_PA_RAMP_3400U 0x07 /* 3.4 ms */
+
+/* ── LoRa Spreading Factor ────────────────────────────────────────── */
+#define SX1262_LORA_SF5 0x05 /* Fastest, shortest range */
+#define SX1262_LORA_SF6 0x06 /* Requires implicit header */
+#define SX1262_LORA_SF7 0x07 /* Default for most apps */
+#define SX1262_LORA_SF8 0x08
+#define SX1262_LORA_SF9 0x09
+#define SX1262_LORA_SF10 0x0A
+#define SX1262_LORA_SF11 0x0B /* LDRO required at BW<=125kHz */
+#define SX1262_LORA_SF12 0x0C /* Slowest, longest range */
+
+/* ── LoRa Bandwidth (values are non-linear — use sx1262_bw_to_hz()) ── */
+#define SX1262_LORA_BW_7 0x00 /* 7.81 kHz */
+#define SX1262_LORA_BW_10 0x08 /* 10.42 kHz */
+#define SX1262_LORA_BW_15 0x01 /* 15.63 kHz */
+#define SX1262_LORA_BW_20 0x09 /* 20.83 kHz */
+#define SX1262_LORA_BW_31 0x02 /* 31.25 kHz */
+#define SX1262_LORA_BW_41 0x0A /* 41.67 kHz */
+#define SX1262_LORA_BW_62 0x03 /* 62.50 kHz */
+#define SX1262_LORA_BW_125 0x04 /* 125 kHz */
+#define SX1262_LORA_BW_250 0x05 /* 250 kHz */
+#define SX1262_LORA_BW_500 0x06 /* 500 kHz */
+
+/* ── LoRa Coding Rate ────────────────────────────────────────────── */
+#define SX1262_LORA_CR_4_5 0x01 /* 4/5 — least redundancy */
+#define SX1262_LORA_CR_4_6 0x02 /* 4/6 */
+#define SX1262_LORA_CR_4_7 0x03 /* 4/7 */
+#define SX1262_LORA_CR_4_8 0x04 /* 4/8 — most redundancy */
+
+/* ── LoRa Header Type ────────────────────────────────────────────── */
+#define SX1262_LORA_HEADER_EXPLICIT 0x00 /* Header with payload len, CR, CRC */
+#define SX1262_LORA_HEADER_IMPLICIT 0x01 /* No header — params must match */
+
+/* ── IRQ Flag Masks ──────────────────────────────────────────────── */
+#define SX1262_IRQ_TX_DONE (1U << 0) /* Transmission complete */
+#define SX1262_IRQ_RX_DONE (1U << 1) /* Packet received */
+#define SX1262_IRQ_PREAMBLE_DETECTED (1U << 2) /* LoRa preamble detected */
+#define SX1262_IRQ_SYNC_WORD_VALID (1U << 3) /* Sync word matched */
+#define SX1262_IRQ_HEADER_VALID (1U << 4) /* Valid header received */
+#define SX1262_IRQ_HEADER_ERR (1U << 5) /* Header CRC error */
+#define SX1262_IRQ_CRC_ERR (1U << 6) /* Payload CRC error */
+#define SX1262_IRQ_CAD_DONE (1U << 7) /* CAD scan complete */
+#define SX1262_IRQ_CAD_DETECTED (1U << 8) /* LoRa activity detected */
+#define SX1262_IRQ_TIMEOUT (1U << 9) /* RX or TX timeout */
+#define SX1262_IRQ_ALL 0x03FFU /* All flags combined */
+
+/* ── LoRa Sync Word Registers ────────────────────────────────────── */
+#define SX1262_REG_LORA_SYNC_WORD_MSB 0x0740 /* Sync word byte 0 */
+#define SX1262_REG_LORA_SYNC_WORD_LSB 0x0741 /* Sync word byte 1 */
+#define SX1262_LORA_SYNC_WORD_PUBLIC 0x3444 /* LoRaWAN public network */
+#define SX1262_LORA_SYNC_WORD_PRIVATE 0x1424 /* Private/Meshtastic network */
+
+/* ── Rx Gain Register ────────────────────────────────────────────── */
+#define SX1262_REG_RX_GAIN 0x08AC /* RX gain boost control */
+
+/* ── Workaround Registers (DS Section 15) ────────────────────────── */
+#define SX1262_REG_TX_MODULATION 0x0889 /* W1: BW500 sensitivity fix — bit 2 */
+#define SX1262_REG_TX_CLAMP_CONFIG 0x08D8 /* W2: PA over-clamp fix — bits 4:1 */
+#define SX1262_REG_RTC_CTRL 0x0902 /* W3: Implicit header timeout — bit 0 */
+#define SX1262_REG_EVT_CLR 0x0944 /* W3: Event clear for RTC stop — bit 1 */
+#define SX1262_REG_IQ_POLARITY 0x0736 /* W4: Inverted IQ polarity fix — bit 2 */
+
+/* ── Sleep Configuration ─────────────────────────────────────────── */
+#define SX1262_SLEEP_COLD_START 0x00 /* Lose all config, full re-init needed */
+#define SX1262_SLEEP_WARM_START 0x04 /* Retain config, fast wakeup */
+
+/* ── Fallback Mode After TX/RX ───────────────────────────────────── */
+#define SX1262_FALLBACK_STDBY_RC 0x20 /* Return to standby RC */
+#define SX1262_FALLBACK_STDBY_XOSC 0x30 /* Return to standby XOSC */
+#define SX1262_FALLBACK_FS 0x40 /* Return to frequency synth */
+
+/* ── Calibration Block Bitmask ───────────────────────────────────── */
+#define SX1262_CALIBRATE_RC64K (1U << 0) /* 64 kHz RC oscillator */
+#define SX1262_CALIBRATE_RC13M (1U << 1) /* 13 MHz RC oscillator */
+#define SX1262_CALIBRATE_PLL (1U << 2) /* PLL synthesizer */
+#define SX1262_CALIBRATE_ADC_PULSE (1U << 3) /* ADC pulse */
+#define SX1262_CALIBRATE_ADC_BULK_N (1U << 4) /* ADC bulk N-path */
+#define SX1262_CALIBRATE_ADC_BULK_P (1U << 5) /* ADC bulk P-path */
+#define SX1262_CALIBRATE_IMAGE (1U << 6) /* Image rejection */
+#define SX1262_CALIBRATE_ALL 0x7F /* All blocks */
+
+/* ── Status Byte Parsing ─────────────────────────────────────────── */
+#define SX1262_STATUS_CHIP_MODE_MASK 0x70 /* Bits 6:4 = chip operating mode */
+#define SX1262_STATUS_CHIP_MODE_SHIFT 4
+#define SX1262_STATUS_CMD_STATUS_MASK 0x0E /* Bits 3:1 = last command status */
+#define SX1262_STATUS_CMD_STATUS_SHIFT 1
+
+/* ── Chip Mode Values (from status byte bits 6:4) ────────────────── */
+#define SX1262_CHIP_MODE_UNUSED 0x00 /* Not used */
+#define SX1262_CHIP_MODE_STDBY_RC 0x02 /* Standby with RC oscillator */
+#define SX1262_CHIP_MODE_STDBY_XOSC 0x03 /* Standby with crystal */
+#define SX1262_CHIP_MODE_FS 0x04 /* Frequency synthesis */
+#define SX1262_CHIP_MODE_RX 0x05 /* Receiving */
+#define SX1262_CHIP_MODE_TX 0x06 /* Transmitting */
+
+/* ── Timing Constants ────────────────────────────────────────────── */
+#define SX1262_WAIT_BUSY_TIMEOUT_MS 100 /* Max wait for BUSY LOW */
+#define SX1262_RESET_HOLD_MS 2 /* NRESET LOW hold time */
+#define SX1262_RESET_WAIT_MS 20 /* Wait after NRESET HIGH */
+
+/* ── TCXO Supply Voltage ─────────────────────────────────────────── */
+#define SX1262_TCXO_1V6 0x00 /* 1.6V */
+#define SX1262_TCXO_1V7 0x01 /* 1.7V */
+#define SX1262_TCXO_1V8 0x02 /* 1.8V */
+#define SX1262_TCXO_2V2 0x03 /* 2.2V */
+#define SX1262_TCXO_2V4 0x04 /* 2.4V */
+#define SX1262_TCXO_2V7 0x05 /* 2.7V */
+#define SX1262_TCXO_3V0 0x06 /* 3.0V */
+#define SX1262_TCXO_3V3 0x07 /* 3.3V */
+
+/* ── PA Configuration (optimal for +22 dBm on SX1262) ────────────── */
+#define SX1262_PA_DUTY_CYCLE_22DBM 0x04 /* PA duty cycle for +22dBm */
+#define SX1262_PA_HP_MAX_22DBM 0x07 /* HP PA max power */
+#define SX1262_PA_DEVICE_SEL_SX1262 0x00 /* Device select: SX1262 */
+#define SX1262_PA_LUT_1 0x01 /* PA lookup table 1 */
+
+/* ── Antenna Switch Modes ────────────────────────────────────────── */
+#define SX1262_ANT_OFF 0x00 /* Both TX/RX switches off */
+#define SX1262_ANT_RX 0x01 /* RX path enabled */
+#define SX1262_ANT_TX 0x02 /* TX path enabled */
+
+/**
+ * @brief Convert LoRa BW enum (DS Table 13-48) to bandwidth in Hz.
+ *
+ * BW enum values are non-linear, so direct comparison is unsafe.
+ * Use this function for any BW magnitude comparison.
+ */
+static inline uint32_t sx1262_bw_to_hz(uint8_t bw) {
+ switch (bw) {
+ case SX1262_LORA_BW_7:
+ return 7810;
+ case SX1262_LORA_BW_10:
+ return 10420;
+ case SX1262_LORA_BW_15:
+ return 15630;
+ case SX1262_LORA_BW_20:
+ return 20830;
+ case SX1262_LORA_BW_31:
+ return 31250;
+ case SX1262_LORA_BW_41:
+ return 41670;
+ case SX1262_LORA_BW_62:
+ return 62500;
+ case SX1262_LORA_BW_125:
+ return 125000;
+ case SX1262_LORA_BW_250:
+ return 250000;
+ case SX1262_LORA_BW_500:
+ return 500000;
+ default:
+ return 0;
+ }
+}
+
+/**
+ * @brief Check if a BW enum value is valid (DS Table 13-48).
+ */
+static inline bool sx1262_bw_is_valid(uint8_t bw) {
+ return sx1262_bw_to_hz(bw) != 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_REGS_H
diff --git a/firmware_p4/components/Drivers/sx1262/include/sx1262_types.h b/firmware_p4/components/Drivers/sx1262/include/sx1262_types.h
new file mode 100644
index 00000000..78df28ce
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/include/sx1262_types.h
@@ -0,0 +1,128 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef SX1262_TYPES_H
+#define SX1262_TYPES_H
+
+#include
+#include
+#include "sx1262_hal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief FSM states matching DS Fig. 9-1 / Table 9-1.
+ */
+typedef enum {
+ SX1262_STATE_UNKNOWN = 0, /**< Before any init. */
+ SX1262_STATE_SLEEP = 1, /**< Minimum consumption — DS Section 9.3. */
+ SX1262_STATE_STDBY_RC = 2, /**< RC13M active — DS Section 9.4. */
+ SX1262_STATE_STDBY_XOSC = 3, /**< XOSC active — DS Section 9.4. */
+ SX1262_STATE_FS = 4, /**< PLL locked — DS Section 9.5. */
+ SX1262_STATE_TX = 5, /**< Transmitting — DS Section 9.7. */
+ SX1262_STATE_RX = 6, /**< Receiving — DS Section 9.6. */
+} sx1262_state_t;
+
+/**
+ * @brief LoRa radio configuration parameters.
+ */
+typedef struct {
+ sx1262_hal_t hal; /**< Platform HAL — all callbacks. */
+ uint32_t frequency_hz; /**< 150 000 000 – 960 000 000 Hz. */
+ uint8_t sf; /**< Spreading factor: SX1262_LORA_SF5 … SF12. */
+ uint8_t bw; /**< Bandwidth: SX1262_LORA_BW_7 … BW_500. */
+ uint8_t cr; /**< Coding rate: SX1262_LORA_CR_4_5 … CR_4_8. */
+ int8_t tx_power_dbm; /**< TX power: -9 to +22 dBm. */
+ uint16_t preamble_len; /**< Preamble symbols. Min recommended: 12. */
+ bool is_crc_on; /**< Enable CRC on payload. */
+ bool is_inverted_iq; /**< true = LoRaWAN downlink (activates W4). */
+ bool is_implicit_hdr; /**< true = Implicit Header mode (activates W3). */
+ bool is_public_network; /**< true = public sync word (0x3444). */
+} sx1262_config_t;
+
+/**
+ * @brief Received packet with payload and RF metadata.
+ */
+typedef struct {
+ uint8_t buf[256]; /**< Payload — static buffer. */
+ uint8_t len; /**< Valid bytes in buf. */
+ int16_t rssi_pkt_dbm; /**< Packet RSSI in dBm. */
+ int8_t snr_pkt_db; /**< SNR in dB. */
+ int16_t signal_rssi_dbm; /**< Signal RSSI — DS Section 13.5.3. */
+ bool has_crc_error; /**< CRC check failed. */
+ bool has_header_error; /**< Header corrupted. */
+} sx1262_packet_t;
+
+/**
+ * @brief Packet statistics counters. DS Section 13.5.5.
+ */
+typedef struct {
+ uint16_t nb_pkt_received; /**< Total packets received. */
+ uint16_t nb_crc_error; /**< Packets with CRC error. */
+ uint16_t nb_header_error; /**< Packets with header error. */
+} sx1262_stats_t;
+
+/**
+ * @brief Callback: TX completed successfully.
+ * @param ctx User context pointer.
+ */
+typedef void (*sx1262_tx_done_cb_t)(void *ctx);
+
+/**
+ * @brief Callback: packet received.
+ * @param pkt Pointer to received packet data.
+ * @param ctx User context pointer.
+ */
+typedef void (*sx1262_rx_done_cb_t)(const sx1262_packet_t *pkt, void *ctx);
+
+/**
+ * @brief Callback: CAD completed.
+ * @param is_channel_active true if LoRa activity detected.
+ * @param ctx User context pointer.
+ */
+typedef void (*sx1262_cad_done_cb_t)(bool is_channel_active, void *ctx);
+
+/**
+ * @brief Callback: RX or TX timeout.
+ * @param ctx User context pointer.
+ */
+typedef void (*sx1262_timeout_cb_t)(void *ctx);
+
+/**
+ * @brief Callback: hardware error (CRC or header error standalone).
+ * @param err Error code.
+ * @param ctx User context pointer.
+ */
+typedef void (*sx1262_error_cb_t)(int err, void *ctx);
+
+/**
+ * @brief Event callback registration struct.
+ */
+typedef struct {
+ sx1262_tx_done_cb_t on_tx_done; /**< TX done callback. May be NULL. */
+ sx1262_rx_done_cb_t on_rx_done; /**< RX done callback. May be NULL. */
+ sx1262_cad_done_cb_t on_cad_done; /**< CAD done callback. May be NULL. */
+ sx1262_timeout_cb_t on_timeout; /**< Timeout callback. May be NULL. */
+ sx1262_error_cb_t on_error; /**< Error callback. May be NULL. */
+ void *cb_ctx; /**< User context for all callbacks. */
+} sx1262_callbacks_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SX1262_TYPES_H
diff --git a/firmware_p4/components/Drivers/sx1262/sx1262.c b/firmware_p4/components/Drivers/sx1262/sx1262.c
new file mode 100644
index 00000000..32789b6a
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/sx1262.c
@@ -0,0 +1,685 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "sx1262.h"
+
+#include
+
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+
+#include "sx1262_regs.h"
+#include "sx1262_cmd.h"
+#include "sx1262_fsm.h"
+#include "sx1262_irq.h"
+#include "sx1262_radio.h"
+
+static const char *TAG = "SX1262";
+
+static sx1262_config_t s_config;
+static sx1262_callbacks_t s_callbacks = {0};
+static bool s_is_running = false;
+static bool s_is_initialized = false;
+static TaskHandle_t s_irq_task_handle = NULL;
+static TaskHandle_t s_stop_caller_handle = NULL;
+
+#define SX1262_IRQ_TASK_STACK 4096
+#define SX1262_IRQ_TASK_PRIO 10
+#define SX1262_IRQ_TASK_CORE 0
+
+static esp_err_t validate_hal(const sx1262_hal_t *hal);
+static esp_err_t validate_config(const sx1262_config_t *config);
+static esp_err_t hw_reset(sx1262_hal_t *hal);
+static esp_err_t apply_workaround_w2(sx1262_hal_t *hal);
+static esp_err_t apply_workaround_w4(sx1262_hal_t *hal, bool is_inverted_iq);
+static esp_err_t calibrate_image(sx1262_hal_t *hal, uint32_t freq_hz);
+static uint8_t compute_ldro(uint8_t sf, uint8_t bw);
+static void irq_task(void *arg);
+
+esp_err_t sx1262_init(const sx1262_config_t *config) {
+ if (config == NULL) {
+ ESP_LOGE(TAG, "config is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ esp_err_t ret = validate_hal(&config->hal);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = validate_config(config);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ memcpy(&s_config, config, sizeof(sx1262_config_t));
+ sx1262_hal_t *hal = &s_config.hal;
+
+ ret = hw_reset(hal);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ sx1262_fsm_init(SX1262_STATE_STDBY_RC);
+
+ uint8_t stdby_param = SX1262_STDBY_RC;
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_STANDBY, &stdby_param, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetStandby failed");
+ return ret;
+ }
+
+ uint8_t reg_mode = SX1262_REGULATOR_DCDC;
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_REGULATOR_MODE, ®_mode, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetRegulatorMode failed");
+ return ret;
+ }
+
+ uint8_t cal_param = SX1262_CALIBRATE_ALL;
+ ret = sx1262_cmd_write(hal, SX1262_OP_CALIBRATE, &cal_param, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Calibrate failed");
+ return ret;
+ }
+
+ ret = sx1262_cmd_wait_busy(hal, SX1262_WAIT_BUSY_TIMEOUT_MS);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "BUSY timeout after Calibrate");
+ return ret;
+ }
+
+ ret = calibrate_image(hal, config->frequency_hz);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = apply_workaround_w2(hal);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ uint8_t fallback_param = SX1262_FALLBACK_STDBY_RC;
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_RX_TX_FALLBACK_MODE, &fallback_param, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetRxTxFallbackMode failed");
+ return ret;
+ }
+
+ uint8_t dio2_param = 0x01;
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_DIO2_AS_RF_SWITCH, &dio2_param, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetDIO2AsRfSwitch failed");
+ return ret;
+ }
+
+ uint8_t err_buf[2] = {0};
+ ret = sx1262_cmd_read(hal, SX1262_OP_GET_DEVICE_ERRORS, err_buf, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "GetDeviceErrors failed");
+ return ret;
+ }
+ uint16_t device_errors = ((uint16_t)err_buf[0] << 8) | err_buf[1];
+ if (device_errors != 0) {
+ ESP_LOGE(TAG, "Device errors after calibration: 0x%04X", device_errors);
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ uint8_t clr_params[2] = {0x00, 0x00};
+ sx1262_cmd_write(hal, SX1262_OP_CLEAR_DEVICE_ERRORS, clr_params, 2);
+
+ s_is_initialized = true;
+
+ ret = sx1262_config_lora(config);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ sx1262_irq_init(hal, &s_config, &s_callbacks);
+
+ sx1262_radio_init(hal, &s_config);
+
+ uint8_t status = 0;
+ ret = sx1262_get_status(&status);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ uint8_t chip_mode = (status & SX1262_STATUS_CHIP_MODE_MASK) >> SX1262_STATUS_CHIP_MODE_SHIFT;
+
+ ESP_LOGI(TAG,
+ "Init OK — status: 0x%02X, chip_mode: %d (STDBY_RC=%d)",
+ status,
+ chip_mode,
+ SX1262_CHIP_MODE_STDBY_RC);
+ ESP_LOGI(TAG,
+ "Initialized — freq: %lu, sf: %d, bw: 0x%02X, power: %d dBm",
+ (unsigned long)config->frequency_hz,
+ config->sf,
+ config->bw,
+ config->tx_power_dbm);
+
+ return ESP_OK;
+}
+
+esp_err_t sx1262_config_lora(const sx1262_config_t *config) {
+ if (config == NULL) {
+ ESP_LOGE(TAG, "config_lora: config is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ esp_err_t ret = validate_config(config);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ sx1262_hal_t hal_backup = s_config.hal;
+ memcpy(&s_config, config, sizeof(sx1262_config_t));
+ s_config.hal = hal_backup;
+
+ sx1262_hal_t *hal = &s_config.hal;
+
+ uint8_t pkt_type = SX1262_PACKET_TYPE_LORA;
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_PACKET_TYPE, &pkt_type, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetPacketType failed");
+ return ret;
+ }
+
+ uint32_t rf_freq = (uint32_t)((uint64_t)config->frequency_hz * (1UL << 25) / 32000000UL);
+ uint8_t freq_params[4] = {
+ (uint8_t)(rf_freq >> 24),
+ (uint8_t)(rf_freq >> 16),
+ (uint8_t)(rf_freq >> 8),
+ (uint8_t)(rf_freq),
+ };
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_RF_FREQUENCY, freq_params, 4);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetRfFrequency failed");
+ return ret;
+ }
+
+ uint8_t pa_params[4] = {
+ SX1262_PA_DUTY_CYCLE_22DBM,
+ SX1262_PA_HP_MAX_22DBM,
+ SX1262_PA_DEVICE_SEL_SX1262,
+ SX1262_PA_LUT_1,
+ };
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_PA_CONFIG, pa_params, 4);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetPaConfig failed");
+ return ret;
+ }
+
+ uint8_t tx_params[2] = {(uint8_t)config->tx_power_dbm, SX1262_PA_RAMP_200U};
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_TX_PARAMS, tx_params, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetTxParams failed");
+ return ret;
+ }
+
+ uint8_t buf_addr[2] = {0x00, 0x00};
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_BUFFER_BASE_ADDR, buf_addr, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetBufferBaseAddress failed");
+ return ret;
+ }
+
+ uint8_t ldro = compute_ldro(config->sf, config->bw);
+ uint8_t mod_params[4] = {config->sf, config->bw, config->cr, ldro};
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_MODULATION_PARAMS, mod_params, 4);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetModulationParams failed");
+ return ret;
+ }
+
+ uint8_t header_type =
+ config->is_implicit_hdr ? SX1262_LORA_HEADER_IMPLICIT : SX1262_LORA_HEADER_EXPLICIT;
+ uint8_t crc_on = config->is_crc_on ? 0x01 : 0x00;
+ uint8_t invert_iq = config->is_inverted_iq ? 0x01 : 0x00;
+ uint8_t pkt_params[6] = {
+ (uint8_t)(config->preamble_len >> 8),
+ (uint8_t)(config->preamble_len & 0xFF),
+ header_type,
+ 0xFF,
+ crc_on,
+ invert_iq,
+ };
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_PACKET_PARAMS, pkt_params, 6);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetPacketParams failed");
+ return ret;
+ }
+
+ uint16_t irq_mask = SX1262_IRQ_TX_DONE | SX1262_IRQ_RX_DONE | SX1262_IRQ_TIMEOUT |
+ SX1262_IRQ_CRC_ERR | SX1262_IRQ_HEADER_ERR | SX1262_IRQ_CAD_DONE |
+ SX1262_IRQ_CAD_DETECTED;
+ uint8_t irq_params[8] = {
+ (uint8_t)(irq_mask >> 8),
+ (uint8_t)(irq_mask),
+ (uint8_t)(irq_mask >> 8),
+ (uint8_t)(irq_mask),
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ };
+ ret = sx1262_cmd_write(hal, SX1262_OP_SET_DIO_IRQ_PARAMS, irq_params, 8);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetDioIrqParams failed");
+ return ret;
+ }
+
+ uint16_t sync_word =
+ config->is_public_network ? SX1262_LORA_SYNC_WORD_PUBLIC : SX1262_LORA_SYNC_WORD_PRIVATE;
+ uint8_t sw_data[2] = {(uint8_t)(sync_word >> 8), (uint8_t)(sync_word)};
+ ret = sx1262_cmd_write_register(hal, SX1262_REG_LORA_SYNC_WORD_MSB, sw_data, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetSyncWord failed");
+ return ret;
+ }
+
+ ret = apply_workaround_w4(hal, config->is_inverted_iq);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ESP_LOGI(TAG,
+ "LoRa configured — SF%d BW=0x%02X CR=4/%d LDRO=%d power=%ddBm %s",
+ config->sf,
+ config->bw,
+ config->cr + 4,
+ ldro,
+ config->tx_power_dbm,
+ config->is_inverted_iq ? "IQ_INV" : "IQ_STD");
+
+ return ESP_OK;
+}
+
+sx1262_state_t sx1262_get_state(void) {
+ return sx1262_fsm_get_state();
+}
+
+bool sx1262_is_running(void) {
+ return s_is_running;
+}
+
+esp_err_t sx1262_get_status(uint8_t *out_status) {
+ if (out_status == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ sx1262_hal_t *hal = &s_config.hal;
+
+ uint8_t tx[2] = {SX1262_OP_GET_STATUS, 0x00};
+ uint8_t rx[2] = {0};
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ hal->lock(hal->ctx);
+ hal->cs_low(hal->ctx);
+ hal->spi_transfer(hal->ctx, tx, rx, 2);
+ hal->cs_high(hal->ctx);
+ hal->unlock(hal->ctx);
+
+ *out_status = rx[1];
+ return ESP_OK;
+}
+
+esp_err_t sx1262_get_device_errors(uint16_t *out_errors) {
+ if (out_errors == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ sx1262_hal_t *hal = &s_config.hal;
+ uint8_t buf[2] = {0};
+
+ esp_err_t ret = sx1262_cmd_read(hal, SX1262_OP_GET_DEVICE_ERRORS, buf, 2);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ *out_errors = ((uint16_t)buf[0] << 8) | buf[1];
+ return ESP_OK;
+}
+
+esp_err_t sx1262_start(void) {
+ if (s_is_running) {
+ ESP_LOGE(TAG, "Already running");
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (!s_is_initialized) {
+ ESP_LOGE(TAG, "Not initialized");
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ BaseType_t xret = xTaskCreatePinnedToCore(irq_task,
+ "sx1262_irq",
+ SX1262_IRQ_TASK_STACK,
+ NULL,
+ SX1262_IRQ_TASK_PRIO,
+ &s_irq_task_handle,
+ SX1262_IRQ_TASK_CORE);
+
+ if (xret != pdPASS || s_irq_task_handle == NULL) {
+ ESP_LOGE(TAG, "Failed to create IRQ task");
+ return ESP_ERR_NO_MEM;
+ }
+
+ s_is_running = true;
+ ESP_LOGI(TAG, "IRQ task started");
+ return ESP_OK;
+}
+
+void sx1262_stop(void) {
+ if (!s_is_running) {
+ return;
+ }
+ s_stop_caller_handle = xTaskGetCurrentTaskHandle();
+ s_is_running = false;
+ if (s_irq_task_handle != NULL) {
+ ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(500));
+ s_irq_task_handle = NULL;
+ }
+ s_stop_caller_handle = NULL;
+ s_config.hal.set_antenna(s_config.hal.ctx, SX1262_ANT_OFF);
+ ESP_LOGI(TAG, "Stopped");
+}
+
+esp_err_t sx1262_set_callbacks(const sx1262_callbacks_t *cbs) {
+ if (cbs == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+ memcpy(&s_callbacks, cbs, sizeof(sx1262_callbacks_t));
+ if (s_is_initialized) {
+ sx1262_irq_init(&s_config.hal, &s_config, &s_callbacks);
+ }
+ return ESP_OK;
+}
+
+esp_err_t sx1262_process_irq(void) {
+ return sx1262_irq_process();
+}
+
+esp_err_t sx1262_get_packet(sx1262_packet_t *out_packet) {
+ return sx1262_irq_get_packet(out_packet);
+}
+
+esp_err_t sx1262_get_rssi_inst(int16_t *out_rssi_dbm) {
+ return sx1262_radio_get_rssi_inst(out_rssi_dbm);
+}
+
+esp_err_t sx1262_get_stats(sx1262_stats_t *out_stats) {
+ return sx1262_radio_get_stats(out_stats);
+}
+esp_err_t sx1262_transmit(const uint8_t *data, uint8_t len, uint32_t timeout_ms) {
+ return sx1262_radio_transmit(data, len, timeout_ms);
+}
+esp_err_t sx1262_receive_single(uint32_t timeout_ms) {
+ return sx1262_radio_receive_single(timeout_ms);
+}
+
+esp_err_t sx1262_receive_continuous(void) {
+ return sx1262_radio_receive_continuous();
+}
+
+void sx1262_stop_rx(void) {
+ sx1262_radio_stop_rx();
+}
+esp_err_t sx1262_cad_start(void) {
+ return sx1262_radio_cad_start();
+}
+esp_err_t sx1262_sleep(bool is_warm) {
+ return sx1262_radio_sleep(is_warm);
+}
+
+esp_err_t sx1262_wakeup(void) {
+ return sx1262_radio_wakeup();
+}
+
+esp_err_t sx1262_set_rx_duty_cycle(uint32_t rx_ms, uint32_t sleep_ms) {
+ return sx1262_radio_set_rx_duty_cycle(rx_ms, sleep_ms);
+}
+
+static void irq_task(void *arg) {
+ (void)arg;
+ sx1262_hal_t *hal = &s_config.hal;
+
+ ESP_LOGI(TAG, "IRQ task running");
+
+ while (s_is_running) {
+ sx1262_irq_process();
+ hal->delay_ms(hal->ctx, 10);
+ }
+
+ ESP_LOGI(TAG, "IRQ task exiting");
+
+ if (s_stop_caller_handle != NULL) {
+ xTaskNotifyGive(s_stop_caller_handle);
+ }
+ vTaskDelete(NULL);
+}
+
+static esp_err_t validate_hal(const sx1262_hal_t *hal) {
+ if (hal->spi_transfer == NULL) {
+ ESP_LOGE(TAG, "HAL: spi_transfer is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->cs_low == NULL) {
+ ESP_LOGE(TAG, "HAL: cs_low is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->cs_high == NULL) {
+ ESP_LOGE(TAG, "HAL: cs_high is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->reset_write == NULL) {
+ ESP_LOGE(TAG, "HAL: reset_write is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->busy_read == NULL) {
+ ESP_LOGE(TAG, "HAL: busy_read is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->delay_ms == NULL) {
+ ESP_LOGE(TAG, "HAL: delay_ms is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->get_tick_ms == NULL) {
+ ESP_LOGE(TAG, "HAL: get_tick_ms is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->lock == NULL) {
+ ESP_LOGE(TAG, "HAL: lock is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->unlock == NULL) {
+ ESP_LOGE(TAG, "HAL: unlock is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->enter_critical == NULL) {
+ ESP_LOGE(TAG, "HAL: enter_critical is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->exit_critical == NULL) {
+ ESP_LOGE(TAG, "HAL: exit_critical is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->set_antenna == NULL) {
+ ESP_LOGE(TAG, "HAL: set_antenna is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (hal->ctx == NULL) {
+ ESP_LOGE(TAG, "HAL: ctx is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ return ESP_OK;
+}
+
+static esp_err_t validate_config(const sx1262_config_t *config) {
+ if (config->frequency_hz < 150000000UL || config->frequency_hz > 960000000UL) {
+ ESP_LOGE(TAG, "frequency_hz out of range: %lu", (unsigned long)config->frequency_hz);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (config->sf < SX1262_LORA_SF5 || config->sf > SX1262_LORA_SF12) {
+ ESP_LOGE(TAG, "sf out of range: %d", config->sf);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (!sx1262_bw_is_valid(config->bw)) {
+ ESP_LOGE(TAG, "bw invalid: 0x%02X", config->bw);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (config->bw == SX1262_LORA_BW_500 && config->sf < SX1262_LORA_SF6) {
+ ESP_LOGE(TAG, "BW_500 requires SF >= 6, got SF%d", config->sf);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (config->cr < SX1262_LORA_CR_4_5 || config->cr > SX1262_LORA_CR_4_8) {
+ ESP_LOGE(TAG, "cr out of range: %d", config->cr);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (config->tx_power_dbm < -9 || config->tx_power_dbm > 22) {
+ ESP_LOGE(TAG, "tx_power_dbm out of range: %d", config->tx_power_dbm);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (config->preamble_len < 2) {
+ ESP_LOGE(TAG, "preamble_len too short: %d", config->preamble_len);
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (config->sf == SX1262_LORA_SF6 && !config->is_implicit_hdr) {
+ ESP_LOGE(TAG, "SF6 requires implicit header mode");
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ return ESP_OK;
+}
+
+static esp_err_t hw_reset(sx1262_hal_t *hal) {
+ hal->set_antenna(hal->ctx, SX1262_ANT_OFF);
+ hal->reset_write(hal->ctx, 0);
+ hal->delay_ms(hal->ctx, SX1262_RESET_HOLD_MS);
+ hal->reset_write(hal->ctx, 1);
+ hal->delay_ms(hal->ctx, SX1262_RESET_WAIT_MS);
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, SX1262_WAIT_BUSY_TIMEOUT_MS);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "BUSY did not go LOW after reset");
+ return ret;
+ }
+
+ ESP_LOGI(TAG, "Hardware reset complete");
+ return ESP_OK;
+}
+
+static esp_err_t apply_workaround_w2(sx1262_hal_t *hal) {
+ uint8_t val = 0;
+ esp_err_t ret = sx1262_cmd_read_register(hal, SX1262_REG_TX_CLAMP_CONFIG, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W2: read 0x%04X failed", SX1262_REG_TX_CLAMP_CONFIG);
+ return ret;
+ }
+
+ val |= 0x1E; /* Set bits 4:1 to 1111 */
+
+ ret = sx1262_cmd_write_register(hal, SX1262_REG_TX_CLAMP_CONFIG, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W2: write 0x%04X failed", SX1262_REG_TX_CLAMP_CONFIG);
+ return ret;
+ }
+
+ ESP_LOGD(TAG, "W2 applied: reg 0x%04X = 0x%02X", SX1262_REG_TX_CLAMP_CONFIG, val);
+ return ESP_OK;
+}
+
+static esp_err_t apply_workaround_w4(sx1262_hal_t *hal, bool is_inverted_iq) {
+ uint8_t val = 0;
+ esp_err_t ret = sx1262_cmd_read_register(hal, SX1262_REG_IQ_POLARITY, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W4: read 0x%04X failed", SX1262_REG_IQ_POLARITY);
+ return ret;
+ }
+
+ if (is_inverted_iq) {
+ val &= ~(1U << 2);
+ } else {
+ val |= (1U << 2);
+ }
+
+ ret = sx1262_cmd_write_register(hal, SX1262_REG_IQ_POLARITY, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W4: write 0x%04X failed", SX1262_REG_IQ_POLARITY);
+ return ret;
+ }
+
+ ESP_LOGD(TAG,
+ "W4 applied: reg 0x%04X = 0x%02X (inverted=%d)",
+ SX1262_REG_IQ_POLARITY,
+ val,
+ is_inverted_iq);
+ return ESP_OK;
+}
+
+static esp_err_t calibrate_image(sx1262_hal_t *hal, uint32_t freq_hz) {
+ uint8_t params[2];
+
+ if (freq_hz >= 902000000UL) {
+ params[0] = 0xE1;
+ params[1] = 0xE9;
+ } else if (freq_hz >= 863000000UL) {
+ params[0] = 0xD7;
+ params[1] = 0xDB;
+ } else if (freq_hz >= 779000000UL) {
+ params[0] = 0xC1;
+ params[1] = 0xC5;
+ } else if (freq_hz >= 470000000UL) {
+ params[0] = 0x75;
+ params[1] = 0x81;
+ } else {
+ params[0] = 0x6B;
+ params[1] = 0x6F;
+ }
+
+ esp_err_t ret = sx1262_cmd_write(hal, SX1262_OP_CALIBRATE_IMAGE, params, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "CalibrateImage failed");
+ return ret;
+ }
+
+ ret = sx1262_cmd_wait_busy(hal, SX1262_WAIT_BUSY_TIMEOUT_MS);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "BUSY timeout after CalibrateImage");
+ return ret;
+ }
+
+ return ESP_OK;
+}
+
+static uint8_t compute_ldro(uint8_t sf, uint8_t bw) {
+ if (sf >= SX1262_LORA_SF11 && sx1262_bw_to_hz(bw) <= 125000) {
+ return 0x01;
+ }
+ return 0x00;
+}
diff --git a/firmware_p4/components/Drivers/sx1262/sx1262_cmd.c b/firmware_p4/components/Drivers/sx1262/sx1262_cmd.c
new file mode 100644
index 00000000..cb7b5832
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/sx1262_cmd.c
@@ -0,0 +1,216 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "sx1262_cmd.h"
+
+#include
+
+#include "esp_log.h"
+
+#include "sx1262_regs.h"
+
+#define MAX_CMD_BUF_LEN 264
+
+static const char *TAG = "SX1262_CMD";
+
+static esp_err_t transfer_locked(sx1262_hal_t *hal, const uint8_t *tx, uint8_t *rx, size_t len);
+
+esp_err_t sx1262_cmd_wait_busy(sx1262_hal_t *hal, uint32_t timeout_ms) {
+ if (timeout_ms == 0) {
+ timeout_ms = SX1262_WAIT_BUSY_TIMEOUT_MS;
+ }
+
+ uint32_t start = hal->get_tick_ms(hal->ctx);
+
+ while (hal->busy_read(hal->ctx)) {
+ uint32_t elapsed = hal->get_tick_ms(hal->ctx) - start;
+ if (elapsed >= timeout_ms) {
+ ESP_LOGE(TAG, "BUSY timeout after %lu ms", (unsigned long)elapsed);
+ return ESP_ERR_TIMEOUT;
+ }
+ hal->delay_ms(hal->ctx, 1);
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t sx1262_cmd_write(sx1262_hal_t *hal, uint8_t opcode, const uint8_t *params, size_t len) {
+ if (len > 0 && params == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ size_t total = 1 + len;
+ uint8_t tx_buf[MAX_CMD_BUF_LEN];
+
+ tx_buf[0] = opcode;
+ if (len > 0) {
+ memcpy(&tx_buf[1], params, len);
+ }
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ return transfer_locked(hal, tx_buf, NULL, total);
+}
+
+esp_err_t sx1262_cmd_read(sx1262_hal_t *hal, uint8_t opcode, uint8_t *out_result, size_t len) {
+ if (len > 0 && out_result == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ size_t total = 1 + 1 + len;
+ uint8_t tx_buf[MAX_CMD_BUF_LEN];
+ uint8_t rx_buf[MAX_CMD_BUF_LEN];
+
+ memset(tx_buf, 0x00, total);
+ memset(rx_buf, 0x00, total);
+ tx_buf[0] = opcode;
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = transfer_locked(hal, tx_buf, rx_buf, total);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ if (len > 0) {
+ memcpy(out_result, &rx_buf[2], len);
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t
+sx1262_cmd_write_register(sx1262_hal_t *hal, uint16_t addr, const uint8_t *data, size_t len) {
+ if (len == 0 || data == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ size_t total = 3 + len;
+ uint8_t tx_buf[MAX_CMD_BUF_LEN];
+
+ tx_buf[0] = SX1262_OP_WRITE_REGISTER;
+ tx_buf[1] = (uint8_t)(addr >> 8);
+ tx_buf[2] = (uint8_t)(addr & 0xFF);
+ memcpy(&tx_buf[3], data, len);
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ return transfer_locked(hal, tx_buf, NULL, total);
+}
+
+esp_err_t
+sx1262_cmd_read_register(sx1262_hal_t *hal, uint16_t addr, uint8_t *out_data, size_t len) {
+ if (len == 0 || out_data == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ size_t total = 4 + len;
+ uint8_t tx_buf[MAX_CMD_BUF_LEN];
+ uint8_t rx_buf[MAX_CMD_BUF_LEN];
+
+ memset(tx_buf, 0x00, total);
+ memset(rx_buf, 0x00, total);
+ tx_buf[0] = SX1262_OP_READ_REGISTER;
+ tx_buf[1] = (uint8_t)(addr >> 8);
+ tx_buf[2] = (uint8_t)(addr & 0xFF);
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = transfer_locked(hal, tx_buf, rx_buf, total);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ memcpy(out_data, &rx_buf[4], len);
+ return ESP_OK;
+}
+
+esp_err_t
+sx1262_cmd_write_buffer(sx1262_hal_t *hal, uint8_t offset, const uint8_t *data, size_t len) {
+ if (len == 0 || data == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ size_t total = 2 + len;
+ uint8_t tx_buf[MAX_CMD_BUF_LEN];
+
+ tx_buf[0] = SX1262_OP_WRITE_BUFFER;
+ tx_buf[1] = offset;
+ memcpy(&tx_buf[2], data, len);
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ return transfer_locked(hal, tx_buf, NULL, total);
+}
+
+esp_err_t sx1262_cmd_read_buffer(sx1262_hal_t *hal, uint8_t offset, uint8_t *out_data, size_t len) {
+ if (len == 0 || out_data == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ size_t total = 3 + len;
+ uint8_t tx_buf[MAX_CMD_BUF_LEN];
+ uint8_t rx_buf[MAX_CMD_BUF_LEN];
+
+ memset(tx_buf, 0x00, total);
+ memset(rx_buf, 0x00, total);
+ tx_buf[0] = SX1262_OP_READ_BUFFER;
+ tx_buf[1] = offset;
+
+ esp_err_t ret = sx1262_cmd_wait_busy(hal, 0);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = transfer_locked(hal, tx_buf, rx_buf, total);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ memcpy(out_data, &rx_buf[3], len);
+ return ESP_OK;
+}
+
+static esp_err_t transfer_locked(sx1262_hal_t *hal, const uint8_t *tx, uint8_t *rx, size_t len) {
+ hal->lock(hal->ctx);
+ hal->cs_low(hal->ctx);
+
+ int spi_ret = hal->spi_transfer(hal->ctx, tx, rx, len);
+
+ hal->cs_high(hal->ctx);
+ hal->unlock(hal->ctx);
+
+ if (spi_ret < 0) {
+ ESP_LOGE(TAG, "SPI transfer failed: %d", spi_ret);
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
diff --git a/firmware_p4/components/Drivers/sx1262/sx1262_fsm.c b/firmware_p4/components/Drivers/sx1262/sx1262_fsm.c
new file mode 100644
index 00000000..0b29345c
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/sx1262_fsm.c
@@ -0,0 +1,76 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "sx1262_fsm.h"
+
+#include "esp_log.h"
+
+#define FSM_NUM_STATES 7
+
+static const char *TAG = "SX1262_FSM";
+
+static sx1262_state_t s_state = SX1262_STATE_UNKNOWN;
+
+/* UNKN SLEEP RC XOSC FS TX RX */
+static const bool s_transition[FSM_NUM_STATES][FSM_NUM_STATES] = {
+ /* FROM UNKNOWN */ {false, false, true, false, false, false, false},
+ /* FROM SLEEP */ {false, false, true, false, false, false, false},
+ /* FROM STDBY_RC */ {false, true, false, true, true, true, true},
+ /* FROM STDBY_XOSC */ {false, true, true, false, true, true, true},
+ /* FROM FS */ {false, true, true, true, false, true, true},
+ /* FROM TX */ {false, false, true, false, false, false, false},
+ /* FROM RX */ {false, false, true, false, false, false, false},
+};
+
+static const char *s_state_names[FSM_NUM_STATES] = {
+ "UNKNOWN", "SLEEP", "STDBY_RC", "STDBY_XOSC", "FS", "TX", "RX"};
+
+void sx1262_fsm_init(sx1262_state_t initial_state) {
+ s_state = initial_state;
+ ESP_LOGI(TAG, "FSM initialized → %s", s_state_names[s_state]);
+}
+
+sx1262_state_t sx1262_fsm_get_state(void) {
+ return s_state;
+}
+
+bool sx1262_fsm_can_transition(sx1262_state_t target) {
+ if (s_state >= FSM_NUM_STATES || target >= FSM_NUM_STATES) {
+ return false;
+ }
+ return s_transition[s_state][target];
+}
+
+esp_err_t sx1262_fsm_transition(sx1262_state_t target) {
+ if (s_state >= FSM_NUM_STATES || target >= FSM_NUM_STATES) {
+ ESP_LOGE(TAG, "Invalid state index: current=%d, target=%d", s_state, target);
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ if (!s_transition[s_state][target]) {
+ ESP_LOGE(TAG, "Transition NOT allowed: %s → %s", s_state_names[s_state], s_state_names[target]);
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ ESP_LOGD(TAG, "%s → %s", s_state_names[s_state], s_state_names[target]);
+ s_state = target;
+ return ESP_OK;
+}
+
+void sx1262_fsm_on_irq_complete(void) {
+ sx1262_state_t prev = s_state;
+ s_state = SX1262_STATE_STDBY_RC;
+ ESP_LOGD(TAG, "IRQ complete: %s → STDBY_RC", s_state_names[prev]);
+}
diff --git a/firmware_p4/components/Drivers/sx1262/sx1262_hal.c b/firmware_p4/components/Drivers/sx1262/sx1262_hal.c
new file mode 100644
index 00000000..afd73ef9
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/sx1262_hal.c
@@ -0,0 +1,256 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "sx1262_hal.h"
+
+#include
+
+#include "esp_log.h"
+#include "driver/spi_master.h"
+#include "driver/gpio.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "freertos/semphr.h"
+
+#include "pin_def.h"
+#include "sx1262_regs.h"
+
+#define PIN_SCK GPIO_LORA_SCLK_PIN
+#define PIN_MOSI GPIO_LORA_MOSI_PIN
+#define PIN_MISO GPIO_LORA_MISO_PIN
+#define PIN_NSS GPIO_LORA_CS_PIN
+#define PIN_NRST GPIO_LORA_RESET_PIN
+#define PIN_BUSY GPIO_LORA_BUSY_PIN
+#define PIN_DIO1 GPIO_LORA_DIO1_PIN
+#define PIN_TXEN GPIO_LORA_TXEN_PIN
+#define PIN_RXEN GPIO_LORA_RXEN_PIN
+
+#define SPI_HOST_ID SPI3_HOST
+#define SPI_FREQ_HZ 8000000
+#define SPI_MAX_TRANSFER 264
+
+static const char *TAG = "SX1262_HAL_ESP32";
+
+typedef struct {
+ spi_device_handle_t spi;
+ SemaphoreHandle_t spi_mutex;
+ portMUX_TYPE critical_mux;
+ bool is_initialized;
+} hal_esp32_ctx_t;
+
+static hal_esp32_ctx_t s_ctx = {
+ .spi = NULL,
+ .spi_mutex = NULL,
+ .critical_mux = portMUX_INITIALIZER_UNLOCKED,
+ .is_initialized = false,
+};
+
+static int hal_spi_transfer(void *ctx, const uint8_t *tx, uint8_t *rx, size_t len) {
+ hal_esp32_ctx_t *c = (hal_esp32_ctx_t *)ctx;
+
+ spi_transaction_t t = {
+ .length = len * 8,
+ .tx_buffer = tx,
+ .rx_buffer = rx,
+ };
+
+ esp_err_t ret = spi_device_transmit(c->spi, &t);
+ return (ret == ESP_OK) ? 0 : -1;
+}
+
+static void hal_cs_low(void *ctx) {
+ (void)ctx;
+ gpio_set_level(PIN_NSS, 0);
+}
+
+static void hal_cs_high(void *ctx) {
+ (void)ctx;
+ gpio_set_level(PIN_NSS, 1);
+}
+
+static void hal_reset_write(void *ctx, uint8_t level) {
+ (void)ctx;
+ gpio_set_level(PIN_NRST, level ? 1 : 0);
+}
+
+static uint8_t hal_busy_read(void *ctx) {
+ (void)ctx;
+ return (uint8_t)gpio_get_level(PIN_BUSY);
+}
+
+static void hal_delay_ms(void *ctx, uint32_t ms) {
+ (void)ctx;
+ vTaskDelay(pdMS_TO_TICKS(ms));
+}
+
+static uint32_t hal_get_tick_ms(void *ctx) {
+ (void)ctx;
+ return (uint32_t)(xTaskGetTickCount() * portTICK_PERIOD_MS);
+}
+
+static void hal_lock(void *ctx) {
+ hal_esp32_ctx_t *c = (hal_esp32_ctx_t *)ctx;
+ xSemaphoreTake(c->spi_mutex, portMAX_DELAY);
+}
+
+static void hal_unlock(void *ctx) {
+ hal_esp32_ctx_t *c = (hal_esp32_ctx_t *)ctx;
+ xSemaphoreGive(c->spi_mutex);
+}
+
+static void hal_enter_critical(void *ctx) {
+ hal_esp32_ctx_t *c = (hal_esp32_ctx_t *)ctx;
+ portENTER_CRITICAL(&c->critical_mux);
+}
+
+static void hal_exit_critical(void *ctx) {
+ hal_esp32_ctx_t *c = (hal_esp32_ctx_t *)ctx;
+ portEXIT_CRITICAL(&c->critical_mux);
+}
+
+static void hal_set_antenna(void *ctx, uint8_t mode) {
+ (void)ctx;
+ if (PIN_TXEN < 0 || PIN_RXEN < 0) {
+ return;
+ }
+ switch (mode) {
+ case SX1262_ANT_TX:
+ gpio_set_level(PIN_TXEN, 1);
+ gpio_set_level(PIN_RXEN, 0);
+ break;
+ case SX1262_ANT_RX:
+ gpio_set_level(PIN_TXEN, 0);
+ gpio_set_level(PIN_RXEN, 1);
+ break;
+ default: /* SX1262_ANT_OFF */
+ gpio_set_level(PIN_TXEN, 0);
+ gpio_set_level(PIN_RXEN, 0);
+ break;
+ }
+}
+
+esp_err_t sx1262_hal_create(sx1262_hal_t *out_hal) {
+ if (out_hal == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (s_ctx.is_initialized) {
+ ESP_LOGW(TAG, "HAL already initialized");
+ goto fill_hal;
+ }
+
+ uint64_t out_mask = (1ULL << PIN_NSS) | (1ULL << PIN_NRST);
+ if (PIN_TXEN >= 0) {
+ out_mask |= (1ULL << PIN_TXEN);
+ }
+ if (PIN_RXEN >= 0) {
+ out_mask |= (1ULL << PIN_RXEN);
+ }
+ gpio_config_t out_conf = {
+ .pin_bit_mask = out_mask,
+ .mode = GPIO_MODE_OUTPUT,
+ .pull_up_en = GPIO_PULLUP_DISABLE,
+ .pull_down_en = GPIO_PULLDOWN_DISABLE,
+ .intr_type = GPIO_INTR_DISABLE,
+ };
+ esp_err_t ret = gpio_config(&out_conf);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "GPIO output config failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ gpio_set_level(PIN_NSS, 1);
+ if (PIN_TXEN >= 0) {
+ gpio_set_level(PIN_TXEN, 0);
+ }
+ if (PIN_RXEN >= 0) {
+ gpio_set_level(PIN_RXEN, 0);
+ }
+
+ gpio_config_t in_conf = {
+ .pin_bit_mask = (1ULL << PIN_BUSY) | (1ULL << PIN_DIO1),
+ .mode = GPIO_MODE_INPUT,
+ .pull_up_en = GPIO_PULLUP_DISABLE,
+ .pull_down_en = GPIO_PULLDOWN_DISABLE,
+ .intr_type = GPIO_INTR_DISABLE,
+ };
+ ret = gpio_config(&in_conf);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "GPIO input config failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ spi_bus_config_t bus_cfg = {
+ .mosi_io_num = PIN_MOSI,
+ .miso_io_num = PIN_MISO,
+ .sclk_io_num = PIN_SCK,
+ .quadwp_io_num = -1,
+ .quadhd_io_num = -1,
+ .max_transfer_sz = SPI_MAX_TRANSFER,
+ };
+
+ ret = spi_bus_initialize(SPI_HOST_ID, &bus_cfg, SPI_DMA_CH_AUTO);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SPI bus init failed: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ spi_device_interface_config_t dev_cfg = {
+ .clock_speed_hz = SPI_FREQ_HZ,
+ .mode = 0,
+ .spics_io_num = -1,
+ .queue_size = 1,
+ };
+
+ ret = spi_bus_add_device(SPI_HOST_ID, &dev_cfg, &s_ctx.spi);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SPI add device failed: %s", esp_err_to_name(ret));
+ spi_bus_free(SPI_HOST_ID);
+ return ret;
+ }
+
+ /* ── Mutex ──────────────────────────────────────────────────── */
+ s_ctx.spi_mutex = xSemaphoreCreateMutex();
+ if (s_ctx.spi_mutex == NULL) {
+ ESP_LOGE(TAG, "Failed to create SPI mutex");
+ spi_bus_remove_device(s_ctx.spi);
+ spi_bus_free(SPI_HOST_ID);
+ return ESP_ERR_NO_MEM;
+ }
+
+ s_ctx.is_initialized = true;
+ ESP_LOGI(TAG,
+ "Hardware initialized — SPI@%dMHz, NSS=GPIO%d, BUSY=GPIO%d",
+ SPI_FREQ_HZ / 1000000,
+ PIN_NSS,
+ PIN_BUSY);
+
+fill_hal:
+ out_hal->spi_transfer = hal_spi_transfer;
+ out_hal->cs_low = hal_cs_low;
+ out_hal->cs_high = hal_cs_high;
+ out_hal->reset_write = hal_reset_write;
+ out_hal->busy_read = hal_busy_read;
+ out_hal->delay_ms = hal_delay_ms;
+ out_hal->get_tick_ms = hal_get_tick_ms;
+ out_hal->lock = hal_lock;
+ out_hal->unlock = hal_unlock;
+ out_hal->enter_critical = hal_enter_critical;
+ out_hal->exit_critical = hal_exit_critical;
+ out_hal->set_antenna = hal_set_antenna;
+ out_hal->ctx = &s_ctx;
+
+ return ESP_OK;
+}
diff --git a/firmware_p4/components/Drivers/sx1262/sx1262_irq.c b/firmware_p4/components/Drivers/sx1262/sx1262_irq.c
new file mode 100644
index 00000000..e463311c
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/sx1262_irq.c
@@ -0,0 +1,245 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "sx1262_irq.h"
+
+#include
+
+#include "esp_log.h"
+
+#include "sx1262_regs.h"
+#include "sx1262_cmd.h"
+#include "sx1262_fsm.h"
+
+static const char *TAG = "SX1262_IRQ";
+
+static sx1262_hal_t *s_hal = NULL;
+static const sx1262_config_t *s_config = NULL;
+static sx1262_callbacks_t s_cbs = {0};
+
+static sx1262_packet_t s_rx_ring[SX1262_RX_RING_SIZE];
+static volatile uint8_t s_rx_head = 0;
+static volatile uint8_t s_rx_tail = 0;
+
+static esp_err_t read_rx_packet(sx1262_packet_t *out_pkt, uint16_t irq_flags);
+static void apply_workaround_w3(void);
+
+void sx1262_irq_init(sx1262_hal_t *hal,
+ const sx1262_config_t *config,
+ const sx1262_callbacks_t *cbs) {
+ s_hal = hal;
+ s_config = config;
+ s_rx_head = 0;
+ s_rx_tail = 0;
+
+ if (cbs != NULL) {
+ memcpy(&s_cbs, cbs, sizeof(sx1262_callbacks_t));
+ } else {
+ memset(&s_cbs, 0, sizeof(sx1262_callbacks_t));
+ }
+
+ ESP_LOGI(TAG, "IRQ subsystem initialized, ring buffer reset");
+}
+
+esp_err_t sx1262_irq_process(void) {
+ if (s_hal == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ uint8_t irq_buf[2] = {0};
+ esp_err_t ret = sx1262_cmd_read(s_hal, SX1262_OP_GET_IRQ_STATUS, irq_buf, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "GetIrqStatus failed");
+ return ret;
+ }
+ uint16_t irq_flags = ((uint16_t)irq_buf[0] << 8) | irq_buf[1];
+
+ if (irq_flags == 0) {
+ return ESP_OK;
+ }
+
+ uint8_t clr_params[2] = {(uint8_t)(irq_flags >> 8), (uint8_t)(irq_flags)};
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_CLEAR_IRQ_STATUS, clr_params, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "ClearIrqStatus failed");
+ return ret;
+ }
+
+ if (irq_flags & SX1262_IRQ_TX_DONE) {
+ ESP_LOGD(TAG, "IRQ: TxDone");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ sx1262_fsm_on_irq_complete();
+
+ if (s_cbs.on_tx_done != NULL) {
+ s_cbs.on_tx_done(s_cbs.cb_ctx);
+ }
+ }
+
+ if (irq_flags & SX1262_IRQ_RX_DONE) {
+ ESP_LOGD(TAG, "IRQ: RxDone");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+
+ if (s_config != NULL && s_config->is_implicit_hdr) {
+ apply_workaround_w3();
+ }
+
+ sx1262_packet_t pkt = {0};
+ ret = read_rx_packet(&pkt, irq_flags);
+ if (ret == ESP_OK) {
+ s_hal->enter_critical(s_hal->ctx);
+ uint8_t next_head = (s_rx_head + 1) % SX1262_RX_RING_SIZE;
+ if (next_head == s_rx_tail) {
+ s_hal->exit_critical(s_hal->ctx);
+ ESP_LOGW(TAG, "Ring buffer full — packet discarded");
+ } else {
+ memcpy(&s_rx_ring[s_rx_head], &pkt, sizeof(sx1262_packet_t));
+ s_rx_head = next_head;
+ s_hal->exit_critical(s_hal->ctx);
+ }
+
+ if (s_cbs.on_rx_done != NULL) {
+ s_cbs.on_rx_done(&pkt, s_cbs.cb_ctx);
+ }
+ }
+
+ sx1262_fsm_on_irq_complete();
+ }
+
+ if (irq_flags & SX1262_IRQ_TIMEOUT) {
+ ESP_LOGD(TAG, "IRQ: Timeout");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ sx1262_fsm_on_irq_complete();
+
+ if (s_cbs.on_timeout != NULL) {
+ s_cbs.on_timeout(s_cbs.cb_ctx);
+ }
+ }
+
+ if ((irq_flags & SX1262_IRQ_CRC_ERR) && !(irq_flags & SX1262_IRQ_RX_DONE)) {
+ ESP_LOGW(TAG, "IRQ: CRC error (standalone)");
+ if (s_cbs.on_error != NULL) {
+ s_cbs.on_error(ESP_ERR_INVALID_CRC, s_cbs.cb_ctx);
+ }
+ }
+ if ((irq_flags & SX1262_IRQ_HEADER_ERR) && !(irq_flags & SX1262_IRQ_RX_DONE)) {
+ ESP_LOGW(TAG, "IRQ: Header error (standalone)");
+ if (s_cbs.on_error != NULL) {
+ s_cbs.on_error(ESP_FAIL, s_cbs.cb_ctx);
+ }
+ }
+
+ if (irq_flags & SX1262_IRQ_CAD_DONE) {
+ bool is_detected = (irq_flags & SX1262_IRQ_CAD_DETECTED) != 0;
+ ESP_LOGD(TAG, "IRQ: CAD done, detected=%d", is_detected);
+ sx1262_fsm_on_irq_complete();
+
+ if (s_cbs.on_cad_done != NULL) {
+ s_cbs.on_cad_done(is_detected, s_cbs.cb_ctx);
+ }
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t sx1262_irq_get_packet(sx1262_packet_t *out_packet) {
+ if (out_packet == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (s_hal == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ s_hal->enter_critical(s_hal->ctx);
+
+ if (s_rx_head == s_rx_tail) {
+ s_hal->exit_critical(s_hal->ctx);
+ return ESP_ERR_NOT_FOUND;
+ }
+
+ memcpy(out_packet, &s_rx_ring[s_rx_tail], sizeof(sx1262_packet_t));
+ s_rx_tail = (s_rx_tail + 1) % SX1262_RX_RING_SIZE;
+
+ s_hal->exit_critical(s_hal->ctx);
+ return ESP_OK;
+}
+
+bool sx1262_irq_has_packet(void) {
+ if (s_hal == NULL) {
+ return false;
+ }
+ s_hal->enter_critical(s_hal->ctx);
+ bool has = (s_rx_head != s_rx_tail);
+ s_hal->exit_critical(s_hal->ctx);
+ return has;
+}
+
+static esp_err_t read_rx_packet(sx1262_packet_t *out_pkt, uint16_t irq_flags) {
+ uint8_t rx_buf_status[2] = {0};
+ esp_err_t ret = sx1262_cmd_read(s_hal, SX1262_OP_GET_RX_BUFFER_STATUS, rx_buf_status, 2);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "GetRxBufferStatus failed");
+ return ret;
+ }
+
+ uint8_t payload_len = rx_buf_status[0];
+ uint8_t buf_offset = rx_buf_status[1];
+
+ uint8_t pkt_status[3] = {0};
+ ret = sx1262_cmd_read(s_hal, SX1262_OP_GET_PACKET_STATUS, pkt_status, 3);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "GetPacketStatus failed");
+ return ret;
+ }
+
+ if (payload_len > 0) {
+ ret = sx1262_cmd_read_buffer(s_hal, buf_offset, out_pkt->buf, payload_len);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "ReadBuffer failed");
+ return ret;
+ }
+ }
+
+ out_pkt->len = payload_len;
+ out_pkt->rssi_pkt_dbm = -(int16_t)(pkt_status[0] / 2);
+ out_pkt->snr_pkt_db = (int8_t)pkt_status[1] / 4;
+ out_pkt->signal_rssi_dbm = -(int16_t)(pkt_status[2] / 2);
+ out_pkt->has_crc_error = (irq_flags & SX1262_IRQ_CRC_ERR) != 0;
+ out_pkt->has_header_error = (irq_flags & SX1262_IRQ_HEADER_ERR) != 0;
+
+ return ESP_OK;
+}
+
+static void apply_workaround_w3(void) {
+ uint8_t val = 0;
+ esp_err_t ret = sx1262_cmd_read_register(s_hal, SX1262_REG_RTC_CTRL, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W3: read 0x%04X failed", SX1262_REG_RTC_CTRL);
+ return;
+ }
+ val &= ~(1U << 0);
+ sx1262_cmd_write_register(s_hal, SX1262_REG_RTC_CTRL, &val, 1);
+
+ uint8_t clr = 0x00;
+ ret = sx1262_cmd_read_register(s_hal, SX1262_REG_EVT_CLR, &clr, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W3: read 0x%04X failed", SX1262_REG_EVT_CLR);
+ return;
+ }
+ clr |= (1U << 1);
+ sx1262_cmd_write_register(s_hal, SX1262_REG_EVT_CLR, &clr, 1);
+
+ ESP_LOGD(TAG, "W3 applied: RTC stopped + event cleared");
+}
diff --git a/firmware_p4/components/Drivers/sx1262/sx1262_radio.c b/firmware_p4/components/Drivers/sx1262/sx1262_radio.c
new file mode 100644
index 00000000..40bcb9e4
--- /dev/null
+++ b/firmware_p4/components/Drivers/sx1262/sx1262_radio.c
@@ -0,0 +1,560 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "sx1262_radio.h"
+
+#include
+
+#include "esp_log.h"
+
+#include "sx1262_regs.h"
+#include "sx1262_cmd.h"
+#include "sx1262_fsm.h"
+
+static const char *TAG = "SX1262_RADIO";
+
+static sx1262_hal_t *s_hal = NULL;
+static sx1262_config_t *s_config = NULL;
+static bool s_needs_reinit = false;
+
+static esp_err_t apply_workaround_w1(void);
+static esp_err_t update_packet_len(uint8_t len);
+
+void sx1262_radio_init(sx1262_hal_t *hal, sx1262_config_t *config) {
+ s_hal = hal;
+ s_config = config;
+ s_needs_reinit = false;
+}
+
+esp_err_t sx1262_radio_transmit(const uint8_t *data, uint8_t len, uint32_t timeout_ms) {
+ if (data == NULL) {
+ ESP_LOGE(TAG, "transmit: data is NULL");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (len == 0) {
+ ESP_LOGE(TAG, "transmit: len is 0");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (s_hal == NULL || s_config == NULL) {
+ ESP_LOGE(TAG, "transmit: not initialized");
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (s_needs_reinit) {
+ ESP_LOGE(TAG, "transmit: re-init required after cold sleep");
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ sx1262_state_t current = sx1262_fsm_get_state();
+ if (current != SX1262_STATE_STDBY_RC && current != SX1262_STATE_STDBY_XOSC) {
+ esp_err_t ret = sx1262_fsm_transition(SX1262_STATE_STDBY_RC);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "transmit: cannot transition to STDBY_RC from state %d", current);
+ return ret;
+ }
+ uint8_t stdby = SX1262_STDBY_RC;
+ sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ }
+
+ esp_err_t ret = apply_workaround_w1();
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = update_packet_len(len);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ ret = sx1262_cmd_write_buffer(s_hal, 0x00, data, len);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "WriteBuffer failed");
+ return ret;
+ }
+
+ uint8_t clr[2] = {(uint8_t)(SX1262_IRQ_ALL >> 8), (uint8_t)(SX1262_IRQ_ALL)};
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_CLEAR_IRQ_STATUS, clr, 2);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_TX);
+
+ ret = sx1262_fsm_transition(SX1262_STATE_TX);
+ if (ret != ESP_OK) {
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ return ret;
+ }
+
+ uint32_t tout = (timeout_ms == 0) ? 0x000000 : timeout_ms * 64;
+ uint8_t tx_params[3] = {
+ (uint8_t)(tout >> 16),
+ (uint8_t)(tout >> 8),
+ (uint8_t)(tout),
+ };
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_TX, tx_params, 3);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetTx failed");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ sx1262_fsm_on_irq_complete();
+ return ret;
+ }
+
+ ESP_LOGI(TAG, "TX started: %d bytes, timeout=%lu ms", len, (unsigned long)timeout_ms);
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_receive_single(uint32_t timeout_ms) {
+ if (s_hal == NULL || s_config == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (s_needs_reinit) {
+ ESP_LOGE(TAG, "receive_single: re-init required after cold sleep");
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ sx1262_state_t current = sx1262_fsm_get_state();
+ if (current != SX1262_STATE_STDBY_RC && current != SX1262_STATE_STDBY_XOSC) {
+ esp_err_t ret = sx1262_fsm_transition(SX1262_STATE_STDBY_RC);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+ uint8_t stdby = SX1262_STDBY_RC;
+ sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ }
+
+ uint8_t clr[2] = {(uint8_t)(SX1262_IRQ_ALL >> 8), (uint8_t)(SX1262_IRQ_ALL)};
+ esp_err_t ret = sx1262_cmd_write(s_hal, SX1262_OP_CLEAR_IRQ_STATUS, clr, 2);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_RX);
+
+ /* FSM → RX */
+ ret = sx1262_fsm_transition(SX1262_STATE_RX);
+ if (ret != ESP_OK) {
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ return ret;
+ }
+
+ uint32_t tout = (timeout_ms == 0) ? 0x000000 : timeout_ms * 64;
+ uint8_t rx_params[3] = {
+ (uint8_t)(tout >> 16),
+ (uint8_t)(tout >> 8),
+ (uint8_t)(tout),
+ };
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_RX, rx_params, 3);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetRx failed");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ sx1262_fsm_on_irq_complete();
+ return ret;
+ }
+
+ ESP_LOGI(TAG, "RX single started, timeout=%lu ms", (unsigned long)timeout_ms);
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_receive_continuous(void) {
+ if (s_hal == NULL || s_config == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (s_needs_reinit) {
+ ESP_LOGE(TAG, "receive_continuous: re-init required after cold sleep");
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ sx1262_state_t current = sx1262_fsm_get_state();
+ if (current != SX1262_STATE_STDBY_RC && current != SX1262_STATE_STDBY_XOSC) {
+ esp_err_t ret = sx1262_fsm_transition(SX1262_STATE_STDBY_RC);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+ uint8_t stdby = SX1262_STDBY_RC;
+ sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ }
+
+ uint8_t clr[2] = {(uint8_t)(SX1262_IRQ_ALL >> 8), (uint8_t)(SX1262_IRQ_ALL)};
+ esp_err_t ret = sx1262_cmd_write(s_hal, SX1262_OP_CLEAR_IRQ_STATUS, clr, 2);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_RX);
+
+ ret = sx1262_fsm_transition(SX1262_STATE_RX);
+ if (ret != ESP_OK) {
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ return ret;
+ }
+
+ uint8_t rx_params[3] = {0xFF, 0xFF, 0xFF};
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_RX, rx_params, 3);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetRx continuous failed");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ sx1262_fsm_on_irq_complete();
+ return ret;
+ }
+
+ ESP_LOGI(TAG, "RX continuous started");
+ return ESP_OK;
+}
+
+void sx1262_radio_stop_rx(void) {
+ if (s_hal == NULL) {
+ return;
+ }
+
+ uint8_t stdby = SX1262_STDBY_RC;
+ sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+
+ if (sx1262_fsm_transition(SX1262_STATE_STDBY_RC) != ESP_OK) {
+ sx1262_fsm_on_irq_complete();
+ }
+
+ ESP_LOGI(TAG, "RX stopped → STDBY_RC");
+}
+
+esp_err_t sx1262_radio_cad_start(void) {
+ if (s_hal == NULL || s_config == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ sx1262_state_t current = sx1262_fsm_get_state();
+ if (current == SX1262_STATE_TX || current == SX1262_STATE_UNKNOWN) {
+ ESP_LOGE(TAG, "cad_start: invalid state %d", current);
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (current != SX1262_STATE_STDBY_RC && current != SX1262_STATE_STDBY_XOSC) {
+ esp_err_t ret = sx1262_fsm_transition(SX1262_STATE_STDBY_RC);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+ uint8_t stdby = SX1262_STDBY_RC;
+ sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ }
+
+ uint8_t cad_sym_num;
+ uint8_t cad_det_peak;
+ uint8_t cad_det_min;
+
+ switch (s_config->sf) {
+ case SX1262_LORA_SF5:
+ cad_sym_num = 2;
+ cad_det_peak = 22;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF6:
+ cad_sym_num = 2;
+ cad_det_peak = 22;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF7:
+ cad_sym_num = 2;
+ cad_det_peak = 22;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF8:
+ cad_sym_num = 2;
+ cad_det_peak = 22;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF9:
+ cad_sym_num = 4;
+ cad_det_peak = 23;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF10:
+ cad_sym_num = 4;
+ cad_det_peak = 24;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF11:
+ cad_sym_num = 4;
+ cad_det_peak = 25;
+ cad_det_min = 10;
+ break;
+ case SX1262_LORA_SF12:
+ cad_sym_num = 4;
+ cad_det_peak = 28;
+ cad_det_min = 10;
+ break;
+ default:
+ cad_sym_num = 2;
+ cad_det_peak = 22;
+ cad_det_min = 10;
+ break;
+ }
+
+ uint8_t cad_params[7] = {
+ cad_sym_num,
+ cad_det_peak,
+ cad_det_min,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ };
+ esp_err_t ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_CAD_PARAMS, cad_params, 7);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetCadParams failed");
+ return ret;
+ }
+
+ uint8_t clr[2] = {(uint8_t)(SX1262_IRQ_ALL >> 8), (uint8_t)(SX1262_IRQ_ALL)};
+ sx1262_cmd_write(s_hal, SX1262_OP_CLEAR_IRQ_STATUS, clr, 2);
+
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_RX);
+
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_CAD, NULL, 0);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetCAD failed");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ return ret;
+ }
+
+ ESP_LOGI(
+ TAG, "CAD started: SF%d, symNum=%d, detPeak=%d", s_config->sf, cad_sym_num, cad_det_peak);
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_get_rssi_inst(int16_t *out_rssi_dbm) {
+ if (out_rssi_dbm == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (s_hal == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ uint8_t raw = 0;
+ esp_err_t ret = sx1262_cmd_read(s_hal, SX1262_OP_GET_RSSI_INST, &raw, 1);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ *out_rssi_dbm = -(int16_t)(raw / 2);
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_get_stats(sx1262_stats_t *out_stats) {
+ if (out_stats == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (s_hal == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ uint8_t buf[6] = {0};
+ esp_err_t ret = sx1262_cmd_read(s_hal, SX1262_OP_GET_STATS, buf, 6);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ out_stats->nb_pkt_received = ((uint16_t)buf[0] << 8) | buf[1];
+ out_stats->nb_crc_error = ((uint16_t)buf[2] << 8) | buf[3];
+ out_stats->nb_header_error = ((uint16_t)buf[4] << 8) | buf[5];
+
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_reset_stats(void) {
+ if (s_hal == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ uint8_t params[6] = {0};
+ return sx1262_cmd_write(s_hal, SX1262_OP_RESET_STATS, params, 6);
+}
+
+esp_err_t sx1262_radio_sleep(bool is_warm) {
+ if (s_hal == NULL || s_config == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ esp_err_t ret = sx1262_fsm_transition(SX1262_STATE_SLEEP);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "sleep: cannot transition to SLEEP from state %d", sx1262_fsm_get_state());
+ return ret;
+ }
+
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+
+ uint8_t sleep_cfg = is_warm ? SX1262_SLEEP_WARM_START : SX1262_SLEEP_COLD_START;
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_SLEEP, &sleep_cfg, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetSleep failed");
+ sx1262_fsm_on_irq_complete();
+ return ret;
+ }
+
+ if (!is_warm) {
+ s_needs_reinit = true;
+ }
+
+ ESP_LOGI(TAG, "Sleep entered (%s)", is_warm ? "warm" : "cold");
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_wakeup(void) {
+ if (s_hal == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ sx1262_state_t current = sx1262_fsm_get_state();
+ if (current != SX1262_STATE_SLEEP) {
+ ESP_LOGE(TAG, "wakeup: not in SLEEP state (state=%d)", current);
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ s_hal->lock(s_hal->ctx);
+ s_hal->cs_low(s_hal->ctx);
+ s_hal->delay_ms(s_hal->ctx, 1);
+ s_hal->cs_high(s_hal->ctx);
+ s_hal->unlock(s_hal->ctx);
+
+ esp_err_t ret = sx1262_cmd_wait_busy(s_hal, SX1262_WAIT_BUSY_TIMEOUT_MS);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "wakeup: BUSY timeout after NSS toggle");
+ return ret;
+ }
+
+ uint8_t stdby = SX1262_STDBY_RC;
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "wakeup: SetStandby failed");
+ return ret;
+ }
+
+ ret = sx1262_fsm_transition(SX1262_STATE_STDBY_RC);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "wakeup: FSM transition failed");
+ return ret;
+ }
+
+ ESP_LOGI(TAG, "Wakeup complete → STDBY_RC%s", s_needs_reinit ? " (cold — re-init required)" : "");
+ return ESP_OK;
+}
+
+esp_err_t sx1262_radio_set_rx_duty_cycle(uint32_t rx_ms, uint32_t sleep_ms) {
+ if (s_hal == NULL || s_config == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+ if (rx_ms == 0) {
+ ESP_LOGE(TAG, "set_rx_duty_cycle: rx_ms must be > 0");
+ return ESP_ERR_INVALID_ARG;
+ }
+ if (s_needs_reinit) {
+ ESP_LOGE(TAG, "set_rx_duty_cycle: re-init required after cold sleep");
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ sx1262_state_t current = sx1262_fsm_get_state();
+ if (current != SX1262_STATE_STDBY_RC && current != SX1262_STATE_STDBY_XOSC) {
+ esp_err_t ret = sx1262_fsm_transition(SX1262_STATE_STDBY_RC);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+ uint8_t stdby = SX1262_STDBY_RC;
+ sx1262_cmd_write(s_hal, SX1262_OP_SET_STANDBY, &stdby, 1);
+ }
+
+ uint32_t rx_period = rx_ms * 64;
+ uint32_t sleep_period = sleep_ms * 64;
+
+ uint8_t params[6] = {
+ (uint8_t)(rx_period >> 16),
+ (uint8_t)(rx_period >> 8),
+ (uint8_t)(rx_period),
+ (uint8_t)(sleep_period >> 16),
+ (uint8_t)(sleep_period >> 8),
+ (uint8_t)(sleep_period),
+ };
+
+ uint8_t clr[2] = {(uint8_t)(SX1262_IRQ_ALL >> 8), (uint8_t)(SX1262_IRQ_ALL)};
+ esp_err_t ret = sx1262_cmd_write(s_hal, SX1262_OP_CLEAR_IRQ_STATUS, clr, 2);
+ if (ret != ESP_OK) {
+ return ret;
+ }
+
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_RX);
+
+ ret = sx1262_fsm_transition(SX1262_STATE_RX);
+ if (ret != ESP_OK) {
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ return ret;
+ }
+
+ ret = sx1262_cmd_write(s_hal, SX1262_OP_SET_RX_DUTY_CYCLE, params, 6);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "SetRxDutyCycle failed");
+ s_hal->set_antenna(s_hal->ctx, SX1262_ANT_OFF);
+ sx1262_fsm_on_irq_complete();
+ return ret;
+ }
+
+ ESP_LOGI(TAG,
+ "RX duty cycle started: rx=%lu ms, sleep=%lu ms",
+ (unsigned long)rx_ms,
+ (unsigned long)sleep_ms);
+ return ESP_OK;
+}
+
+static esp_err_t apply_workaround_w1(void) {
+ uint8_t val = 0;
+ esp_err_t ret = sx1262_cmd_read_register(s_hal, SX1262_REG_TX_MODULATION, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W1: read 0x%04X failed", SX1262_REG_TX_MODULATION);
+ return ret;
+ }
+
+ if (s_config->bw == SX1262_LORA_BW_500) {
+ val &= ~(1U << 2);
+ } else {
+ val |= (1U << 2);
+ }
+
+ ret = sx1262_cmd_write_register(s_hal, SX1262_REG_TX_MODULATION, &val, 1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "W1: write 0x%04X failed", SX1262_REG_TX_MODULATION);
+ return ret;
+ }
+
+ ESP_LOGD(TAG,
+ "W1 applied: reg 0x%04X = 0x%02X (bw=0x%02X)",
+ SX1262_REG_TX_MODULATION,
+ val,
+ s_config->bw);
+ return ESP_OK;
+}
+
+static esp_err_t update_packet_len(uint8_t len) {
+ uint8_t header_type =
+ s_config->is_implicit_hdr ? SX1262_LORA_HEADER_IMPLICIT : SX1262_LORA_HEADER_EXPLICIT;
+ uint8_t crc_on = s_config->is_crc_on ? 0x01 : 0x00;
+ uint8_t invert_iq = s_config->is_inverted_iq ? 0x01 : 0x00;
+
+ uint8_t params[6] = {
+ (uint8_t)(s_config->preamble_len >> 8),
+ (uint8_t)(s_config->preamble_len & 0xFF),
+ header_type,
+ len,
+ crc_on,
+ invert_iq,
+ };
+
+ return sx1262_cmd_write(s_hal, SX1262_OP_SET_PACKET_PARAMS, params, 6);
+}
diff --git a/firmware_p4/components/Drivers/tusb_desc/include/tusb_desc.h b/firmware_p4/components/Drivers/tusb_desc/include/tusb_desc.h
index e0b37327..ddf11572 100644
--- a/firmware_p4/components/Drivers/tusb_desc/include/tusb_desc.h
+++ b/firmware_p4/components/Drivers/tusb_desc/include/tusb_desc.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TUSB_DESC_H
#define TUSB_DESC_H
diff --git a/firmware_p4/components/Drivers/tusb_desc/tusb_desc.c b/firmware_p4/components/Drivers/tusb_desc/tusb_desc.c
index 2cb22e31..d3cd4532 100644
--- a/firmware_p4/components/Drivers/tusb_desc/tusb_desc.c
+++ b/firmware_p4/components/Drivers/tusb_desc/tusb_desc.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tusb_desc.h"
diff --git a/firmware_p4/components/Drivers/ys_rfid2/hal/include/ys_rfid2_hal_uart.h b/firmware_p4/components/Drivers/ys_rfid2/hal/include/ys_rfid2_hal_uart.h
new file mode 100644
index 00000000..e13161c0
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/hal/include/ys_rfid2_hal_uart.h
@@ -0,0 +1,84 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef YS_RFID2_HAL_UART_H
+#define YS_RFID2_HAL_UART_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#include "esp_err.h"
+
+/**
+ * @brief HAL UART configuration.
+ */
+typedef struct {
+ int port;
+ int baud_rate;
+ int tx_pin;
+ int rx_pin;
+} ys_rfid2_hal_uart_config_t;
+
+/**
+ * @brief Initialize the UART peripheral.
+ *
+ * @param config Pointer to configuration. Caller retains ownership.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_ARG if config is NULL
+ * - ESP_ERR_INVALID_STATE if already initialized
+ */
+esp_err_t ys_rfid2_hal_uart_init(const ys_rfid2_hal_uart_config_t *config);
+
+/**
+ * @brief Deinitialize the UART peripheral and release resources.
+ */
+void ys_rfid2_hal_uart_deinit(void);
+
+/**
+ * @brief Read bytes from UART.
+ *
+ * @param[out] out_data Buffer to store received bytes.
+ * @param len Maximum number of bytes to read.
+ * @param timeout_ms Read timeout in milliseconds.
+ * @return Number of bytes actually read, or -1 on error.
+ */
+int ys_rfid2_hal_uart_read(uint8_t *out_data, size_t len, uint32_t timeout_ms);
+
+/**
+ * @brief Write bytes to UART.
+ *
+ * @param data Buffer containing bytes to send.
+ * @param len Number of bytes to send.
+ * @return
+ * - ESP_OK on success
+ * - ESP_FAIL on write error
+ */
+esp_err_t ys_rfid2_hal_uart_write(const uint8_t *data, size_t len);
+
+/**
+ * @brief Flush the UART input buffer.
+ */
+void ys_rfid2_hal_uart_flush(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // YS_RFID2_HAL_UART_H
diff --git a/firmware_p4/components/Drivers/ys_rfid2/hal/ys_rfid2_hal_uart.c b/firmware_p4/components/Drivers/ys_rfid2/hal/ys_rfid2_hal_uart.c
new file mode 100644
index 00000000..da0db933
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/hal/ys_rfid2_hal_uart.c
@@ -0,0 +1,114 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "ys_rfid2_hal_uart.h"
+
+#include "esp_log.h"
+#include "driver/uart.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+
+static const char *TAG = "RFID_HAL_UART";
+
+#define RFID_UART_BUF_SIZE 256
+
+static int s_port = -1;
+static bool s_is_init = false;
+
+esp_err_t ys_rfid2_hal_uart_init(const ys_rfid2_hal_uart_config_t *config) {
+ if (config == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (s_is_init) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ uart_config_t uart_config = {
+ .baud_rate = config->baud_rate,
+ .data_bits = UART_DATA_8_BITS,
+ .parity = UART_PARITY_DISABLE,
+ .stop_bits = UART_STOP_BITS_1,
+ .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
+ .source_clk = UART_SCLK_DEFAULT,
+ };
+
+ esp_err_t ret = uart_driver_install(config->port, RFID_UART_BUF_SIZE, 0, 0, NULL, 0);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to install UART driver: %s", esp_err_to_name(ret));
+ return ret;
+ }
+
+ ret = uart_param_config(config->port, &uart_config);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to configure UART: %s", esp_err_to_name(ret));
+ uart_driver_delete(config->port);
+ return ret;
+ }
+
+ ret = uart_set_pin(config->port, config->tx_pin, config->rx_pin, -1, -1);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to set UART pins: %s", esp_err_to_name(ret));
+ uart_driver_delete(config->port);
+ return ret;
+ }
+
+ s_port = config->port;
+ s_is_init = true;
+
+ ESP_LOGI(TAG, "Initialized — port: %d, baud: %d", config->port, config->baud_rate);
+ return ESP_OK;
+}
+
+void ys_rfid2_hal_uart_deinit(void) {
+ if (!s_is_init) {
+ return;
+ }
+
+ uart_driver_delete(s_port);
+ s_port = -1;
+ s_is_init = false;
+
+ ESP_LOGI(TAG, "Deinitialized");
+}
+
+int ys_rfid2_hal_uart_read(uint8_t *out_data, size_t len, uint32_t timeout_ms) {
+ if (!s_is_init || out_data == NULL) {
+ return -1;
+ }
+
+ return uart_read_bytes(s_port, out_data, len, pdMS_TO_TICKS(timeout_ms));
+}
+
+esp_err_t ys_rfid2_hal_uart_write(const uint8_t *data, size_t len) {
+ if (!s_is_init || data == NULL) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ int written = uart_write_bytes(s_port, data, len);
+ if (written < 0) {
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
+
+void ys_rfid2_hal_uart_flush(void) {
+ if (!s_is_init) {
+ return;
+ }
+
+ uart_flush_input(s_port);
+}
diff --git a/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2.h b/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2.h
new file mode 100644
index 00000000..38cb3872
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2.h
@@ -0,0 +1,102 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef YS_RFID2_H
+#define YS_RFID2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "esp_err.h"
+
+#include "ys_rfid2_types.h"
+
+/**
+ * @brief Return a default configuration.
+ *
+ * Defaults: UART_NUM_2, 9600 baud, pins from pin_def.h,
+ * 1000 ms debounce, 2000 ms removal timeout.
+ */
+ys_rfid2_config_t ys_rfid2_default_config(void);
+
+/**
+ * @brief Initialize the YS-RFID2 driver.
+ *
+ * Sets up the UART peripheral via HAL. Does NOT start scanning.
+ *
+ * @param config Pointer to configuration. If NULL, uses default config.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_STATE if already initialized
+ * - ESP_ERR_NO_MEM if mutex creation fails
+ */
+esp_err_t ys_rfid2_init(const ys_rfid2_config_t *config);
+
+/**
+ * @brief Deinitialize the driver and release all resources.
+ *
+ * Stops scanning if active.
+ *
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_STATE if not initialized
+ */
+esp_err_t ys_rfid2_deinit(void);
+
+/**
+ * @brief Start continuous card scanning.
+ *
+ * Creates a background FreeRTOS task that reads the UART and delivers
+ * events via the registered callback.
+ *
+ * @param cb Event callback function. Must not be NULL.
+ * @param ctx User context pointer passed to the callback.
+ * @return
+ * - ESP_OK on success
+ * - ESP_ERR_INVALID_ARG if cb is NULL
+ * - ESP_ERR_INVALID_STATE if not initialized or already scanning
+ * - ESP_ERR_NO_MEM if task creation fails
+ */
+esp_err_t ys_rfid2_start(ys_rfid2_event_cb_t cb, void *ctx);
+
+/**
+ * @brief Stop scanning and destroy the background task.
+ *
+ * Blocks until the task has exited.
+ */
+void ys_rfid2_stop(void);
+
+/**
+ * @brief Get the current driver state.
+ */
+ys_rfid2_state_t ys_rfid2_get_state(void);
+
+/**
+ * @brief Get the last detected card event.
+ *
+ * @param[out] out_event Pointer to receive the event data.
+ * @return
+ * - ESP_OK if a card was previously detected
+ * - ESP_ERR_NOT_FOUND if no card has been detected yet
+ * - ESP_ERR_INVALID_ARG if out_event is NULL
+ */
+esp_err_t ys_rfid2_get_last_card(ys_rfid2_event_t *out_event);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // YS_RFID2_H
diff --git a/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2_parser.h b/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2_parser.h
new file mode 100644
index 00000000..f80dc06c
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2_parser.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef YS_RFID2_PARSER_H
+#define YS_RFID2_PARSER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#include "ys_rfid2_types.h"
+
+/**
+ * @brief Reset the parser state, discarding any accumulated bytes.
+ */
+void ys_rfid2_parser_reset(void);
+
+/**
+ * @brief Feed a byte into the parser.
+ *
+ * Accumulates bytes until the '@' delimiter is found, then attempts to
+ * extract a valid card ID from the "card number: xxxxxxxxxx@" frame.
+ *
+ * @param byte Byte received from UART.
+ * @param[out] out_raw Filled with card data if a valid frame was parsed.
+ * @return true if a valid card ID was extracted, false otherwise.
+ */
+bool ys_rfid2_parser_feed(uint8_t byte, ys_rfid2_raw_data_t *out_raw);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // YS_RFID2_PARSER_H
diff --git a/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2_types.h b/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2_types.h
new file mode 100644
index 00000000..a306ff21
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/include/ys_rfid2_types.h
@@ -0,0 +1,87 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#ifndef YS_RFID2_TYPES_H
+#define YS_RFID2_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#define YS_RFID2_CARD_ID_LEN 10
+#define YS_RFID2_RAW_DATA_LEN 5
+
+typedef enum {
+ YS_RFID2_STATE_UNINITIALIZED = 0,
+ YS_RFID2_STATE_IDLE,
+ YS_RFID2_STATE_SCANNING,
+ YS_RFID2_STATE_ERROR,
+ YS_RFID2_STATE_COUNT
+} ys_rfid2_state_t;
+
+typedef enum {
+ YS_RFID2_EVENT_CARD_DETECTED = 0,
+ YS_RFID2_EVENT_CARD_REMOVED,
+ YS_RFID2_EVENT_COUNT
+} ys_rfid2_event_type_t;
+
+/**
+ * @brief Raw data from the RFID reader module.
+ */
+typedef struct {
+ char id_str[YS_RFID2_CARD_ID_LEN + 1];
+ uint8_t data[YS_RFID2_RAW_DATA_LEN];
+ uint8_t bit_count;
+} ys_rfid2_raw_data_t;
+
+/**
+ * @brief Event delivered to the user callback.
+ */
+typedef struct {
+ ys_rfid2_event_type_t type;
+ ys_rfid2_raw_data_t raw;
+ int64_t timestamp_ms;
+} ys_rfid2_event_t;
+
+/**
+ * @brief Callback invoked on card events.
+ *
+ * Called from the reader task context. Must not block for extended periods.
+ *
+ * @param event Pointer to event data. Valid only during callback scope.
+ * @param ctx User context pointer provided at registration.
+ */
+typedef void (*ys_rfid2_event_cb_t)(const ys_rfid2_event_t *event, void *ctx);
+
+/**
+ * @brief Driver configuration.
+ */
+typedef struct {
+ int uart_port;
+ int baud_rate;
+ int tx_pin;
+ int rx_pin;
+ uint32_t debounce_ms;
+ uint32_t removal_timeout_ms;
+} ys_rfid2_config_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // YS_RFID2_TYPES_H
diff --git a/firmware_p4/components/Drivers/ys_rfid2/ys_rfid2_core.c b/firmware_p4/components/Drivers/ys_rfid2/ys_rfid2_core.c
new file mode 100644
index 00000000..42845b41
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/ys_rfid2_core.c
@@ -0,0 +1,298 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "ys_rfid2.h"
+
+#include
+
+#include "esp_log.h"
+#include "esp_timer.h"
+#include "driver/uart.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "freertos/semphr.h"
+
+#include "pin_def.h"
+#include "ys_rfid2_hal_uart.h"
+#include "ys_rfid2_parser.h"
+
+static const char *TAG = "YS_RFID2";
+
+#define RFID_TASK_STACK_SIZE 4096
+#define RFID_TASK_PRIORITY 5
+#define RFID_READ_TIMEOUT_MS 100
+#define RFID_DEFAULT_BAUD 9600
+#define RFID_DEFAULT_DEBOUNCE_MS 1000
+#define RFID_DEFAULT_REMOVAL_MS 2000
+
+typedef struct {
+ ys_rfid2_config_t config;
+ ys_rfid2_state_t state;
+ ys_rfid2_event_cb_t cb;
+ void *ctx;
+ TaskHandle_t task;
+ volatile bool is_running;
+ ys_rfid2_event_t last_event;
+ bool has_last_card;
+ int64_t last_card_time_ms;
+ SemaphoreHandle_t mutex;
+} ys_rfid2_driver_t;
+
+static ys_rfid2_driver_t s_rfid = {0};
+
+static void reader_task(void *pvParameters);
+static void handle_card_detected(const ys_rfid2_raw_data_t *raw, int64_t now_ms);
+static void check_card_removal(int64_t now_ms);
+static int64_t get_time_ms(void);
+
+ys_rfid2_config_t ys_rfid2_default_config(void) {
+ ys_rfid2_config_t config = {
+ .uart_port = UART_NUM_2,
+ .baud_rate = RFID_DEFAULT_BAUD,
+ .tx_pin = GPIO_RFID_UART_TX_PIN,
+ .rx_pin = GPIO_RFID_UART_RX_PIN,
+ .debounce_ms = RFID_DEFAULT_DEBOUNCE_MS,
+ .removal_timeout_ms = RFID_DEFAULT_REMOVAL_MS,
+ };
+ return config;
+}
+
+esp_err_t ys_rfid2_init(const ys_rfid2_config_t *config) {
+ if (s_rfid.state != YS_RFID2_STATE_UNINITIALIZED) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ if (config != NULL) {
+ s_rfid.config = *config;
+ } else {
+ s_rfid.config = ys_rfid2_default_config();
+ }
+
+ s_rfid.mutex = xSemaphoreCreateMutex();
+ if (s_rfid.mutex == NULL) {
+ ESP_LOGE(TAG, "Failed to create mutex");
+ return ESP_ERR_NO_MEM;
+ }
+
+ ys_rfid2_hal_uart_config_t hal_config = {
+ .port = s_rfid.config.uart_port,
+ .baud_rate = s_rfid.config.baud_rate,
+ .tx_pin = s_rfid.config.tx_pin,
+ .rx_pin = s_rfid.config.rx_pin,
+ };
+
+ esp_err_t ret = ys_rfid2_hal_uart_init(&hal_config);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Failed to init HAL UART: %s", esp_err_to_name(ret));
+ vSemaphoreDelete(s_rfid.mutex);
+ s_rfid.mutex = NULL;
+ return ret;
+ }
+
+ s_rfid.state = YS_RFID2_STATE_IDLE;
+ s_rfid.has_last_card = false;
+
+ ESP_LOGI(
+ TAG, "Initialized — port: %d, baud: %d", s_rfid.config.uart_port, s_rfid.config.baud_rate);
+
+ return ESP_OK;
+}
+
+esp_err_t ys_rfid2_deinit(void) {
+ if (s_rfid.state == YS_RFID2_STATE_UNINITIALIZED) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ if (s_rfid.state == YS_RFID2_STATE_SCANNING) {
+ ys_rfid2_stop();
+ }
+
+ ys_rfid2_hal_uart_deinit();
+
+ if (s_rfid.mutex != NULL) {
+ vSemaphoreDelete(s_rfid.mutex);
+ s_rfid.mutex = NULL;
+ }
+
+ s_rfid.state = YS_RFID2_STATE_UNINITIALIZED;
+
+ ESP_LOGI(TAG, "Deinitialized");
+ return ESP_OK;
+}
+
+esp_err_t ys_rfid2_start(ys_rfid2_event_cb_t cb, void *ctx) {
+ if (cb == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (s_rfid.state != YS_RFID2_STATE_IDLE) {
+ return ESP_ERR_INVALID_STATE;
+ }
+
+ s_rfid.cb = cb;
+ s_rfid.ctx = ctx;
+ s_rfid.is_running = true;
+ s_rfid.has_last_card = false;
+
+ ys_rfid2_parser_reset();
+ ys_rfid2_hal_uart_flush();
+
+ BaseType_t ret = xTaskCreate(
+ reader_task, "ys_rfid2", RFID_TASK_STACK_SIZE, NULL, RFID_TASK_PRIORITY, &s_rfid.task);
+
+ if (ret != pdPASS) {
+ ESP_LOGE(TAG, "Failed to create reader task");
+ s_rfid.is_running = false;
+ return ESP_ERR_NO_MEM;
+ }
+
+ ESP_LOGI(TAG, "Scanning started");
+ return ESP_OK;
+}
+
+void ys_rfid2_stop(void) {
+ if (!s_rfid.is_running) {
+ return;
+ }
+
+ s_rfid.is_running = false;
+
+ while (s_rfid.task != NULL) {
+ vTaskDelay(pdMS_TO_TICKS(10));
+ }
+
+ s_rfid.cb = NULL;
+ s_rfid.ctx = NULL;
+
+ ESP_LOGI(TAG, "Scanning stopped");
+}
+
+ys_rfid2_state_t ys_rfid2_get_state(void) {
+ return s_rfid.state;
+}
+
+esp_err_t ys_rfid2_get_last_card(ys_rfid2_event_t *out_event) {
+ if (out_event == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
+ if (xSemaphoreTake(s_rfid.mutex, pdMS_TO_TICKS(100)) != pdTRUE) {
+ return ESP_ERR_TIMEOUT;
+ }
+
+ if (!s_rfid.has_last_card) {
+ xSemaphoreGive(s_rfid.mutex);
+ return ESP_ERR_NOT_FOUND;
+ }
+
+ *out_event = s_rfid.last_event;
+ xSemaphoreGive(s_rfid.mutex);
+
+ return ESP_OK;
+}
+
+static void reader_task(void *pvParameters) {
+ (void)pvParameters;
+
+ xSemaphoreTake(s_rfid.mutex, portMAX_DELAY);
+ s_rfid.state = YS_RFID2_STATE_SCANNING;
+ xSemaphoreGive(s_rfid.mutex);
+
+ uint8_t rx_byte;
+
+ while (s_rfid.is_running) {
+ int64_t now_ms = get_time_ms();
+ int len = ys_rfid2_hal_uart_read(&rx_byte, 1, RFID_READ_TIMEOUT_MS);
+
+ if (len > 0) {
+ ys_rfid2_raw_data_t raw = {0};
+ if (ys_rfid2_parser_feed(rx_byte, &raw)) {
+ handle_card_detected(&raw, now_ms);
+ }
+ } else {
+ check_card_removal(now_ms);
+ }
+ }
+
+ xSemaphoreTake(s_rfid.mutex, portMAX_DELAY);
+ s_rfid.state = YS_RFID2_STATE_IDLE;
+ s_rfid.task = NULL;
+ xSemaphoreGive(s_rfid.mutex);
+
+ vTaskDelete(NULL);
+}
+
+static void handle_card_detected(const ys_rfid2_raw_data_t *raw, int64_t now_ms) {
+ xSemaphoreTake(s_rfid.mutex, portMAX_DELAY);
+
+ bool is_same = s_rfid.has_last_card && (strcmp(s_rfid.last_event.raw.id_str, raw->id_str) == 0);
+
+ bool is_debounced =
+ is_same && (now_ms - s_rfid.last_card_time_ms < (int64_t)s_rfid.config.debounce_ms);
+
+ if (is_debounced) {
+ s_rfid.last_card_time_ms = now_ms;
+ xSemaphoreGive(s_rfid.mutex);
+ return;
+ }
+
+ s_rfid.last_event.type = YS_RFID2_EVENT_CARD_DETECTED;
+ s_rfid.last_event.raw = *raw;
+ s_rfid.last_event.timestamp_ms = now_ms;
+ s_rfid.last_card_time_ms = now_ms;
+ s_rfid.has_last_card = true;
+
+ ys_rfid2_event_cb_t cb = s_rfid.cb;
+ void *ctx = s_rfid.ctx;
+ xSemaphoreGive(s_rfid.mutex);
+
+ if (cb != NULL) {
+ cb(&s_rfid.last_event, ctx);
+ }
+}
+
+static void check_card_removal(int64_t now_ms) {
+ xSemaphoreTake(s_rfid.mutex, portMAX_DELAY);
+
+ if (!s_rfid.has_last_card) {
+ xSemaphoreGive(s_rfid.mutex);
+ return;
+ }
+
+ if (now_ms - s_rfid.last_card_time_ms <= (int64_t)s_rfid.config.removal_timeout_ms) {
+ xSemaphoreGive(s_rfid.mutex);
+ return;
+ }
+
+ ys_rfid2_event_t removal_event = {
+ .type = YS_RFID2_EVENT_CARD_REMOVED,
+ .raw = s_rfid.last_event.raw,
+ .timestamp_ms = now_ms,
+ };
+
+ s_rfid.has_last_card = false;
+
+ ys_rfid2_event_cb_t cb = s_rfid.cb;
+ void *ctx = s_rfid.ctx;
+ xSemaphoreGive(s_rfid.mutex);
+
+ if (cb != NULL) {
+ cb(&removal_event, ctx);
+ }
+}
+
+static int64_t get_time_ms(void) {
+ return esp_timer_get_time() / 1000;
+}
diff --git a/firmware_p4/components/Drivers/ys_rfid2/ys_rfid2_parser.c b/firmware_p4/components/Drivers/ys_rfid2/ys_rfid2_parser.c
new file mode 100644
index 00000000..ba19d56c
--- /dev/null
+++ b/firmware_p4/components/Drivers/ys_rfid2/ys_rfid2_parser.c
@@ -0,0 +1,112 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "ys_rfid2_parser.h"
+
+#include
+
+#include "esp_log.h"
+
+static const char *TAG = "RFID_PARSER";
+
+#define PARSER_LINE_LEN 64
+#define PARSER_PREFIX "card number: "
+#define PARSER_PREFIX_LEN 13
+#define PARSER_DELIMITER '@'
+
+static char s_line_buf[PARSER_LINE_LEN];
+static int s_line_pos = 0;
+
+static bool validate_and_extract(char *out_id);
+static void decimal_to_bytes(const char *id_str, uint8_t *out_data);
+
+void ys_rfid2_parser_reset(void) {
+ s_line_pos = 0;
+}
+
+bool ys_rfid2_parser_feed(uint8_t byte, ys_rfid2_raw_data_t *out_raw) {
+ if (out_raw == NULL) {
+ return false;
+ }
+
+ if (byte == PARSER_DELIMITER) {
+ char card_id[YS_RFID2_CARD_ID_LEN + 1];
+ bool is_valid = validate_and_extract(card_id);
+ s_line_pos = 0;
+
+ if (is_valid) {
+ memcpy(out_raw->id_str, card_id, YS_RFID2_CARD_ID_LEN + 1);
+ decimal_to_bytes(card_id, out_raw->data);
+ out_raw->bit_count = 40;
+ ESP_LOGD(TAG, "Card parsed: %s", card_id);
+ return true;
+ }
+
+ return false;
+ }
+
+ if (s_line_pos < PARSER_LINE_LEN - 1) {
+ s_line_buf[s_line_pos++] = (char)byte;
+ } else {
+ s_line_pos = 0;
+ }
+
+ return false;
+}
+
+static bool validate_and_extract(char *out_id) {
+ if (s_line_pos < PARSER_PREFIX_LEN + YS_RFID2_CARD_ID_LEN) {
+ return false;
+ }
+
+ const char *prefix_pos = NULL;
+ int search_limit = s_line_pos - (PARSER_PREFIX_LEN + YS_RFID2_CARD_ID_LEN);
+ for (int i = 0; i <= search_limit; i++) {
+ if (memcmp(&s_line_buf[i], PARSER_PREFIX, PARSER_PREFIX_LEN) == 0) {
+ prefix_pos = &s_line_buf[i];
+ break;
+ }
+ }
+
+ if (prefix_pos == NULL) {
+ return false;
+ }
+
+ const char *digits = prefix_pos + PARSER_PREFIX_LEN;
+ for (int i = 0; i < YS_RFID2_CARD_ID_LEN; i++) {
+ if (digits[i] < '0' || digits[i] > '9') {
+ return false;
+ }
+ }
+
+ memcpy(out_id, digits, YS_RFID2_CARD_ID_LEN);
+ out_id[YS_RFID2_CARD_ID_LEN] = '\0';
+ return true;
+}
+
+// Convert 10-digit decimal string to 5 raw bytes (40 bits big-endian).
+// Max value of 10 decimal digits = 9999999999 which fits in 40 bits.
+static void decimal_to_bytes(const char *id_str, uint8_t *out_data) {
+ uint64_t value = 0;
+ for (int i = 0; i < YS_RFID2_CARD_ID_LEN; i++) {
+ value = value * 10 + (uint64_t)(id_str[i] - '0');
+ }
+
+ out_data[0] = (uint8_t)(value >> 32);
+ out_data[1] = (uint8_t)(value >> 24);
+ out_data[2] = (uint8_t)(value >> 16);
+ out_data[3] = (uint8_t)(value >> 8);
+ out_data[4] = (uint8_t)(value);
+}
diff --git a/firmware_p4/components/Service/CMakeLists.txt b/firmware_p4/components/Service/CMakeLists.txt
index d20624bd..2ccfa3cf 100644
--- a/firmware_p4/components/Service/CMakeLists.txt
+++ b/firmware_p4/components/Service/CMakeLists.txt
@@ -1,16 +1,17 @@
# Copyright (c) 2025 HIGH CODE LLC
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
file(GLOB_RECURSE SD_CARD_SERVICE_SRCS "sd_card/*.c")
file(GLOB_RECURSE CONSOLE_SERVICE_SRCS "console/*.c")
diff --git a/firmware_p4/components/Service/bluetooth/bluetooth_service.c b/firmware_p4/components/Service/bluetooth/bluetooth_service.c
index 6b012066..b2a4e8ab 100644
--- a/firmware_p4/components/Service/bluetooth/bluetooth_service.c
+++ b/firmware_p4/components/Service/bluetooth/bluetooth_service.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "bluetooth_service.h"
@@ -20,6 +21,7 @@
#include "esp_log.h"
#include "spi_bridge.h"
+#include "spi_session.h"
static const char *TAG = "BT_SERVICE_P4";
@@ -30,9 +32,9 @@ static const char *TAG = "BT_SERVICE_P4";
#define BLE_MAC_LEN 6
static bluetooth_service_sniffer_cb_t s_sniffer_cb = NULL;
+static uint32_t s_sniffer_session = SPI_SESSION_INVALID_ID;
static bluetooth_service_scan_result_t s_cached_scan_record;
-static void sniffer_stream_cb(spi_id_t id, const uint8_t *payload, uint8_t len);
static bool get_info(spi_bt_info_t *out_info);
// Public function implementations
@@ -102,23 +104,37 @@ esp_err_t bluetooth_service_connect(const uint8_t *addr,
SPI_ID_BT_CONNECT, payload, sizeof(payload), NULL, NULL, SPI_CONNECT_TIMEOUT_MS);
}
+static void sniffer_session_stream(const uint8_t *payload, uint8_t len) {
+ if (s_sniffer_cb == NULL || payload == NULL || len < sizeof(spi_ble_sniffer_frame_t))
+ return;
+ const spi_ble_sniffer_frame_t *frame = (const spi_ble_sniffer_frame_t *)payload;
+ s_sniffer_cb(frame->addr, frame->addr_type, frame->rssi, frame->data, frame->len);
+}
+
+static void sniffer_session_lost(uint32_t session_id, spi_id_t op_id) {
+ (void)op_id;
+ if (session_id == s_sniffer_session) {
+ s_sniffer_session = SPI_SESSION_INVALID_ID;
+ s_sniffer_cb = NULL;
+ }
+}
+
esp_err_t bluetooth_service_start_sniffer(bluetooth_service_sniffer_cb_t cb) {
s_sniffer_cb = cb;
- if (cb != NULL) {
- spi_bridge_register_stream_cb(SPI_ID_BT_APP_SNIFFER, sniffer_stream_cb);
- }
- esp_err_t err =
- spi_bridge_send_command(SPI_ID_BT_APP_SNIFFER, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
- if (err != ESP_OK) {
- spi_bridge_unregister_stream_cb(SPI_ID_BT_APP_SNIFFER);
+ s_sniffer_session = spi_session_start(
+ SPI_ID_BT_APP_SNIFFER, NULL, 0, sniffer_session_stream, sniffer_session_lost);
+ if (s_sniffer_session == SPI_SESSION_INVALID_ID) {
s_sniffer_cb = NULL;
+ return ESP_FAIL;
}
- return err;
+ return ESP_OK;
}
void bluetooth_service_stop_sniffer(void) {
- spi_bridge_send_command(SPI_ID_BT_APP_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
- spi_bridge_unregister_stream_cb(SPI_ID_BT_APP_SNIFFER);
+ if (s_sniffer_session != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_sniffer_session);
+ s_sniffer_session = SPI_SESSION_INVALID_ID;
+ }
s_sniffer_cb = NULL;
}
@@ -305,15 +321,6 @@ bluetooth_service_scan_result_t *bluetooth_service_get_scan_result(uint16_t inde
// Static function implementations
-static void sniffer_stream_cb(spi_id_t id, const uint8_t *payload, uint8_t len) {
- (void)id;
- if (s_sniffer_cb == NULL || payload == NULL || len < sizeof(spi_ble_sniffer_frame_t)) {
- return;
- }
- const spi_ble_sniffer_frame_t *frame = (const spi_ble_sniffer_frame_t *)payload;
- s_sniffer_cb(frame->addr, frame->addr_type, frame->rssi, frame->data, frame->len);
-}
-
static bool get_info(spi_bt_info_t *out_info) {
if (out_info == NULL) {
return false;
diff --git a/firmware_p4/components/Service/bluetooth/include/bluetooth_service.h b/firmware_p4/components/Service/bluetooth/include/bluetooth_service.h
index 33df087a..fe285ed4 100644
--- a/firmware_p4/components/Service/bluetooth/include/bluetooth_service.h
+++ b/firmware_p4/components/Service/bluetooth/include/bluetooth_service.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BLUETOOTH_SERVICE_H
#define BLUETOOTH_SERVICE_H
diff --git a/firmware_p4/components/Service/bridge_manager/bridge_manager.c b/firmware_p4/components/Service/bridge_manager/bridge_manager.c
index 10cf67cd..3139578a 100644
--- a/firmware_p4/components/Service/bridge_manager/bridge_manager.c
+++ b/firmware_p4/components/Service/bridge_manager/bridge_manager.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "bridge_manager.h"
@@ -60,15 +61,28 @@ esp_err_t bridge_manager_init(void) {
ESP_LOGW(TAG, "C5 update required");
c5_flasher_init();
if (c5_flasher_update(NULL, 0) == ESP_OK) {
- ESP_LOGI(TAG, "C5 synchronized");
+ ESP_LOGI(TAG, "C5 firmware uploaded");
} else {
ESP_LOGE(TAG, "C5 synchronization failed");
+ spi_bridge_set_alive(false);
return ESP_FAIL;
}
} else {
ESP_LOGI(TAG, "C5 is up to date");
}
+ // Final probe: confirm the SPI bridge is actually responding before
+ // letting background tasks poll it
+ memset(resp_ver, 0, sizeof(resp_ver));
+ ret = spi_bridge_send_command(
+ SPI_ID_SYSTEM_VERSION, NULL, 0, &resp_header, resp_ver, VERSION_TIMEOUT_MS);
+ if (ret != ESP_OK) {
+ ESP_LOGW(TAG, "C5 SPI bridge not responding — disabling bridge polling");
+ spi_bridge_set_alive(false);
+ return ESP_OK;
+ }
+
+ ESP_LOGI(TAG, "C5 bridge alive");
return ESP_OK;
}
diff --git a/firmware_p4/components/Service/bridge_manager/include/bridge_manager.h b/firmware_p4/components/Service/bridge_manager/include/bridge_manager.h
index e0a82525..cf9efeae 100644
--- a/firmware_p4/components/Service/bridge_manager/include/bridge_manager.h
+++ b/firmware_p4/components/Service/bridge_manager/include/bridge_manager.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef BRIDGE_MANAGER_H
#define BRIDGE_MANAGER_H
diff --git a/firmware_p4/components/Service/c5_flasher/c5_flasher.c b/firmware_p4/components/Service/c5_flasher/c5_flasher.c
index 080466d4..2cbd96a8 100644
--- a/firmware_p4/components/Service/c5_flasher/c5_flasher.c
+++ b/firmware_p4/components/Service/c5_flasher/c5_flasher.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "c5_flasher.h"
@@ -27,26 +28,34 @@
static const char *TAG = "C5_FLASHER";
#define FLASHER_UART UART_NUM_1
-#define FLASHER_UART_BUF 2048
+#define FLASHER_UART_BUF 4096
#define FLASH_BLOCK_SIZE 1024
#define FLASH_BLOCK_HDR_SIZE 16
#define FLASH_CHECKSUM_INIT 0xEF
-#define BOOTLOADER_DELAY_MS 100
-#define BOOT_RELEASE_DELAY_MS 200
-#define FLASH_BEGIN_DELAY_MS 100
-#define FLASH_BLOCK_DELAY_MS 20
+#define BOOTLOADER_DELAY_MS 50
+#define BOOT_RELEASE_DELAY_MS 50
+#define FLASH_BEGIN_DELAY_MS 50
// ESP serial protocol (SLIP framing)
-#define ESP_ROM_BAUD 115200
-#define SLIP_END 0xC0
-#define SLIP_ESC 0xDB
-#define SLIP_ESC_END 0xDC
-#define SLIP_ESC_ESC 0xDD
+#define ESP_ROM_BAUD 115200
+#define ESP_FLASH_BAUD 921600
+#define SLIP_END 0xC0
+#define SLIP_ESC 0xDB
+#define SLIP_ESC_END 0xDC
+#define SLIP_ESC_ESC 0xDD
// ESP serial protocol commands
-#define ESP_CMD_FLASH_BEGIN 0x02
-#define ESP_CMD_FLASH_DATA 0x03
-#define ESP_CMD_FLASH_END 0x04
+#define ESP_CMD_SYNC 0x08
+#define ESP_CMD_FLASH_BEGIN 0x02
+#define ESP_CMD_FLASH_DATA 0x03
+#define ESP_CMD_FLASH_END 0x04
+#define ESP_CMD_CHANGE_BAUDRATE 0x0F
+
+#define SYNC_ATTEMPTS 3
+#define SYNC_TIMEOUT_MS 100
+#define BAUD_TIMEOUT_MS 300
+#define ACK_TIMEOUT_MS 500
+#define FLASH_BLOCK_DELAY_MS 5
#if C5_FIRMWARE_EMBEDDED
extern const uint8_t c5_firmware_bin_start[] asm("_binary_TentacleOS_C5_bin_start");
@@ -60,8 +69,14 @@ typedef struct {
uint32_t checksum;
} __attribute__((packed)) c5_flasher_cmd_header_t;
+static bool s_ack_supported = false;
+
static void slip_send_byte(uint8_t b);
static void send_packet(uint8_t cmd, uint8_t *payload, uint16_t len, uint32_t checksum);
+static esp_err_t read_response(uint32_t timeout_ms);
+static esp_err_t sync_bootloader(void);
+static esp_err_t change_baudrate(uint32_t new_baud);
+static void wait_for_ack_or_delay(uint32_t fallback_delay_ms);
esp_err_t c5_flasher_init(void) {
gpio_config_t io_conf = {
@@ -124,10 +139,15 @@ esp_err_t c5_flasher_update(const uint8_t *bin_data, uint32_t bin_size) {
c5_flasher_enter_bootloader();
+ s_ack_supported = (sync_bootloader() == ESP_OK);
+ if (s_ack_supported) {
+ change_baudrate(ESP_FLASH_BAUD);
+ }
+
uint32_t num_blocks = (bin_size + FLASH_BLOCK_SIZE - 1) / FLASH_BLOCK_SIZE;
uint32_t begin_params[4] = {bin_size, num_blocks, FLASH_BLOCK_SIZE, 0x0000};
send_packet(ESP_CMD_FLASH_BEGIN, (uint8_t *)begin_params, sizeof(begin_params), 0);
- vTaskDelay(pdMS_TO_TICKS(FLASH_BEGIN_DELAY_MS));
+ wait_for_ack_or_delay(FLASH_BEGIN_DELAY_MS);
for (uint32_t i = 0; i < num_blocks; i++) {
uint32_t offset = i * FLASH_BLOCK_SIZE;
@@ -148,18 +168,75 @@ esp_err_t c5_flasher_update(const uint8_t *bin_data, uint32_t bin_size) {
}
send_packet(ESP_CMD_FLASH_DATA, block_buffer, this_len + FLASH_BLOCK_HDR_SIZE, checksum);
- ESP_LOGI(TAG, "Writing block %lu/%lu", i + 1, num_blocks);
- vTaskDelay(pdMS_TO_TICKS(FLASH_BLOCK_DELAY_MS));
+ if ((i % 100) == 0 || i == num_blocks - 1) {
+ ESP_LOGI(TAG, "Writing block %lu/%lu", i + 1, num_blocks);
+ }
+ wait_for_ack_or_delay(FLASH_BLOCK_DELAY_MS);
}
uint32_t end_params[1] = {0};
send_packet(ESP_CMD_FLASH_END, (uint8_t *)end_params, sizeof(end_params), 0);
+ wait_for_ack_or_delay(FLASH_BEGIN_DELAY_MS);
ESP_LOGI(TAG, "Update successful");
c5_flasher_reset_normal();
return ESP_OK;
}
+static esp_err_t read_response(uint32_t timeout_ms) {
+ uint8_t byte;
+ bool in_packet = false;
+ TickType_t deadline = xTaskGetTickCount() + pdMS_TO_TICKS(timeout_ms);
+
+ while (xTaskGetTickCount() < deadline) {
+ if (uart_read_bytes(FLASHER_UART, &byte, 1, pdMS_TO_TICKS(10)) <= 0)
+ continue;
+ if (byte != SLIP_END)
+ continue;
+ if (!in_packet) {
+ in_packet = true;
+ } else {
+ return ESP_OK;
+ }
+ }
+ return ESP_ERR_TIMEOUT;
+}
+
+static esp_err_t sync_bootloader(void) {
+ uint8_t sync_data[36] = {0x07, 0x07, 0x12, 0x20};
+ memset(sync_data + 4, 0x55, 32);
+ for (int i = 0; i < SYNC_ATTEMPTS; i++) {
+ send_packet(ESP_CMD_SYNC, sync_data, sizeof(sync_data), 0);
+ if (read_response(SYNC_TIMEOUT_MS) == ESP_OK) {
+ ESP_LOGI(TAG, "Bootloader synced — using ACK flow control");
+ return ESP_OK;
+ }
+ }
+ ESP_LOGW(TAG, "No ACK from bootloader — falling back to fixed delays");
+ return ESP_ERR_TIMEOUT;
+}
+
+static esp_err_t change_baudrate(uint32_t new_baud) {
+ uint32_t params[2] = {new_baud, 0};
+ send_packet(ESP_CMD_CHANGE_BAUDRATE, (uint8_t *)params, sizeof(params), 0);
+ if (read_response(BAUD_TIMEOUT_MS) != ESP_OK) {
+ ESP_LOGW(TAG, "Baud rate change unconfirmed, staying at %d", ESP_ROM_BAUD);
+ return ESP_ERR_TIMEOUT;
+ }
+ uart_set_baudrate(FLASHER_UART, new_baud);
+ vTaskDelay(pdMS_TO_TICKS(50));
+ ESP_LOGI(TAG, "Baud rate changed to %lu", (unsigned long)new_baud);
+ return ESP_OK;
+}
+
+static void wait_for_ack_or_delay(uint32_t fallback_delay_ms) {
+ if (s_ack_supported) {
+ read_response(ACK_TIMEOUT_MS);
+ } else {
+ vTaskDelay(pdMS_TO_TICKS(fallback_delay_ms));
+ }
+}
+
static void slip_send_byte(uint8_t b) {
if (b == SLIP_END) {
uint8_t esc[] = {SLIP_ESC, SLIP_ESC_END};
diff --git a/firmware_p4/components/Service/c5_flasher/include/c5_flasher.h b/firmware_p4/components/Service/c5_flasher/include/c5_flasher.h
index 7a8f04ff..ee388ce5 100644
--- a/firmware_p4/components/Service/c5_flasher/include/c5_flasher.h
+++ b/firmware_p4/components/Service/c5_flasher/include/c5_flasher.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef C5_FLASHER_H
#define C5_FLASHER_H
diff --git a/firmware_p4/components/Service/console/commands/cmd_fs.c b/firmware_p4/components/Service/console/commands/cmd_fs.c
index 5793bbac..0457c7c8 100644
--- a/firmware_p4/components/Service/console/commands/cmd_fs.c
+++ b/firmware_p4/components/Service/console/commands/cmd_fs.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "console_service.h"
diff --git a/firmware_p4/components/Service/console/commands/cmd_system.c b/firmware_p4/components/Service/console/commands/cmd_system.c
index 31127160..cb647a21 100644
--- a/firmware_p4/components/Service/console/commands/cmd_system.c
+++ b/firmware_p4/components/Service/console/commands/cmd_system.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "console_service.h"
diff --git a/firmware_p4/components/Service/console/commands/cmd_wifi.c b/firmware_p4/components/Service/console/commands/cmd_wifi.c
index e5e01560..b17b0e9d 100644
--- a/firmware_p4/components/Service/console/commands/cmd_wifi.c
+++ b/firmware_p4/components/Service/console/commands/cmd_wifi.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "console_service.h"
diff --git a/firmware_p4/components/Service/console/console_service.c b/firmware_p4/components/Service/console/console_service.c
index bb8949c8..8967a990 100644
--- a/firmware_p4/components/Service/console/console_service.c
+++ b/firmware_p4/components/Service/console/console_service.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "console_service.h"
diff --git a/firmware_p4/components/Service/console/include/console_service.h b/firmware_p4/components/Service/console/include/console_service.h
index 699e52c2..a425808a 100644
--- a/firmware_p4/components/Service/console/include/console_service.h
+++ b/firmware_p4/components/Service/console/include/console_service.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef CONSOLE_SERVICE_H
#define CONSOLE_SERVICE_H
diff --git a/firmware_p4/components/Service/font/font.c b/firmware_p4/components/Service/font/font.c
index 0e63271d..3e02da48 100644
--- a/firmware_p4/components/Service/font/font.c
+++ b/firmware_p4/components/Service/font/font.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "font.h"
diff --git a/firmware_p4/components/Service/font/include/font.h b/firmware_p4/components/Service/font/include/font.h
index 4fe6b227..f19e9964 100644
--- a/firmware_p4/components/Service/font/include/font.h
+++ b/firmware_p4/components/Service/font/include/font.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef FONT_H
#define FONT_H
diff --git a/firmware_p4/components/Service/icons/icons.c b/firmware_p4/components/Service/icons/icons.c
index 0ac48a54..adba79db 100644
--- a/firmware_p4/components/Service/icons/icons.c
+++ b/firmware_p4/components/Service/icons/icons.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "icons.h"
#include
diff --git a/firmware_p4/components/Service/icons/include/icons.h b/firmware_p4/components/Service/icons/include/icons.h
index c69650e1..2610e449 100644
--- a/firmware_p4/components/Service/icons/include/icons.h
+++ b/firmware_p4/components/Service/icons/include/icons.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef ICONS_H
#define ICONS_H
diff --git a/firmware_p4/components/Service/ir/include/ir.h b/firmware_p4/components/Service/ir/include/ir.h
index aba8650b..4d90931c 100644
--- a/firmware_p4/components/Service/ir/include/ir.h
+++ b/firmware_p4/components/Service/ir/include/ir.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_H
#define IR_H
diff --git a/firmware_p4/components/Service/ir/include/ir_file.h b/firmware_p4/components/Service/ir/include/ir_file.h
index e8d357aa..7c670b6d 100644
--- a/firmware_p4/components/Service/ir/include/ir_file.h
+++ b/firmware_p4/components/Service/ir/include/ir_file.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_FILE_H
#define IR_FILE_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol.h b/firmware_p4/components/Service/ir/include/ir_protocol.h
index 63d8bb0d..a4708430 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_H
#define IR_PROTOCOL_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_denon.h b/firmware_p4/components/Service/ir/include/ir_protocol_denon.h
index 6eccc3f6..93d94ff3 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_denon.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_denon.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_DENON_H
#define IR_PROTOCOL_DENON_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_jvc.h b/firmware_p4/components/Service/ir/include/ir_protocol_jvc.h
index f1559a79..27b15fe4 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_jvc.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_jvc.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_JVC_H
#define IR_PROTOCOL_JVC_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_lg.h b/firmware_p4/components/Service/ir/include/ir_protocol_lg.h
index af784ee2..7699b96f 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_lg.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_lg.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_LG_H
#define IR_PROTOCOL_LG_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_nec.h b/firmware_p4/components/Service/ir/include/ir_protocol_nec.h
index a79d3785..890ab2cd 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_nec.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_nec.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_NEC_H
#define IR_PROTOCOL_NEC_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_panasonic.h b/firmware_p4/components/Service/ir/include/ir_protocol_panasonic.h
index 0212475a..8b95d10f 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_panasonic.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_panasonic.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_PANASONIC_H
#define IR_PROTOCOL_PANASONIC_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_rc5.h b/firmware_p4/components/Service/ir/include/ir_protocol_rc5.h
index 4d057f78..c040898d 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_rc5.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_rc5.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_RC5_H
#define IR_PROTOCOL_RC5_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_rc6.h b/firmware_p4/components/Service/ir/include/ir_protocol_rc6.h
index e5cdfde0..642e505e 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_rc6.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_rc6.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_RC6_H
#define IR_PROTOCOL_RC6_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_samsung.h b/firmware_p4/components/Service/ir/include/ir_protocol_samsung.h
index c7e68fd3..f8952e53 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_samsung.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_samsung.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_SAMSUNG_H
#define IR_PROTOCOL_SAMSUNG_H
diff --git a/firmware_p4/components/Service/ir/include/ir_protocol_sony.h b/firmware_p4/components/Service/ir/include/ir_protocol_sony.h
index 257bc37b..82c7f2e4 100644
--- a/firmware_p4/components/Service/ir/include/ir_protocol_sony.h
+++ b/firmware_p4/components/Service/ir/include/ir_protocol_sony.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef IR_PROTOCOL_SONY_H
#define IR_PROTOCOL_SONY_H
diff --git a/firmware_p4/components/Service/ir/ir.c b/firmware_p4/components/Service/ir/ir.c
index 90730e0a..94ed7a14 100644
--- a/firmware_p4/components/Service/ir/ir.c
+++ b/firmware_p4/components/Service/ir/ir.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir.h"
diff --git a/firmware_p4/components/Service/ir/ir_file.c b/firmware_p4/components/Service/ir/ir_file.c
index 60d3e7d5..edc7c9b4 100644
--- a/firmware_p4/components/Service/ir/ir_file.c
+++ b/firmware_p4/components/Service/ir/ir_file.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_file.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol.c b/firmware_p4/components/Service/ir/ir_protocol.c
index 2f2e9bc9..460fa10c 100644
--- a/firmware_p4/components/Service/ir/ir_protocol.c
+++ b/firmware_p4/components/Service/ir/ir_protocol.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_denon.c b/firmware_p4/components/Service/ir/ir_protocol_denon.c
index 8765eeab..d7511144 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_denon.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_denon.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_denon.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_jvc.c b/firmware_p4/components/Service/ir/ir_protocol_jvc.c
index 8983b0b3..4c99300b 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_jvc.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_jvc.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_jvc.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_lg.c b/firmware_p4/components/Service/ir/ir_protocol_lg.c
index 4d676f7b..71e9e644 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_lg.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_lg.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_lg.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_nec.c b/firmware_p4/components/Service/ir/ir_protocol_nec.c
index 18376daf..ccadfdc1 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_nec.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_nec.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_nec.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_panasonic.c b/firmware_p4/components/Service/ir/ir_protocol_panasonic.c
index b95dddc0..6338f312 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_panasonic.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_panasonic.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_panasonic.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_rc5.c b/firmware_p4/components/Service/ir/ir_protocol_rc5.c
index 269a6042..63cfa688 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_rc5.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_rc5.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_rc5.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_rc6.c b/firmware_p4/components/Service/ir/ir_protocol_rc6.c
index 65b6d9df..73f50afc 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_rc6.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_rc6.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_rc6.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_samsung.c b/firmware_p4/components/Service/ir/ir_protocol_samsung.c
index 0f464486..e2c8a147 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_samsung.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_samsung.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_samsung.h"
diff --git a/firmware_p4/components/Service/ir/ir_protocol_sony.c b/firmware_p4/components/Service/ir/ir_protocol_sony.c
index d23e5015..f1f14337 100644
--- a/firmware_p4/components/Service/ir/ir_protocol_sony.c
+++ b/firmware_p4/components/Service/ir/ir_protocol_sony.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ir_protocol_sony.h"
diff --git a/firmware_p4/components/Service/lvgl_port/include/lv_port_disp.h b/firmware_p4/components/Service/lvgl_port/include/lv_port_disp.h
index f5539e5b..2a1424a5 100644
--- a/firmware_p4/components/Service/lvgl_port/include/lv_port_disp.h
+++ b/firmware_p4/components/Service/lvgl_port/include/lv_port_disp.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef LV_PORT_DISP_H
#define LV_PORT_DISP_H
diff --git a/firmware_p4/components/Service/lvgl_port/include/lv_port_indev.h b/firmware_p4/components/Service/lvgl_port/include/lv_port_indev.h
index 6052bddd..fa27b39a 100644
--- a/firmware_p4/components/Service/lvgl_port/include/lv_port_indev.h
+++ b/firmware_p4/components/Service/lvgl_port/include/lv_port_indev.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef LV_PORT_INDEV_H
#define LV_PORT_INDEV_H
diff --git a/firmware_p4/components/Service/lvgl_port/lv_port_disp.c b/firmware_p4/components/Service/lvgl_port/lv_port_disp.c
index eb6aac83..b7ef4689 100644
--- a/firmware_p4/components/Service/lvgl_port/lv_port_disp.c
+++ b/firmware_p4/components/Service/lvgl_port/lv_port_disp.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "lv_port_disp.h"
@@ -24,7 +25,7 @@
static const char *TAG = "LV_PORT_DISP";
-#define LVGL_BUF_LINES (LCD_V_RES / 5)
+#define LVGL_BUF_LINES (LCD_V_RES / 2)
#define LVGL_BUF_PIXELS (LCD_H_RES * LVGL_BUF_LINES)
#define LVGL_BUF_ALLOC (MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL)
diff --git a/firmware_p4/components/Service/lvgl_port/lv_port_indev.c b/firmware_p4/components/Service/lvgl_port/lv_port_indev.c
index faf66936..12d95d1d 100644
--- a/firmware_p4/components/Service/lvgl_port/lv_port_indev.c
+++ b/firmware_p4/components/Service/lvgl_port/lv_port_indev.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "lv_port_indev.h"
diff --git a/firmware_p4/components/Service/ota/include/ota_service.h b/firmware_p4/components/Service/ota/include/ota_service.h
index 7a03814f..003d32d0 100644
--- a/firmware_p4/components/Service/ota/include/ota_service.h
+++ b/firmware_p4/components/Service/ota/include/ota_service.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef OTA_SERVICE_H
#define OTA_SERVICE_H
diff --git a/firmware_p4/components/Service/ota/include/ota_version.h b/firmware_p4/components/Service/ota/include/ota_version.h
index b8f2e8f5..7d0ad3d1 100644
--- a/firmware_p4/components/Service/ota/include/ota_version.h
+++ b/firmware_p4/components/Service/ota/include/ota_version.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef OTA_VERSION_H
#define OTA_VERSION_H
diff --git a/firmware_p4/components/Service/ota/ota_service.c b/firmware_p4/components/Service/ota/ota_service.c
index 352e3a3a..afb99e92 100644
--- a/firmware_p4/components/Service/ota/ota_service.c
+++ b/firmware_p4/components/Service/ota/ota_service.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "ota_service.h"
diff --git a/firmware_p4/components/Service/sd_card/include/sd_card_dir.h b/firmware_p4/components/Service/sd_card/include/sd_card_dir.h
index 1107db72..299fb6ce 100644
--- a/firmware_p4/components/Service/sd_card/include/sd_card_dir.h
+++ b/firmware_p4/components/Service/sd_card/include/sd_card_dir.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file sd_card_dir.h
diff --git a/firmware_p4/components/Service/sd_card/include/sd_card_init.h b/firmware_p4/components/Service/sd_card/include/sd_card_init.h
index 3fa7b0b5..a05abdd1 100644
--- a/firmware_p4/components/Service/sd_card/include/sd_card_init.h
+++ b/firmware_p4/components/Service/sd_card/include/sd_card_init.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file sd_card_init.h
diff --git a/firmware_p4/components/Service/sd_card/sd_card_dir.c b/firmware_p4/components/Service/sd_card/sd_card_dir.c
index bea7032a..6db01801 100644
--- a/firmware_p4/components/Service/sd_card/sd_card_dir.c
+++ b/firmware_p4/components/Service/sd_card/sd_card_dir.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sd_card_dir.h"
#include "sd_card_init.h"
diff --git a/firmware_p4/components/Service/sd_card/sd_card_file.c b/firmware_p4/components/Service/sd_card/sd_card_file.c
index 26cc1aaa..869e227c 100644
--- a/firmware_p4/components/Service/sd_card/sd_card_file.c
+++ b/firmware_p4/components/Service/sd_card/sd_card_file.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sd_card_file.h"
#include "sd_card_init.h"
diff --git a/firmware_p4/components/Service/sd_card/sd_card_info.c b/firmware_p4/components/Service/sd_card/sd_card_info.c
index 3bff4d83..bc58c1ba 100644
--- a/firmware_p4/components/Service/sd_card/sd_card_info.c
+++ b/firmware_p4/components/Service/sd_card/sd_card_info.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sd_card_info.h"
#include "sd_card_init.h"
diff --git a/firmware_p4/components/Service/sd_card/sd_card_init.c b/firmware_p4/components/Service/sd_card/sd_card_init.c
index 1bf2205f..406aa5bb 100644
--- a/firmware_p4/components/Service/sd_card/sd_card_init.c
+++ b/firmware_p4/components/Service/sd_card/sd_card_init.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sd_card_init.h"
#include "pin_def.h"
diff --git a/firmware_p4/components/Service/sd_card/sd_card_read.c b/firmware_p4/components/Service/sd_card/sd_card_read.c
index 784654db..7e2b7523 100644
--- a/firmware_p4/components/Service/sd_card/sd_card_read.c
+++ b/firmware_p4/components/Service/sd_card/sd_card_read.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sd_card_read.h"
#include "sd_card_init.h"
diff --git a/firmware_p4/components/Service/sd_card/sd_card_write.c b/firmware_p4/components/Service/sd_card/sd_card_write.c
index 150917cb..ab1d4f3b 100644
--- a/firmware_p4/components/Service/sd_card/sd_card_write.c
+++ b/firmware_p4/components/Service/sd_card/sd_card_write.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "sd_card_write.h"
#include "sd_card_init.h"
diff --git a/firmware_p4/components/Service/spi_bridge/README.md b/firmware_p4/components/Service/spi_bridge/README.md
index 31a9c0ac..cb327f61 100644
--- a/firmware_p4/components/Service/spi_bridge/README.md
+++ b/firmware_p4/components/Service/spi_bridge/README.md
@@ -36,6 +36,185 @@ To add a new feature (e.g., "GPS Get Location"):
- Use `spi_bridge_send_command(SPI_ID_GPS_GET, ...)` to trigger the action.
- Use the generic `SPI_ID_SYSTEM_DATA` to pull results if necessary.
+## Session Lifecycle (Long-Running Operations)
+
+For operations that run for an extended period (sniffers, monitors, attacks
+that emit a stream of events), the basic request-response model is unsafe:
+if the master dies or stops listening, the slave keeps running indefinitely
+and sends data into the void. The session protocol fixes this with three
+mechanisms working together:
+
+### 1. Session ID
+Every long-running operation is tagged with a 32-bit `session_id` chosen
+randomly by the C5 when the operation starts. Both sides track the active
+session; stream packets carry the id so stale data can be discarded after
+a restart.
+
+### 2. Heartbeat (anti-zombie)
+The P4 sends `SPI_ID_SESSION_HEARTBEAT { session_id, last_acked_seq }`
+every **2 seconds** while a session is active. The C5 has a watchdog task
+that runs every second and kills any session whose last heartbeat is older
+than **5 seconds**. When killed, the C5 emits `SPI_ID_SESSION_LOST` as a
+stream so the master can react (e.g., restart, show error UI).
+
+If the master detects 3 consecutive heartbeat failures, it assumes the
+session is gone and fires its local `on_lost` callback.
+
+### 3. Backpressure window
+Stream packets carry `{ session_id, seq }`. The master accumulates
+`last_acked_seq` and reports it via heartbeat. The C5 refuses to emit if
+`seq - last_acked_seq >= SPI_SESSION_WINDOW (64)` — protects against
+buffer overflow when the slave produces faster than the master drains.
+Drops are counted and logged.
+
+### Wire shapes
+
+| Direction | When | Packet |
+|-----------|------|--------|
+| P4 → C5 | START | `op_id` + op-specific params |
+| C5 → P4 | START reply | status byte + `spi_session_resp_t { session_id }` |
+| P4 → C5 | every 2s | `SPI_ID_SESSION_HEARTBEAT` + `spi_heartbeat_req_t` |
+| C5 → P4 | heartbeat reply | status + `spi_heartbeat_resp_t { alive }` |
+| C5 → P4 | data | `op_id` STREAM + `spi_stream_meta_t { session_id, seq }` + payload |
+| P4 → C5 | STOP | `SPI_ID_SESSION_STOP` + `spi_session_stop_req_t { session_id }` |
+| C5 → P4 | watchdog kill | `SPI_ID_SESSION_LOST` STREAM + `spi_session_lost_t { session_id, op_id }` |
+
+### Master API
+
+```c
+// Start a long-running operation. Spawns heartbeat task internally.
+uint32_t spi_session_start(spi_id_t op_id,
+ const uint8_t *params, uint8_t params_len,
+ spi_session_stream_cb_t on_stream, // peeled meta
+ spi_session_lost_cb_t on_lost);
+
+// Clean teardown. Kills heartbeat, sends STOP.
+esp_err_t spi_session_stop(uint32_t session_id);
+```
+
+Returns `SPI_SESSION_INVALID_ID` (0) on START failure. The `on_stream`
+callback receives the **operation payload only** — the meta header is
+stripped and ack tracking is invisible to the consumer.
+
+### Slave API (C5)
+
+```c
+// Open a session for the op_id. Closes any prior session first.
+uint32_t session_manager_start(spi_id_t op_id, session_kill_cb_t kill_cb);
+
+// Emit a stream packet (prefixes meta, applies backpressure).
+esp_err_t session_manager_try_emit(uint32_t session_id,
+ const uint8_t *data, uint8_t len);
+```
+
+The op implementation stores the returned `session_id` and uses it for
+every emit. The `kill_cb` is invoked by the watchdog if heartbeats stop —
+the op should call its own `_stop()` from there.
+
+### Migrating a New Operation (recipe)
+
+There are two patterns depending on whether the op emits streams. Both
+are used in the codebase — see `wifi_sniffer` (streaming) and
+`wifi_deauther` (non-streaming) as references.
+
+#### Pattern A — Non-streaming op (deauther, flood, evil_twin, …)
+
+The op runs in background but does NOT emit packets to the master. The
+master polls for results via `SPI_ID_SYSTEM_DATA` if it needs data.
+
+**C5 side (only the dispatcher changes — op .c/.h untouched):**
+```c
+// In wifi_dispatcher.c (or bt_dispatcher.c):
+static void killed_my_op(spi_id_t id) { (void)id; my_op_stop(); }
+
+case SPI_ID_MY_OP:
+ if (!my_op_start(...)) return SPI_STATUS_ERROR;
+ return open_session(SPI_ID_MY_OP, killed_my_op,
+ out_resp_payload, out_resp_len, my_op_stop);
+```
+
+**P4 side (wrapper):**
+```c
+static uint32_t s_session_id = SPI_SESSION_INVALID_ID;
+
+bool my_op_start(...) {
+ s_session_id = spi_session_start(SPI_ID_MY_OP, params, len, NULL, NULL);
+ return s_session_id != SPI_SESSION_INVALID_ID;
+}
+
+void my_op_stop(void) {
+ if (s_session_id != SPI_SESSION_INVALID_ID) {
+ spi_session_stop(s_session_id);
+ s_session_id = SPI_SESSION_INVALID_ID;
+ }
+}
+```
+
+#### Pattern B — Streaming op (sniffer, ble_sniffer, …)
+
+The op emits a continuous stream of packets to the master.
+
+**C5 side:**
+1. Add `static uint32_t s_session_id = SPI_SESSION_INVALID_ID;` to the
+ op's `.c`.
+2. Add public `_bind_session(uint32_t)` setter and
+ `_session_killed(spi_id_t)` kill callback (the latter calls `_stop()`).
+3. Replace `spi_bridge_stream_push(SPI_ID_OP, data, len)` with
+ `session_manager_try_emit(s_session_id, data, len)`.
+4. In the dispatcher, replace the START handler with: call
+ `op_start(...)`, then `session_manager_start(SPI_ID_OP, op_session_killed)`,
+ then `op_bind_session(sid)`, then return
+ `spi_session_resp_t { sid }` as response payload.
+
+**P4 side:**
+1. Replace `spi_bridge_send_command(SPI_ID_OP, …)` +
+ `spi_bridge_register_stream_cb(SPI_ID_OP, raw_cb)` with a single
+ `spi_session_start(SPI_ID_OP, params, …, on_stream, on_lost)`.
+2. Store the returned `session_id`.
+3. Change STOP to `spi_session_stop(session_id)`.
+4. The `on_stream` callback signature is
+ `void(const uint8_t *payload, uint8_t len)` — the meta header is
+ already stripped.
+
+### Tunables
+Defined in `session_manager.c` (slave) and `spi_session.c` (master):
+- `SESSION_TIMEOUT_MS` = 5000 — slave watchdog timeout
+- `WATCHDOG_PERIOD_MS` = 1000 — slave watchdog tick
+- `HEARTBEAT_INTERVAL_MS` = 2000 — master ping period
+- `HEARTBEAT_FAIL_LIMIT` = 3 — master fails before declaring lost
+- `SPI_SESSION_WINDOW` = 64 — backpressure window (in `spi_protocol.h`)
+
+### Migrated operations
+
+All long-running ops now use the session lifecycle. Each one:
+- Returns `spi_session_resp_t { session_id }` on START.
+- Has a kill_cb registered with the session manager that calls its `_stop()`.
+- Is closed by the master via `SPI_ID_SESSION_STOP { session_id }` (sent
+ internally by `spi_session_stop`).
+- Is auto-killed by the C5 watchdog if the master stops sending heartbeats
+ for 5s (master crash, screen freeze, etc.).
+
+| Op | C5 module | P4 wrapper | Streams? |
+|----|-----------|-----------|----------|
+| `WIFI_APP_SNIFFER` | wifi_sniffer.c | wifi_sniffer.c | ✓ stream |
+| `BT_APP_SNIFFER` | ble_sniffer.c | bluetooth_service.c | ✓ stream |
+| `WIFI_APP_DEAUTHER` | wifi_deauther.c | wifi_deauther.c | – |
+| `WIFI_APP_FLOOD` | wifi_flood.c | wifi_flood.c | – |
+| `WIFI_APP_EVIL_TWIN` | evil_twin.c | evil_twin.c | – |
+| `WIFI_APP_BEACON_SPAM` | beacon_spam.c | beacon_spam.c | – |
+| `WIFI_APP_DEAUTH_DET` | deauther_detector.c | deauther_detector.c | – |
+| `WIFI_APP_PROBE_MON` | probe_monitor.c | probe_monitor.c | – |
+| `WIFI_APP_SIGNAL_MON` | signal_monitor.c | signal_monitor.c | – |
+| `BT_APP_FLOOD` | ble_connect_flood.c | ble_connect_flood.c | – |
+| `BT_APP_SKIMMER` | skimmer_detector.c | skimmer_detector.c | – |
+| `BT_APP_TRACKER` | tracker_detector.c | tracker_detector.c | – |
+| `BT_APP_SPAM` | (handler pending) | canned_spam.c | – |
+| `BT_APP_FLOOD` (L2CAP variant) | ble_connect_flood.c | ble_l2cap_flood.c | – |
+
+The legacy `SPI_ID_WIFI_APP_ATTACK_STOP` and `SPI_ID_BT_APP_STOP` shotgun
+commands have been removed entirely. Every op now stops via its own
+session via `SPI_ID_SESSION_STOP { session_id }`.
+
## Hardware Hookup
| Signal | P4 Pin | C5 Pin |
|--------|--------|--------|
diff --git a/firmware_p4/components/Service/spi_bridge/include/spi_bridge.h b/firmware_p4/components/Service/spi_bridge/include/spi_bridge.h
index 840b7207..62c483fd 100644
--- a/firmware_p4/components/Service/spi_bridge/include/spi_bridge.h
+++ b/firmware_p4/components/Service/spi_bridge/include/spi_bridge.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SPI_BRIDGE_H
#define SPI_BRIDGE_H
@@ -19,6 +20,7 @@
extern "C" {
#endif
+#include
#include
#include "esp_err.h"
@@ -43,6 +45,28 @@ typedef void (*spi_stream_cb_t)(spi_id_t id, const uint8_t *payload, uint8_t len
*/
esp_err_t spi_bridge_master_init(void);
+/**
+ * @brief Return the timeout (ms) for a given SPI command ID.
+ *
+ * Returns SPI_TIMEOUT_DEFAULT_MS unless the command is in the override
+ * table (e.g. WiFi commands which need more time).
+ *
+ * @param id SPI command identifier.
+ * @return Timeout in milliseconds.
+ */
+uint32_t spi_bridge_get_timeout(spi_id_t id);
+
+/**
+ * @brief Mark the bridge as alive or dead.
+ *
+ * When dead, spi_bridge_send_command returns ESP_ERR_INVALID_STATE
+ * immediately without attempting transmission. Used to silence the
+ * polling spam when the C5 SPI bridge is not connected/responding.
+ *
+ * @param alive true if the C5 is responding, false otherwise.
+ */
+void spi_bridge_set_alive(bool alive);
+
/**
* @brief Send a command to the SPI slave and receive the response.
*
diff --git a/firmware_p4/components/Service/spi_bridge/include/spi_protocol.h b/firmware_p4/components/Service/spi_bridge/include/spi_protocol.h
index 62731dcd..9895fa92 100644
--- a/firmware_p4/components/Service/spi_bridge/include/spi_protocol.h
+++ b/firmware_p4/components/Service/spi_bridge/include/spi_protocol.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef SPI_PROTOCOL_H
#define SPI_PROTOCOL_H
@@ -80,7 +81,6 @@ typedef enum {
SPI_ID_WIFI_APP_DEAUTH_DET = 0x27,
SPI_ID_WIFI_APP_PROBE_MON = 0x28,
SPI_ID_WIFI_APP_SIGNAL_MON = 0x29,
- SPI_ID_WIFI_APP_ATTACK_STOP = 0x2A,
SPI_ID_WIFI_SNIFFER_SET_SNAPLEN = 0x2B,
SPI_ID_WIFI_SNIFFER_SET_VERBOSE = 0x2C,
SPI_ID_WIFI_SNIFFER_SAVE_FLASH = 0x2D,
@@ -147,7 +147,6 @@ typedef enum {
SPI_ID_BT_APP_SKIMMER = 0x64,
SPI_ID_BT_APP_TRACKER = 0x65,
SPI_ID_BT_APP_GATT_EXP = 0x66,
- SPI_ID_BT_APP_STOP = 0x67,
SPI_ID_BT_SPAM_LIST_LOAD = 0x68,
SPI_ID_BT_SPAM_LIST_BEGIN = 0x69,
SPI_ID_BT_SPAM_LIST_ITEM = 0x6A,
@@ -164,7 +163,29 @@ typedef enum {
// LoRa (0x80 - 0x8F)
SPI_ID_LORA_RX = 0x80,
- SPI_ID_LORA_TX = 0x81
+ SPI_ID_LORA_TX = 0x81,
+
+ // Meshtastic phone bridge (0x90 - 0x97)
+ SPI_ID_MESH_BLE_INIT = 0x90,
+ SPI_ID_MESH_BLE_STOP = 0x91,
+ SPI_ID_MESH_WIFI_INIT = 0x92,
+ SPI_ID_MESH_WIFI_STOP = 0x93,
+ SPI_ID_MESH_FROMRADIO_PUSH = 0x94,
+ SPI_ID_MESH_LOG_PUSH = 0x95,
+ SPI_ID_MESH_STATUS = 0x96,
+ SPI_ID_MESH_TORADIO_STREAM = 0x97,
+
+ // MeshCore phone bridge (0x98 - 0x9C)
+ SPI_ID_MCORE_BLE_INIT = 0x98,
+ SPI_ID_MCORE_BLE_STOP = 0x99,
+ SPI_ID_MCORE_TX_PUSH = 0x9A,
+ SPI_ID_MCORE_RX_STREAM = 0x9B,
+ SPI_ID_MCORE_STATUS = 0x9C,
+
+ // Session lifecycle (long-running operations)
+ SPI_ID_SESSION_HEARTBEAT = 0xF0,
+ SPI_ID_SESSION_LOST = 0xF1,
+ SPI_ID_SESSION_STOP = 0xF2
} spi_id_t;
/**
@@ -188,6 +209,44 @@ typedef struct {
uint8_t length; // Payload length
} spi_header_t;
+// Session protocol — see spi_bridge/README.md "Session Lifecycle"
+#define SPI_SESSION_INVALID_ID 0u
+#define SPI_SESSION_WINDOW 64u
+
+/** Sent by C5 as response payload to a long-running START command.
+ * Valid only if the SPI response status byte is SPI_STATUS_OK. */
+typedef struct __attribute__((packed)) {
+ uint32_t session_id;
+} spi_session_resp_t;
+
+/** Sent by P4 every ~2s to keep a session alive and ack streams received. */
+typedef struct __attribute__((packed)) {
+ uint32_t session_id;
+ uint32_t last_acked_seq; // highest stream seq P4 has processed
+} spi_heartbeat_req_t;
+
+/** C5 reply to heartbeat. */
+typedef struct __attribute__((packed)) {
+ uint8_t alive; // 1 if session still active, 0 if not found / different op
+} spi_heartbeat_resp_t;
+
+/** Prefixed to every stream payload from a session-managed operation. */
+typedef struct __attribute__((packed)) {
+ uint32_t session_id;
+ uint32_t seq;
+} spi_stream_meta_t;
+
+/** Sent by P4 in payload of long-running STOP commands. */
+typedef struct __attribute__((packed)) {
+ uint32_t session_id;
+} spi_session_stop_req_t;
+
+/** Stream emitted by C5 when a session is auto-killed by the watchdog. */
+typedef struct __attribute__((packed)) {
+ uint32_t session_id;
+ uint8_t op_id; // spi_id_t of the lost operation
+} spi_session_lost_t;
+
#define SPI_FRAME_SIZE (sizeof(spi_header_t) + SPI_MAX_PAYLOAD)
/**
@@ -330,6 +389,68 @@ typedef struct {
char banner[64];
} __attribute__((packed)) spi_port_scan_result_t;
+/**
+ * @brief Meshtastic transport init payload.
+ *
+ * Sent with SPI_ID_MESH_BLE_INIT and SPI_ID_MESH_WIFI_INIT.
+ */
+typedef struct {
+ uint32_t node_num;
+} __attribute__((packed)) spi_mesh_init_t;
+
+/**
+ * @brief Chunk header for fragmented Meshtastic transport frames.
+ *
+ * Each StreamAPI protobuf frame is split into 1..255 chunks of up to
+ * SPI_MESH_CHUNK_PAYLOAD_MAX bytes. Receivers reassemble per seq.
+ */
+typedef struct {
+ uint8_t seq;
+ uint8_t chunk_idx;
+ uint8_t total_chunks;
+ uint8_t flags;
+} __attribute__((packed)) spi_mesh_chunk_hdr_t;
+
+#define SPI_MESH_CHUNK_FLAG_LAST 0x01
+#define SPI_MESH_PAYLOAD_LIMIT 255
+#define SPI_MESH_CHUNK_PAYLOAD_MAX (SPI_MESH_PAYLOAD_LIMIT - sizeof(spi_mesh_chunk_hdr_t))
+
+/**
+ * @brief Meshtastic transport status payload.
+ *
+ * Returned by SPI_ID_MESH_STATUS.
+ */
+typedef struct {
+ uint8_t ble_connected;
+ uint8_t ble_subscribed;
+ uint8_t tcp_clients;
+ uint8_t logradio_subscribed;
+ uint32_t fromnum_counter;
+} __attribute__((packed)) spi_mesh_status_t;
+
+/**
+ * @brief MeshCore BLE init payload.
+ *
+ * Sent with SPI_ID_MCORE_BLE_INIT. The C5 builds the advertised name as
+ * "-XXXX" (last 4 hex of MAC) and uses `pin` as the static
+ * passkey for SC + MITM + DISP_ONLY pairing.
+ */
+typedef struct {
+ char name_prefix[16];
+ uint32_t pin;
+} __attribute__((packed)) spi_mcore_init_t;
+
+/**
+ * @brief MeshCore transport status payload.
+ *
+ * Returned by SPI_ID_MCORE_STATUS.
+ */
+typedef struct {
+ uint8_t ble_connected;
+ uint8_t ble_subscribed;
+ uint8_t reserved[2];
+} __attribute__((packed)) spi_mcore_status_t;
+
#ifdef __cplusplus
}
#endif
diff --git a/firmware_p4/components/Service/spi_bridge/include/spi_session.h b/firmware_p4/components/Service/spi_bridge/include/spi_session.h
new file mode 100644
index 00000000..afffede8
--- /dev/null
+++ b/firmware_p4/components/Service/spi_bridge/include/spi_session.h
@@ -0,0 +1,104 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+/**
+ * @file spi_session.h
+ * @brief Master-side session lifecycle for long-running C5 operations.
+ *
+ * Wraps the SPI bridge with session-based reliability:
+ * - START handshake returns a session_id from the slave.
+ * - Per-session heartbeat task pings the slave every 2s; if the slave
+ * stops acknowledging, the local on_lost callback fires.
+ * - Stream packets carry session_id + seq; the wrapper drops stale
+ * packets and counts received seq for backpressure ack.
+ *
+ * Migration from raw bridge calls:
+ * spi_bridge_send_command(SPI_ID_WIFI_APP_X, params, ...)
+ * + spi_bridge_register_stream_cb(SPI_ID_WIFI_APP_X, cb)
+ * becomes:
+ * spi_session_start(SPI_ID_WIFI_APP_X, params, ..., cb, on_lost)
+ *
+ * See spi_bridge/README.md "Session Lifecycle" for the full design.
+ */
+
+#ifndef SPI_SESSION_H
+#define SPI_SESSION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#include "esp_err.h"
+
+#include "spi_protocol.h"
+
+/** Stream payload callback (meta header is stripped before invocation). */
+typedef void (*spi_session_stream_cb_t)(const uint8_t *data, uint8_t len);
+
+/** Invoked when the C5 stops acknowledging this session (heartbeat fail or LOST stream). */
+typedef void (*spi_session_lost_cb_t)(uint32_t session_id, spi_id_t op_id);
+
+/**
+ * @brief Initialize the session client. Must be called once at boot.
+ *
+ * Registers the SPI_ID_SESSION_LOST stream listener.
+ */
+void spi_session_init(void);
+
+/**
+ * @brief Start a long-running operation with full session lifecycle.
+ *
+ * Sends @p op_id with @p params as command payload, expects an
+ * spi_session_resp_t reply, then spawns a heartbeat task and registers
+ * a stream listener at @p op_id that strips meta and forwards to
+ * @p on_stream.
+ *
+ * @param op_id SPI command identifier of the operation.
+ * @param params Optional command params (may be NULL).
+ * @param params_len Length of @p params (0 if NULL).
+ * @param on_stream Callback for stream payloads (called from bridge task).
+ * @param on_lost Callback if session dies (heartbeat timeout / LOST stream).
+ * @return Session id on success, SPI_SESSION_INVALID_ID on failure.
+ */
+uint32_t spi_session_start(spi_id_t op_id,
+ const uint8_t *params,
+ uint8_t params_len,
+ spi_session_stream_cb_t on_stream,
+ spi_session_lost_cb_t on_lost);
+
+/**
+ * @brief Cleanly stop an active session.
+ *
+ * Sends a STOP command (with @p op_id) carrying the session_id, kills
+ * the heartbeat task and unregisters the stream listener.
+ *
+ * @param session_id Session to stop.
+ * @return ESP_OK on success, ESP_ERR_NOT_FOUND if session doesn't match.
+ */
+esp_err_t spi_session_stop(uint32_t session_id);
+
+/**
+ * @brief Check whether a given session is currently active locally.
+ */
+bool spi_session_is_active(uint32_t session_id);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SPI_SESSION_H
diff --git a/firmware_p4/components/Service/spi_bridge/include/spi_timeouts.h b/firmware_p4/components/Service/spi_bridge/include/spi_timeouts.h
new file mode 100644
index 00000000..93920e12
--- /dev/null
+++ b/firmware_p4/components/Service/spi_bridge/include/spi_timeouts.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+/**
+ * @file spi_timeouts.h
+ * @brief Per-command timeouts for the P4–C5 SPI bridge.
+ *
+ * Used by spi_bridge_get_timeout() to pick the right timeout based
+ * on the command ID. Add a new constant + a case in the lookup when
+ * a command needs a different timeout than the default.
+ */
+
+#ifndef SPI_TIMEOUTS_H
+#define SPI_TIMEOUTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SPI_TIMEOUT_DEFAULT_MS 1000
+#define SPI_TIMEOUT_WIFI_MS 20000
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SPI_TIMEOUTS_H
diff --git a/firmware_p4/components/Service/spi_bridge/spi_bridge.c b/firmware_p4/components/Service/spi_bridge/spi_bridge.c
index 92ab10e3..70d6e5cf 100644
--- a/firmware_p4/components/Service/spi_bridge/spi_bridge.c
+++ b/firmware_p4/components/Service/spi_bridge/spi_bridge.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "spi_bridge.h"
@@ -22,26 +23,34 @@
#include "freertos/task.h"
#include "spi_bridge_phy.h"
+#include "spi_timeouts.h"
static const char *TAG = "SPI_BRIDGE_P4";
-#define SPI_STREAM_TASK_STACK 4096
+#define SPI_STREAM_TASK_STACK 16384
#define SPI_STREAM_TASK_PRIO 5
#define SPI_MUTEX_TIMEOUT_MS 50
#define SPI_STREAM_POLL_MS 10
#define SPI_STREAM_IDLE_MS 20
#define SPI_STREAM_YIELD_MS 1
#define SPI_IRQ_WAIT_MS 100
+#define SPI_STREAM_CB_SLOTS 4
+
+typedef struct {
+ spi_id_t id;
+ spi_stream_cb_t cb;
+} stream_cb_slot_t;
static SemaphoreHandle_t s_spi_mutex = NULL;
static TaskHandle_t s_stream_task_handle = NULL;
static volatile bool s_is_command_in_flight = false;
-static spi_stream_cb_t s_stream_cb_wifi = NULL;
-static spi_stream_cb_t s_stream_cb_bt = NULL;
+static volatile bool s_bridge_alive = true;
+static stream_cb_slot_t s_stream_cbs[SPI_STREAM_CB_SLOTS] = {0};
static void stream_task(void *arg);
static esp_err_t fetch_stream(spi_header_t *out_header, uint8_t *out_payload, uint8_t *out_len);
static spi_stream_cb_t get_stream_cb(spi_id_t id);
+static bool has_any_stream_cb(void);
static esp_err_t status_to_err(spi_status_t status) {
switch (status) {
@@ -69,12 +78,29 @@ esp_err_t spi_bridge_master_init(void) {
}
void spi_bridge_register_stream_cb(spi_id_t id, spi_stream_cb_t cb) {
- if (id == SPI_ID_WIFI_APP_SNIFFER)
- s_stream_cb_wifi = cb;
- if (id == SPI_ID_BT_APP_SNIFFER)
- s_stream_cb_bt = cb;
+ if (cb == NULL) {
+ spi_bridge_unregister_stream_cb(id);
+ return;
+ }
+
+ int free_slot = -1;
+ for (int i = 0; i < SPI_STREAM_CB_SLOTS; i++) {
+ if (s_stream_cbs[i].cb != NULL && s_stream_cbs[i].id == id) {
+ s_stream_cbs[i].cb = cb;
+ return;
+ }
+ if (s_stream_cbs[i].cb == NULL && free_slot < 0) {
+ free_slot = i;
+ }
+ }
+ if (free_slot < 0) {
+ ESP_LOGE(TAG, "No free stream cb slot for id 0x%02X", id);
+ return;
+ }
+ s_stream_cbs[free_slot].id = id;
+ s_stream_cbs[free_slot].cb = cb;
- if ((s_stream_cb_wifi != NULL || s_stream_cb_bt != NULL) && s_stream_task_handle == NULL) {
+ if (s_stream_task_handle == NULL) {
if (s_spi_mutex == NULL) {
s_spi_mutex = xSemaphoreCreateMutex();
}
@@ -92,10 +118,24 @@ void spi_bridge_register_stream_cb(spi_id_t id, spi_stream_cb_t cb) {
}
void spi_bridge_unregister_stream_cb(spi_id_t id) {
- if (id == SPI_ID_WIFI_APP_SNIFFER)
- s_stream_cb_wifi = NULL;
- if (id == SPI_ID_BT_APP_SNIFFER)
- s_stream_cb_bt = NULL;
+ for (int i = 0; i < SPI_STREAM_CB_SLOTS; i++) {
+ if (s_stream_cbs[i].cb != NULL && s_stream_cbs[i].id == id) {
+ s_stream_cbs[i].cb = NULL;
+ s_stream_cbs[i].id = 0;
+ return;
+ }
+ }
+}
+
+void spi_bridge_set_alive(bool alive) {
+ s_bridge_alive = alive;
+}
+
+uint32_t spi_bridge_get_timeout(spi_id_t id) {
+ if (id >= SPI_ID_WIFI_SCAN && id <= SPI_ID_WIFI_APP_PROBE_MON) {
+ return SPI_TIMEOUT_WIFI_MS;
+ }
+ return SPI_TIMEOUT_DEFAULT_MS;
}
esp_err_t spi_bridge_send_command(spi_id_t id,
@@ -104,6 +144,9 @@ esp_err_t spi_bridge_send_command(spi_id_t id,
spi_header_t *out_header,
uint8_t *out_payload,
uint32_t timeout_ms) {
+ if (!s_bridge_alive) {
+ return ESP_ERR_INVALID_STATE;
+ }
if (s_spi_mutex == NULL) {
s_spi_mutex = xSemaphoreCreateMutex();
}
@@ -204,13 +247,23 @@ esp_err_t spi_bridge_send_command(spi_id_t id,
// Static functions
static spi_stream_cb_t get_stream_cb(spi_id_t id) {
- if (id == SPI_ID_WIFI_APP_SNIFFER)
- return s_stream_cb_wifi;
- if (id == SPI_ID_BT_APP_SNIFFER)
- return s_stream_cb_bt;
+ for (int i = 0; i < SPI_STREAM_CB_SLOTS; i++) {
+ if (s_stream_cbs[i].cb != NULL && s_stream_cbs[i].id == id) {
+ return s_stream_cbs[i].cb;
+ }
+ }
return NULL;
}
+static bool has_any_stream_cb(void) {
+ for (int i = 0; i < SPI_STREAM_CB_SLOTS; i++) {
+ if (s_stream_cbs[i].cb != NULL) {
+ return true;
+ }
+ }
+ return false;
+}
+
static esp_err_t fetch_stream(spi_header_t *out_header, uint8_t *out_payload, uint8_t *out_len) {
spi_header_t header = {
.sync = SPI_SYNC_BYTE, .type = SPI_TYPE_CMD, .id = SPI_ID_SYSTEM_STREAM, .length = 0};
@@ -262,7 +315,7 @@ static void stream_task(void *arg) {
spi_header_t header;
while (1) {
- if (s_stream_cb_wifi == NULL && s_stream_cb_bt == NULL) {
+ if (!has_any_stream_cb()) {
s_stream_task_handle = NULL;
vTaskDelete(NULL);
return;
diff --git a/firmware_p4/components/Service/spi_bridge/spi_session.c b/firmware_p4/components/Service/spi_bridge/spi_session.c
new file mode 100644
index 00000000..75698591
--- /dev/null
+++ b/firmware_p4/components/Service/spi_bridge/spi_session.c
@@ -0,0 +1,258 @@
+// Copyright (c) 2025 HIGH CODE LLC
+//
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
+
+#include "spi_session.h"
+
+#include
+
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/semphr.h"
+#include "freertos/task.h"
+
+#include "spi_bridge.h"
+#include "spi_timeouts.h"
+
+static const char *TAG = "SPI_SESSION";
+
+#define HEARTBEAT_INTERVAL_MS 2000
+#define HEARTBEAT_FAIL_LIMIT 3
+#define HEARTBEAT_TIMEOUT_MS 1000
+#define HEARTBEAT_STACK_SIZE 3072
+#define HEARTBEAT_PRIO 5
+
+typedef struct {
+ uint32_t session_id;
+ spi_id_t op_id;
+ uint32_t last_acked_seq;
+ spi_session_stream_cb_t on_stream;
+ spi_session_lost_cb_t on_lost;
+ TaskHandle_t heartbeat_task;
+ bool stop_requested;
+} session_state_t;
+
+static session_state_t s_state = {0};
+static SemaphoreHandle_t s_mutex = NULL;
+static bool s_initialized = false;
+
+static void notify_lost_locked(const char *reason) {
+ if (s_state.session_id == SPI_SESSION_INVALID_ID)
+ return;
+
+ ESP_LOGW(TAG,
+ "Session 0x%08lx (op 0x%02X) lost: %s",
+ (unsigned long)s_state.session_id,
+ s_state.op_id,
+ reason);
+
+ uint32_t lost_id = s_state.session_id;
+ spi_id_t lost_op = s_state.op_id;
+ spi_session_lost_cb_t cb = s_state.on_lost;
+ spi_id_t stream_id = s_state.op_id;
+
+ spi_bridge_unregister_stream_cb(stream_id);
+ memset(&s_state, 0, sizeof(s_state));
+
+ if (cb != NULL)
+ cb(lost_id, lost_op);
+}
+
+static void on_session_stream(spi_id_t id, const uint8_t *payload, uint8_t len) {
+ (void)id;
+ if (len < sizeof(spi_stream_meta_t))
+ return;
+
+ spi_stream_meta_t meta;
+ memcpy(&meta, payload, sizeof(meta));
+
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ if (s_state.session_id == SPI_SESSION_INVALID_ID || meta.session_id != s_state.session_id) {
+ xSemaphoreGive(s_mutex);
+ return; // stale or alien stream — drop silently
+ }
+ if (meta.seq > s_state.last_acked_seq) {
+ s_state.last_acked_seq = meta.seq;
+ }
+ spi_session_stream_cb_t cb = s_state.on_stream;
+ xSemaphoreGive(s_mutex);
+
+ if (cb != NULL) {
+ cb(payload + sizeof(meta), (uint8_t)(len - sizeof(meta)));
+ }
+}
+
+static void on_session_lost_stream(spi_id_t id, const uint8_t *payload, uint8_t len) {
+ (void)id;
+ if (len < sizeof(spi_session_lost_t))
+ return;
+
+ spi_session_lost_t lost;
+ memcpy(&lost, payload, sizeof(lost));
+
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ if (lost.session_id == s_state.session_id && s_state.session_id != SPI_SESSION_INVALID_ID) {
+ notify_lost_locked("slave watchdog");
+ }
+ xSemaphoreGive(s_mutex);
+}
+
+static void heartbeat_task(void *arg) {
+ uint32_t session_id = (uint32_t)(uintptr_t)arg;
+ uint8_t consecutive_fails = 0;
+
+ while (1) {
+ vTaskDelay(pdMS_TO_TICKS(HEARTBEAT_INTERVAL_MS));
+
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ bool still_mine = (s_state.session_id == session_id) && !s_state.stop_requested;
+ spi_heartbeat_req_t req = {.session_id = session_id, .last_acked_seq = s_state.last_acked_seq};
+ xSemaphoreGive(s_mutex);
+ if (!still_mine)
+ break;
+
+ spi_header_t resp_header = {0};
+ spi_heartbeat_resp_t resp = {0};
+ esp_err_t ret = spi_bridge_send_command(SPI_ID_SESSION_HEARTBEAT,
+ (uint8_t *)&req,
+ sizeof(req),
+ &resp_header,
+ (uint8_t *)&resp,
+ HEARTBEAT_TIMEOUT_MS);
+ bool ok = (ret == ESP_OK) && (resp.alive != 0);
+ if (ok) {
+ consecutive_fails = 0;
+ continue;
+ }
+
+ consecutive_fails++;
+ ESP_LOGW(TAG,
+ "Heartbeat fail %u/%d for session 0x%08lx",
+ consecutive_fails,
+ HEARTBEAT_FAIL_LIMIT,
+ (unsigned long)session_id);
+ if (consecutive_fails >= HEARTBEAT_FAIL_LIMIT) {
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ if (s_state.session_id == session_id) {
+ notify_lost_locked("heartbeat fail limit");
+ }
+ xSemaphoreGive(s_mutex);
+ break;
+ }
+ }
+
+ vTaskDelete(NULL);
+}
+
+void spi_session_init(void) {
+ if (s_initialized)
+ return;
+ s_mutex = xSemaphoreCreateMutex();
+ spi_bridge_register_stream_cb(SPI_ID_SESSION_LOST, on_session_lost_stream);
+ s_initialized = true;
+ ESP_LOGI(TAG, "Session client started");
+}
+
+uint32_t spi_session_start(spi_id_t op_id,
+ const uint8_t *params,
+ uint8_t params_len,
+ spi_session_stream_cb_t on_stream,
+ spi_session_lost_cb_t on_lost) {
+ if (!s_initialized)
+ spi_session_init();
+
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ if (s_state.session_id != SPI_SESSION_INVALID_ID) {
+ ESP_LOGW(TAG,
+ "Replacing active session 0x%08lx with new start of op 0x%02X",
+ (unsigned long)s_state.session_id,
+ op_id);
+ notify_lost_locked("preempted by local start");
+ }
+ xSemaphoreGive(s_mutex);
+
+ spi_header_t resp_header = {0};
+ spi_session_resp_t resp = {0};
+ esp_err_t ret = spi_bridge_send_command(
+ op_id, params, params_len, &resp_header, (uint8_t *)&resp, spi_bridge_get_timeout(op_id));
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "START op 0x%02X bridge error: %s", op_id, esp_err_to_name(ret));
+ return SPI_SESSION_INVALID_ID;
+ }
+ if (resp.session_id == SPI_SESSION_INVALID_ID) {
+ ESP_LOGE(TAG, "START op 0x%02X did not return a session id", op_id);
+ return SPI_SESSION_INVALID_ID;
+ }
+
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ s_state.session_id = resp.session_id;
+ s_state.op_id = op_id;
+ s_state.last_acked_seq = 0;
+ s_state.on_stream = on_stream;
+ s_state.on_lost = on_lost;
+ s_state.stop_requested = false;
+ spi_bridge_register_stream_cb(op_id, on_session_stream);
+ BaseType_t ok = xTaskCreate(heartbeat_task,
+ "spi_session_hb",
+ HEARTBEAT_STACK_SIZE,
+ (void *)(uintptr_t)resp.session_id,
+ HEARTBEAT_PRIO,
+ &s_state.heartbeat_task);
+ uint32_t session_id = s_state.session_id;
+ xSemaphoreGive(s_mutex);
+
+ if (ok != pdPASS) {
+ ESP_LOGE(TAG, "Failed to create heartbeat task");
+ spi_session_stop(session_id);
+ return SPI_SESSION_INVALID_ID;
+ }
+
+ ESP_LOGI(TAG, "Session 0x%08lx started for op 0x%02X", (unsigned long)session_id, op_id);
+ return session_id;
+}
+
+esp_err_t spi_session_stop(uint32_t session_id) {
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ if (s_state.session_id != session_id || session_id == SPI_SESSION_INVALID_ID) {
+ xSemaphoreGive(s_mutex);
+ return ESP_ERR_NOT_FOUND;
+ }
+ s_state.stop_requested = true;
+ xSemaphoreGive(s_mutex);
+
+ spi_session_stop_req_t req = {.session_id = session_id};
+ spi_bridge_send_command(SPI_ID_SESSION_STOP,
+ (uint8_t *)&req,
+ sizeof(req),
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_SESSION_STOP));
+
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ if (s_state.session_id == session_id) {
+ spi_bridge_unregister_stream_cb(s_state.op_id);
+ memset(&s_state, 0, sizeof(s_state));
+ }
+ xSemaphoreGive(s_mutex);
+
+ ESP_LOGI(TAG, "Session 0x%08lx stopped", (unsigned long)session_id);
+ return ESP_OK;
+}
+
+bool spi_session_is_active(uint32_t session_id) {
+ xSemaphoreTake(s_mutex, portMAX_DELAY);
+ bool active = (s_state.session_id == session_id) && (session_id != SPI_SESSION_INVALID_ID);
+ xSemaphoreGive(s_mutex);
+ return active;
+}
diff --git a/firmware_p4/components/Service/storage_api/include/storage_impl.h b/firmware_p4/components/Service/storage_api/include/storage_impl.h
index 18684051..cd64839d 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_impl.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_impl.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_impl.h
diff --git a/firmware_p4/components/Service/storage_api/include/storage_init.h b/firmware_p4/components/Service/storage_api/include/storage_init.h
index d85d5af4..eedfc293 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_init.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_init.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_init.h
diff --git a/firmware_p4/components/Service/storage_api/include/storage_internal.h b/firmware_p4/components/Service/storage_api/include/storage_internal.h
index 091a132c..a79b3b8c 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_internal.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_internal.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_internal.h
diff --git a/firmware_p4/components/Service/storage_api/include/storage_mkdir.h b/firmware_p4/components/Service/storage_api/include/storage_mkdir.h
index e15748a5..ed798402 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_mkdir.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_mkdir.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef STORAGE_MKDIR_H
#define STORAGE_MKDIR_H
diff --git a/firmware_p4/components/Service/storage_api/include/storage_read.h b/firmware_p4/components/Service/storage_api/include/storage_read.h
index 4417f902..c2d7649e 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_read.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_read.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_read.h
diff --git a/firmware_p4/components/Service/storage_api/include/storage_stream.h b/firmware_p4/components/Service/storage_api/include/storage_stream.h
index abbe86a7..57fe9482 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_stream.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_stream.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef STORAGE_STREAM_H
#define STORAGE_STREAM_H
diff --git a/firmware_p4/components/Service/storage_api/include/storage_write.h b/firmware_p4/components/Service/storage_api/include/storage_write.h
index 0416340c..43e02c24 100644
--- a/firmware_p4/components/Service/storage_api/include/storage_write.h
+++ b/firmware_p4/components/Service/storage_api/include/storage_write.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_write.h
diff --git a/firmware_p4/components/Service/storage_api/include/tos_config.h b/firmware_p4/components/Service/storage_api/include/tos_config.h
index fe4a174e..2f3da191 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_config.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_config.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file tos_config.h
diff --git a/firmware_p4/components/Service/storage_api/include/tos_first_boot.h b/firmware_p4/components/Service/storage_api/include/tos_first_boot.h
index e5bed0eb..7bd2831f 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_first_boot.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_first_boot.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TOS_FIRST_BOOT_H
#define TOS_FIRST_BOOT_H
diff --git a/firmware_p4/components/Service/storage_api/include/tos_flash_paths.h b/firmware_p4/components/Service/storage_api/include/tos_flash_paths.h
index f2b260fa..b57c2dac 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_flash_paths.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_flash_paths.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TOS_FLASH_PATHS_H
#define TOS_FLASH_PATHS_H
@@ -41,6 +42,9 @@ extern "C" {
// Captive portal HTML templates (flash fallback)
#define FLASH_CAPTIVE_TEMPLATES FLASH_MOUNT "/html/captive_portal"
+// NFC key dictionaries (flash fallback)
+#define FLASH_NFC_DICT FLASH_MOUNT "/nfc/dict"
+
#ifdef __cplusplus
}
#endif
diff --git a/firmware_p4/components/Service/storage_api/include/tos_log.h b/firmware_p4/components/Service/storage_api/include/tos_log.h
index 5c4a1bcf..c6c9acaf 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_log.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_log.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TOS_LOG_H
#define TOS_LOG_H
diff --git a/firmware_p4/components/Service/storage_api/include/tos_loot.h b/firmware_p4/components/Service/storage_api/include/tos_loot.h
index 97c162e7..54f37c9f 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_loot.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_loot.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file tos_loot.h
diff --git a/firmware_p4/components/Service/storage_api/include/tos_storage_paths.h b/firmware_p4/components/Service/storage_api/include/tos_storage_paths.h
index 3a8d937e..580f845f 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_storage_paths.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_storage_paths.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TOS_STORAGE_PATHS_H
#define TOS_STORAGE_PATHS_H
@@ -33,6 +34,7 @@ extern "C" {
// Protocol sub-paths (only what each protocol actually uses per doc)
#define TOS_PATH_NFC_ASSETS TOS_PATH_NFC "/assets"
+#define TOS_PATH_NFC_DICT TOS_PATH_NFC_ASSETS "/dict"
#define TOS_PATH_RFID_ASSETS TOS_PATH_RFID "/assets"
diff --git a/firmware_p4/components/Service/storage_api/include/tos_theme.h b/firmware_p4/components/Service/storage_api/include/tos_theme.h
index 50665cd3..7a535020 100644
--- a/firmware_p4/components/Service/storage_api/include/tos_theme.h
+++ b/firmware_p4/components/Service/storage_api/include/tos_theme.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef TOS_THEME_H
#define TOS_THEME_H
diff --git a/firmware_p4/components/Service/storage_api/storage_impl.c b/firmware_p4/components/Service/storage_api/storage_impl.c
index 550106d9..cff9db4f 100644
--- a/firmware_p4/components/Service/storage_api/storage_impl.c
+++ b/firmware_p4/components/Service/storage_api/storage_impl.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_impl.c
diff --git a/firmware_p4/components/Service/storage_api/storage_init.c b/firmware_p4/components/Service/storage_api/storage_init.c
index b3804c24..08295391 100644
--- a/firmware_p4/components/Service/storage_api/storage_init.c
+++ b/firmware_p4/components/Service/storage_api/storage_init.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "storage_init.h"
diff --git a/firmware_p4/components/Service/storage_api/storage_mkdir.c b/firmware_p4/components/Service/storage_api/storage_mkdir.c
index 84933701..393a1d4d 100644
--- a/firmware_p4/components/Service/storage_api/storage_mkdir.c
+++ b/firmware_p4/components/Service/storage_api/storage_mkdir.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "storage_mkdir.h"
diff --git a/firmware_p4/components/Service/storage_api/storage_read.c b/firmware_p4/components/Service/storage_api/storage_read.c
index 0a6860f1..c6dc3d15 100644
--- a/firmware_p4/components/Service/storage_api/storage_read.c
+++ b/firmware_p4/components/Service/storage_api/storage_read.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file storage_read.c
diff --git a/firmware_p4/components/Service/storage_api/storage_stream.c b/firmware_p4/components/Service/storage_api/storage_stream.c
index c2589c82..2a08fdf1 100644
--- a/firmware_p4/components/Service/storage_api/storage_stream.c
+++ b/firmware_p4/components/Service/storage_api/storage_stream.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "storage_stream.h"
diff --git a/firmware_p4/components/Service/storage_api/storage_write.c b/firmware_p4/components/Service/storage_api/storage_write.c
index 0f0f88ac..d119987d 100644
--- a/firmware_p4/components/Service/storage_api/storage_write.c
+++ b/firmware_p4/components/Service/storage_api/storage_write.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "storage_write.h"
diff --git a/firmware_p4/components/Service/storage_api/tos_config.c b/firmware_p4/components/Service/storage_api/tos_config.c
index 52e47bcb..d62c479d 100644
--- a/firmware_p4/components/Service/storage_api/tos_config.c
+++ b/firmware_p4/components/Service/storage_api/tos_config.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tos_config.h"
#include "tos_storage_paths.h"
diff --git a/firmware_p4/components/Service/storage_api/tos_first_boot.c b/firmware_p4/components/Service/storage_api/tos_first_boot.c
index 3927bccc..268d7b37 100644
--- a/firmware_p4/components/Service/storage_api/tos_first_boot.c
+++ b/firmware_p4/components/Service/storage_api/tos_first_boot.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tos_first_boot.h"
#include "tos_config.h"
@@ -45,6 +46,7 @@ static const char *const FIRST_BOOT_DIRS[] = {
// Protocol assets
TOS_PATH_NFC_ASSETS,
+ TOS_PATH_NFC_DICT,
TOS_PATH_RFID_ASSETS,
TOS_PATH_SUBGHZ_ASSETS,
TOS_PATH_IR_ASSETS,
@@ -237,8 +239,9 @@ static const asset_copy_t FIRST_BOOT_ASSETS[] = {
// BadUSB example scripts
{FLASH_STORAGE_BADUSB "/rickroll.txt", TOS_PATH_BADUSB_ASSETS "/rickroll.txt"},
- // TODO: add protocol database entries here when files are added to flash
- // e.g. mf_classic_dict.nfc, oui_db.csv, frequency_list.sub, etc.
+ {FLASH_NFC_DICT "/mf_classic_default.dic", TOS_PATH_NFC_DICT "/mf_classic_default.dic"},
+ {FLASH_NFC_DICT "/mf_classic_user.dic", TOS_PATH_NFC_DICT "/mf_classic_user.dic"},
+ {FLASH_NFC_DICT "/mf_ulc_default.dic", TOS_PATH_NFC_DICT "/mf_ulc_default.dic"},
{NULL, NULL}};
diff --git a/firmware_p4/components/Service/storage_api/tos_log.c b/firmware_p4/components/Service/storage_api/tos_log.c
index 1e5b80ab..7ce40213 100644
--- a/firmware_p4/components/Service/storage_api/tos_log.c
+++ b/firmware_p4/components/Service/storage_api/tos_log.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tos_log.h"
diff --git a/firmware_p4/components/Service/storage_api/tos_loot.c b/firmware_p4/components/Service/storage_api/tos_loot.c
index 20afbd56..da7f8aef 100644
--- a/firmware_p4/components/Service/storage_api/tos_loot.c
+++ b/firmware_p4/components/Service/storage_api/tos_loot.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tos_loot.h"
diff --git a/firmware_p4/components/Service/storage_api/tos_theme.c b/firmware_p4/components/Service/storage_api/tos_theme.c
index d10cf8e1..762ba42f 100644
--- a/firmware_p4/components/Service/storage_api/tos_theme.c
+++ b/firmware_p4/components/Service/storage_api/tos_theme.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "tos_theme.h"
diff --git a/firmware_p4/components/Service/storage_assets/include/storage_assets.h b/firmware_p4/components/Service/storage_assets/include/storage_assets.h
index 63e8c3d9..3a6c9dd4 100644
--- a/firmware_p4/components/Service/storage_assets/include/storage_assets.h
+++ b/firmware_p4/components/Service/storage_assets/include/storage_assets.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef STORAGE_ASSETS_H
#define STORAGE_ASSETS_H
diff --git a/firmware_p4/components/Service/storage_assets/storage_assets.c b/firmware_p4/components/Service/storage_assets/storage_assets.c
index 2e6ea0f0..3898329b 100644
--- a/firmware_p4/components/Service/storage_assets/storage_assets.c
+++ b/firmware_p4/components/Service/storage_assets/storage_assets.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "storage_assets.h"
diff --git a/firmware_p4/components/Service/storage_vfs/include/vfs_config.h b/firmware_p4/components/Service/storage_vfs/include/vfs_config.h
index 45708625..20e99052 100644
--- a/firmware_p4/components/Service/storage_vfs/include/vfs_config.h
+++ b/firmware_p4/components/Service/storage_vfs/include/vfs_config.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file vfs_config.h
diff --git a/firmware_p4/components/Service/storage_vfs/include/vfs_core.h b/firmware_p4/components/Service/storage_vfs/include/vfs_core.h
index 542e6220..d2710f60 100644
--- a/firmware_p4/components/Service/storage_vfs/include/vfs_core.h
+++ b/firmware_p4/components/Service/storage_vfs/include/vfs_core.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file vfs_core.h
diff --git a/firmware_p4/components/Service/storage_vfs/include/vfs_littlefs.h b/firmware_p4/components/Service/storage_vfs/include/vfs_littlefs.h
index b1cdde39..14dc07b8 100644
--- a/firmware_p4/components/Service/storage_vfs/include/vfs_littlefs.h
+++ b/firmware_p4/components/Service/storage_vfs/include/vfs_littlefs.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file vfs_littlefs.h
diff --git a/firmware_p4/components/Service/storage_vfs/include/vfs_sdcard.h b/firmware_p4/components/Service/storage_vfs/include/vfs_sdcard.h
index 0300395f..19750e96 100644
--- a/firmware_p4/components/Service/storage_vfs/include/vfs_sdcard.h
+++ b/firmware_p4/components/Service/storage_vfs/include/vfs_sdcard.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file vfs_sdcard.h
diff --git a/firmware_p4/components/Service/storage_vfs/vfs_auto.c b/firmware_p4/components/Service/storage_vfs/vfs_auto.c
index da6282d0..dbe02973 100644
--- a/firmware_p4/components/Service/storage_vfs/vfs_auto.c
+++ b/firmware_p4/components/Service/storage_vfs/vfs_auto.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
/**
* @file vfs_auto.c
diff --git a/firmware_p4/components/Service/storage_vfs/vfs_core.c b/firmware_p4/components/Service/storage_vfs/vfs_core.c
index fa92fb19..6071cf37 100644
--- a/firmware_p4/components/Service/storage_vfs/vfs_core.c
+++ b/firmware_p4/components/Service/storage_vfs/vfs_core.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "vfs_core.h"
diff --git a/firmware_p4/components/Service/storage_vfs/vfs_littlefs.c b/firmware_p4/components/Service/storage_vfs/vfs_littlefs.c
index 8df1b660..b533d586 100644
--- a/firmware_p4/components/Service/storage_vfs/vfs_littlefs.c
+++ b/firmware_p4/components/Service/storage_vfs/vfs_littlefs.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "vfs_littlefs.h"
diff --git a/firmware_p4/components/Service/storage_vfs/vfs_sdcard.c b/firmware_p4/components/Service/storage_vfs/vfs_sdcard.c
index ea6e151e..c64f2526 100644
--- a/firmware_p4/components/Service/storage_vfs/vfs_sdcard.c
+++ b/firmware_p4/components/Service/storage_vfs/vfs_sdcard.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "vfs_sdcard.h"
diff --git a/firmware_p4/components/Service/wifi/include/mac_vendor.h b/firmware_p4/components/Service/wifi/include/mac_vendor.h
index a5ead6fb..a1f8118f 100644
--- a/firmware_p4/components/Service/wifi/include/mac_vendor.h
+++ b/firmware_p4/components/Service/wifi/include/mac_vendor.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef MAC_VENDOR_H
#define MAC_VENDOR_H
diff --git a/firmware_p4/components/Service/wifi/include/wifi_80211.h b/firmware_p4/components/Service/wifi/include/wifi_80211.h
index 705160ab..71ab7ff8 100644
--- a/firmware_p4/components/Service/wifi/include/wifi_80211.h
+++ b/firmware_p4/components/Service/wifi/include/wifi_80211.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_80211_H
#define WIFI_80211_H
diff --git a/firmware_p4/components/Service/wifi/include/wifi_service.h b/firmware_p4/components/Service/wifi/include/wifi_service.h
index ad08d0e6..8328910f 100644
--- a/firmware_p4/components/Service/wifi/include/wifi_service.h
+++ b/firmware_p4/components/Service/wifi/include/wifi_service.h
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#ifndef WIFI_SERVICE_H
#define WIFI_SERVICE_H
diff --git a/firmware_p4/components/Service/wifi/mac_vendor.c b/firmware_p4/components/Service/wifi/mac_vendor.c
index 3202973e..c3d23ca9 100644
--- a/firmware_p4/components/Service/wifi/mac_vendor.c
+++ b/firmware_p4/components/Service/wifi/mac_vendor.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "mac_vendor.h"
diff --git a/firmware_p4/components/Service/wifi/wifi_service.c b/firmware_p4/components/Service/wifi/wifi_service.c
index 747fe40f..d5515d7a 100644
--- a/firmware_p4/components/Service/wifi/wifi_service.c
+++ b/firmware_p4/components/Service/wifi/wifi_service.c
@@ -1,16 +1,17 @@
// Copyright (c) 2025 HIGH CODE LLC
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// TentacleOS is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// TentacleOS is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// You should have received a copy of the GNU General Public License
+// along with TentacleOS. If not, see .
#include "wifi_service.h"
@@ -22,33 +23,34 @@
static const char *TAG = "WIFI_SERVICE_P4";
-#define SSID_MAX_LEN 33
-#define SPI_TIMEOUT_MS 2000
-#define SPI_SCAN_TIMEOUT_MS 20000
-#define SPI_CONNECT_TIMEOUT_MS 15000
-#define SPI_DATA_TIMEOUT_MS 1000
+#define SSID_MAX_LEN 33
static wifi_ap_record_t s_cached_record;
static char s_connected_ssid[SSID_MAX_LEN] = {0};
void wifi_service_init(void) {
- spi_bridge_send_command(SPI_ID_WIFI_START, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ spi_bridge_send_command(
+ SPI_ID_WIFI_START, NULL, 0, NULL, NULL, spi_bridge_get_timeout(SPI_ID_WIFI_START));
}
void wifi_service_deinit(void) {
- spi_bridge_send_command(SPI_ID_WIFI_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ spi_bridge_send_command(
+ SPI_ID_WIFI_STOP, NULL, 0, NULL, NULL, spi_bridge_get_timeout(SPI_ID_WIFI_STOP));
}
void wifi_service_start(void) {
- spi_bridge_send_command(SPI_ID_WIFI_START, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ spi_bridge_send_command(
+ SPI_ID_WIFI_START, NULL, 0, NULL, NULL, spi_bridge_get_timeout(SPI_ID_WIFI_START));
}
void wifi_service_stop(void) {
- spi_bridge_send_command(SPI_ID_WIFI_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ spi_bridge_send_command(
+ SPI_ID_WIFI_STOP, NULL, 0, NULL, NULL, spi_bridge_get_timeout(SPI_ID_WIFI_STOP));
}
void wifi_service_scan(void) {
- spi_bridge_send_command(SPI_ID_WIFI_SCAN, NULL, 0, NULL, NULL, SPI_SCAN_TIMEOUT_MS);
+ spi_bridge_send_command(
+ SPI_ID_WIFI_SCAN, NULL, 0, NULL, NULL, spi_bridge_get_timeout(SPI_ID_WIFI_SCAN));
}
uint16_t wifi_service_get_ap_count(void) {
@@ -56,9 +58,12 @@ uint16_t wifi_service_get_ap_count(void) {
uint8_t payload[2];
uint16_t magic_count = SPI_DATA_INDEX_COUNT;
- if (spi_bridge_send_command(
- SPI_ID_SYSTEM_DATA, (uint8_t *)&magic_count, 2, &resp, payload, SPI_DATA_TIMEOUT_MS) ==
- ESP_OK) {
+ if (spi_bridge_send_command(SPI_ID_SYSTEM_DATA,
+ (uint8_t *)&magic_count,
+ 2,
+ &resp,
+ payload,
+ spi_bridge_get_timeout(SPI_ID_SYSTEM_DATA)) == ESP_OK) {
uint16_t count;
memcpy(&count, payload, 2);
return count;
@@ -74,7 +79,7 @@ wifi_ap_record_t *wifi_service_get_ap_record(uint16_t index) {
2,
&resp,
(uint8_t *)&s_cached_record,
- SPI_DATA_TIMEOUT_MS) == ESP_OK) {
+ spi_bridge_get_timeout(SPI_ID_SYSTEM_DATA)) == ESP_OK) {
return &s_cached_record;
}
return NULL;
@@ -86,16 +91,24 @@ esp_err_t wifi_service_connect_to_ap(const char *ssid, const char *password) {
if (password != NULL) {
strncpy(cfg.password, password, sizeof(cfg.password));
}
- return spi_bridge_send_command(
- SPI_ID_WIFI_CONNECT, (uint8_t *)&cfg, sizeof(cfg), NULL, NULL, SPI_CONNECT_TIMEOUT_MS);
+ return spi_bridge_send_command(SPI_ID_WIFI_CONNECT,
+ (uint8_t *)&cfg,
+ sizeof(cfg),
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_CONNECT));
}
bool wifi_service_is_connected(void) {
spi_header_t resp;
spi_system_status_t sys = {0};
- if (spi_bridge_send_command(
- SPI_ID_SYSTEM_STATUS, NULL, 0, &resp, (uint8_t *)&sys, SPI_DATA_TIMEOUT_MS) == ESP_OK) {
+ if (spi_bridge_send_command(SPI_ID_SYSTEM_STATUS,
+ NULL,
+ 0,
+ &resp,
+ (uint8_t *)&sys,
+ spi_bridge_get_timeout(SPI_ID_SYSTEM_STATUS)) == ESP_OK) {
return sys.wifi_connected != 0;
}
return (wifi_service_get_connected_ssid() != NULL);
@@ -109,7 +122,7 @@ const char *wifi_service_get_connected_ssid(void) {
0,
&resp,
(uint8_t *)s_connected_ssid,
- SPI_DATA_TIMEOUT_MS) == ESP_OK) {
+ spi_bridge_get_timeout(SPI_ID_WIFI_GET_STA_INFO)) == ESP_OK) {
s_connected_ssid[SSID_MAX_LEN - 1] = '\0';
return s_connected_ssid;
}
@@ -120,8 +133,12 @@ bool wifi_service_is_active(void) {
spi_header_t resp;
spi_system_status_t sys = {0};
- if (spi_bridge_send_command(
- SPI_ID_SYSTEM_STATUS, NULL, 0, &resp, (uint8_t *)&sys, SPI_DATA_TIMEOUT_MS) == ESP_OK) {
+ if (spi_bridge_send_command(SPI_ID_SYSTEM_STATUS,
+ NULL,
+ 0,
+ &resp,
+ (uint8_t *)&sys,
+ spi_bridge_get_timeout(SPI_ID_SYSTEM_STATUS)) == ESP_OK) {
return sys.wifi_active != 0;
}
return false;
@@ -149,18 +166,31 @@ esp_err_t wifi_service_save_ap_config(
}
cfg.enabled = enabled ? 1 : 0;
- return spi_bridge_send_command(
- SPI_ID_WIFI_SAVE_AP_CONFIG, (uint8_t *)&cfg, sizeof(cfg), NULL, NULL, SPI_TIMEOUT_MS);
+ return spi_bridge_send_command(SPI_ID_WIFI_SAVE_AP_CONFIG,
+ (uint8_t *)&cfg,
+ sizeof(cfg),
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_SAVE_AP_CONFIG));
}
esp_err_t wifi_service_set_enabled(bool enabled) {
uint8_t payload = enabled ? 1 : 0;
- return spi_bridge_send_command(SPI_ID_WIFI_SET_ENABLED, &payload, 1, NULL, NULL, SPI_TIMEOUT_MS);
+ return spi_bridge_send_command(SPI_ID_WIFI_SET_ENABLED,
+ &payload,
+ 1,
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_SET_ENABLED));
}
esp_err_t wifi_service_set_ap_ssid(const char *ssid) {
- return spi_bridge_send_command(
- SPI_ID_WIFI_SET_AP, (uint8_t *)ssid, strlen(ssid), NULL, NULL, SPI_TIMEOUT_MS);
+ return spi_bridge_send_command(SPI_ID_WIFI_SET_AP,
+ (uint8_t *)ssid,
+ strlen(ssid),
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_SET_AP));
}
esp_err_t wifi_service_set_ap_password(const char *password) {
@@ -172,45 +202,71 @@ esp_err_t wifi_service_set_ap_password(const char *password) {
strlen(password),
NULL,
NULL,
- SPI_TIMEOUT_MS);
+ spi_bridge_get_timeout(SPI_ID_WIFI_SET_AP_PASSWORD));
}
esp_err_t wifi_service_set_ap_max_conn(uint8_t max_conn) {
uint8_t payload = max_conn;
- return spi_bridge_send_command(
- SPI_ID_WIFI_SET_AP_MAX_CONN, &payload, 1, NULL, NULL, SPI_TIMEOUT_MS);
+ return spi_bridge_send_command(SPI_ID_WIFI_SET_AP_MAX_CONN,
+ &payload,
+ 1,
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_SET_AP_MAX_CONN));
}
esp_err_t wifi_service_set_ap_ip(const char *ip_addr) {
if (ip_addr == NULL) {
return ESP_ERR_INVALID_ARG;
}
- return spi_bridge_send_command(
- SPI_ID_WIFI_SET_AP_IP, (uint8_t *)ip_addr, strlen(ip_addr), NULL, NULL, SPI_TIMEOUT_MS);
+ return spi_bridge_send_command(SPI_ID_WIFI_SET_AP_IP,
+ (uint8_t *)ip_addr,
+ strlen(ip_addr),
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_SET_AP_IP));
}
void wifi_service_promiscuous_start(wifi_promiscuous_cb_t cb, wifi_promiscuous_filter_t *filter) {
(void)cb;
(void)filter;
- esp_err_t err =
- spi_bridge_send_command(SPI_ID_WIFI_PROMISC_START, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ esp_err_t err = spi_bridge_send_command(SPI_ID_WIFI_PROMISC_START,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_PROMISC_START));
if (err == ESP_ERR_NOT_SUPPORTED) {
ESP_LOGW(TAG, "Promiscuous start not supported over SPI");
}
}
void wifi_service_promiscuous_stop(void) {
- esp_err_t err =
- spi_bridge_send_command(SPI_ID_WIFI_PROMISC_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ esp_err_t err = spi_bridge_send_command(SPI_ID_WIFI_PROMISC_STOP,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_PROMISC_STOP));
if (err == ESP_ERR_NOT_SUPPORTED) {
ESP_LOGW(TAG, "Promiscuous stop not supported over SPI");
}
}
void wifi_service_start_channel_hopping(void) {
- spi_bridge_send_command(SPI_ID_WIFI_CH_HOP_START, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ spi_bridge_send_command(SPI_ID_WIFI_CH_HOP_START,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_CH_HOP_START));
}
void wifi_service_stop_channel_hopping(void) {
- spi_bridge_send_command(SPI_ID_WIFI_CH_HOP_STOP, NULL, 0, NULL, NULL, SPI_TIMEOUT_MS);
+ spi_bridge_send_command(SPI_ID_WIFI_CH_HOP_STOP,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ spi_bridge_get_timeout(SPI_ID_WIFI_CH_HOP_STOP));
}
diff --git a/firmware_p4/sdkconfig b/firmware_p4/sdkconfig
deleted file mode 100644
index b5601fd2..00000000
--- a/firmware_p4/sdkconfig
+++ /dev/null
@@ -1,3112 +0,0 @@
-#
-# Automatically generated file. DO NOT EDIT.
-# Espressif IoT Development Framework (ESP-IDF) 5.5.3 Project Configuration
-#
-CONFIG_SOC_ADC_SUPPORTED=y
-CONFIG_SOC_ANA_CMPR_SUPPORTED=y
-CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y
-CONFIG_SOC_UART_SUPPORTED=y
-CONFIG_SOC_GDMA_SUPPORTED=y
-CONFIG_SOC_UHCI_SUPPORTED=y
-CONFIG_SOC_AHB_GDMA_SUPPORTED=y
-CONFIG_SOC_AXI_GDMA_SUPPORTED=y
-CONFIG_SOC_DW_GDMA_SUPPORTED=y
-CONFIG_SOC_DMA2D_SUPPORTED=y
-CONFIG_SOC_GPTIMER_SUPPORTED=y
-CONFIG_SOC_PCNT_SUPPORTED=y
-CONFIG_SOC_LCDCAM_SUPPORTED=y
-CONFIG_SOC_LCDCAM_CAM_SUPPORTED=y
-CONFIG_SOC_LCDCAM_I80_LCD_SUPPORTED=y
-CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED=y
-CONFIG_SOC_MIPI_CSI_SUPPORTED=y
-CONFIG_SOC_MIPI_DSI_SUPPORTED=y
-CONFIG_SOC_MCPWM_SUPPORTED=y
-CONFIG_SOC_TWAI_SUPPORTED=y
-CONFIG_SOC_ETM_SUPPORTED=y
-CONFIG_SOC_PARLIO_SUPPORTED=y
-CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y
-CONFIG_SOC_EMAC_SUPPORTED=y
-CONFIG_SOC_USB_OTG_SUPPORTED=y
-CONFIG_SOC_WIRELESS_HOST_SUPPORTED=y
-CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y
-CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y
-CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y
-CONFIG_SOC_ULP_SUPPORTED=y
-CONFIG_SOC_LP_CORE_SUPPORTED=y
-CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y
-CONFIG_SOC_EFUSE_SUPPORTED=y
-CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y
-CONFIG_SOC_RTC_MEM_SUPPORTED=y
-CONFIG_SOC_RMT_SUPPORTED=y
-CONFIG_SOC_I2S_SUPPORTED=y
-CONFIG_SOC_SDM_SUPPORTED=y
-CONFIG_SOC_GPSPI_SUPPORTED=y
-CONFIG_SOC_LEDC_SUPPORTED=y
-CONFIG_SOC_ISP_SUPPORTED=y
-CONFIG_SOC_I2C_SUPPORTED=y
-CONFIG_SOC_SYSTIMER_SUPPORTED=y
-CONFIG_SOC_AES_SUPPORTED=y
-CONFIG_SOC_MPI_SUPPORTED=y
-CONFIG_SOC_SHA_SUPPORTED=y
-CONFIG_SOC_HMAC_SUPPORTED=y
-CONFIG_SOC_DIG_SIGN_SUPPORTED=y
-CONFIG_SOC_ECC_SUPPORTED=y
-CONFIG_SOC_ECC_EXTENDED_MODES_SUPPORTED=y
-CONFIG_SOC_FLASH_ENC_SUPPORTED=y
-CONFIG_SOC_SECURE_BOOT_SUPPORTED=y
-CONFIG_SOC_BOD_SUPPORTED=y
-CONFIG_SOC_VBAT_SUPPORTED=y
-CONFIG_SOC_APM_SUPPORTED=y
-CONFIG_SOC_PMU_SUPPORTED=y
-CONFIG_SOC_PMU_PVT_SUPPORTED=y
-CONFIG_SOC_PVT_EN_WITH_SLEEP=y
-CONFIG_SOC_PVT_RETENTION_BY_REGDMA=y
-CONFIG_SOC_DCDC_SUPPORTED=y
-CONFIG_SOC_PAU_SUPPORTED=y
-CONFIG_SOC_LP_TIMER_SUPPORTED=y
-CONFIG_SOC_ULP_LP_UART_SUPPORTED=y
-CONFIG_SOC_LP_GPIO_MATRIX_SUPPORTED=y
-CONFIG_SOC_LP_PERIPHERALS_SUPPORTED=y
-CONFIG_SOC_LP_I2C_SUPPORTED=y
-CONFIG_SOC_LP_I2S_SUPPORTED=y
-CONFIG_SOC_LP_SPI_SUPPORTED=y
-CONFIG_SOC_LP_ADC_SUPPORTED=y
-CONFIG_SOC_LP_VAD_SUPPORTED=y
-CONFIG_SOC_SPIRAM_SUPPORTED=y
-CONFIG_SOC_PSRAM_DMA_CAPABLE=y
-CONFIG_SOC_SDMMC_HOST_SUPPORTED=y
-CONFIG_SOC_CLK_TREE_SUPPORTED=y
-CONFIG_SOC_ASSIST_DEBUG_SUPPORTED=y
-CONFIG_SOC_DEBUG_PROBE_SUPPORTED=y
-CONFIG_SOC_WDT_SUPPORTED=y
-CONFIG_SOC_SPI_FLASH_SUPPORTED=y
-CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y
-CONFIG_SOC_RNG_SUPPORTED=y
-CONFIG_SOC_GP_LDO_SUPPORTED=y
-CONFIG_SOC_PPA_SUPPORTED=y
-CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y
-CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y
-CONFIG_SOC_PM_SUPPORTED=y
-CONFIG_SOC_BITSCRAMBLER_SUPPORTED=y
-CONFIG_SOC_SIMD_INSTRUCTION_SUPPORTED=y
-CONFIG_SOC_I3C_MASTER_SUPPORTED=y
-CONFIG_SOC_XTAL_SUPPORT_40M=y
-CONFIG_SOC_AES_SUPPORT_DMA=y
-CONFIG_SOC_AES_SUPPORT_GCM=y
-CONFIG_SOC_AES_GDMA=y
-CONFIG_SOC_AES_SUPPORT_AES_128=y
-CONFIG_SOC_AES_SUPPORT_AES_256=y
-CONFIG_SOC_AES_SUPPORT_PSEUDO_ROUND_FUNCTION=y
-CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y
-CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y
-CONFIG_SOC_ADC_DMA_SUPPORTED=y
-CONFIG_SOC_ADC_PERIPH_NUM=2
-CONFIG_SOC_ADC_MAX_CHANNEL_NUM=8
-CONFIG_SOC_ADC_ATTEN_NUM=4
-CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2
-CONFIG_SOC_ADC_PATT_LEN_MAX=16
-CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12
-CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12
-CONFIG_SOC_ADC_DIGI_IIR_FILTER_NUM=2
-CONFIG_SOC_ADC_DIGI_MONITOR_NUM=2
-CONFIG_SOC_ADC_DIGI_RESULT_BYTES=4
-CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4
-CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333
-CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611
-CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12
-CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12
-CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y
-CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y
-CONFIG_SOC_ADC_CALIB_CHAN_COMPENS_SUPPORTED=y
-CONFIG_SOC_ADC_SHARED_POWER=y
-CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y
-CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y
-CONFIG_SOC_CACHE_WRITEBACK_SUPPORTED=y
-CONFIG_SOC_CACHE_FREEZE_SUPPORTED=y
-CONFIG_SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE=y
-CONFIG_SOC_CPU_CORES_NUM=2
-CONFIG_SOC_CPU_INTR_NUM=32
-CONFIG_SOC_CPU_HAS_FLEXIBLE_INTC=y
-CONFIG_SOC_INT_CLIC_SUPPORTED=y
-CONFIG_SOC_INT_HW_NESTED_SUPPORTED=y
-CONFIG_SOC_BRANCH_PREDICTOR_SUPPORTED=y
-CONFIG_SOC_CPU_COPROC_NUM=3
-CONFIG_SOC_CPU_HAS_FPU=y
-CONFIG_SOC_CPU_HAS_FPU_EXT_ILL_BUG=y
-CONFIG_SOC_CPU_HAS_HWLOOP=y
-CONFIG_SOC_CPU_HAS_HWLOOP_STATE_BUG=y
-CONFIG_SOC_CPU_HAS_PIE=y
-CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y
-CONFIG_SOC_CPU_BREAKPOINTS_NUM=3
-CONFIG_SOC_CPU_WATCHPOINTS_NUM=3
-CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x100
-CONFIG_SOC_CPU_HAS_PMA=y
-CONFIG_SOC_CPU_IDRAM_SPLIT_USING_PMP=y
-CONFIG_SOC_CPU_PMP_REGION_GRANULARITY=128
-CONFIG_SOC_CPU_HAS_LOCKUP_RESET=y
-CONFIG_SOC_SIMD_PREFERRED_DATA_ALIGNMENT=16
-CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096
-CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16
-CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100
-CONFIG_SOC_DMA_CAN_ACCESS_FLASH=y
-CONFIG_SOC_AHB_GDMA_VERSION=2
-CONFIG_SOC_GDMA_SUPPORT_CRC=y
-CONFIG_SOC_GDMA_NUM_GROUPS_MAX=2
-CONFIG_SOC_GDMA_PAIRS_PER_GROUP_MAX=3
-CONFIG_SOC_AHB_GDMA_SUPPORT_PSRAM=y
-CONFIG_SOC_AXI_GDMA_SUPPORT_PSRAM=y
-CONFIG_SOC_GDMA_SUPPORT_ETM=y
-CONFIG_SOC_GDMA_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_GDMA_EXT_MEM_ENC_ALIGNMENT=16
-CONFIG_SOC_DMA2D_GROUPS=1
-CONFIG_SOC_DMA2D_TX_CHANNELS_PER_GROUP=4
-CONFIG_SOC_DMA2D_RX_CHANNELS_PER_GROUP=3
-CONFIG_SOC_ETM_GROUPS=1
-CONFIG_SOC_ETM_CHANNELS_PER_GROUP=50
-CONFIG_SOC_ETM_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_GPIO_PORT=1
-CONFIG_SOC_GPIO_PIN_COUNT=55
-CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER=y
-CONFIG_SOC_GPIO_FLEX_GLITCH_FILTER_NUM=8
-CONFIG_SOC_GPIO_SUPPORT_PIN_HYS_FILTER=y
-CONFIG_SOC_GPIO_SUPPORT_ETM=y
-CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y
-CONFIG_SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP=y
-CONFIG_SOC_LP_IO_HAS_INDEPENDENT_WAKEUP_SOURCE=y
-CONFIG_SOC_LP_IO_CLOCK_IS_INDEPENDENT=y
-CONFIG_SOC_GPIO_VALID_GPIO_MASK=0x007FFFFFFFFFFFFF
-CONFIG_SOC_GPIO_IN_RANGE_MAX=54
-CONFIG_SOC_GPIO_OUT_RANGE_MAX=54
-CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK=0
-CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT=16
-CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x007FFFFFFFFF0000
-CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y
-CONFIG_SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP=y
-CONFIG_SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX=y
-CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=2
-CONFIG_SOC_CLOCKOUT_SUPPORT_CHANNEL_DIVIDER=y
-CONFIG_SOC_DEBUG_PROBE_NUM_UNIT=1
-CONFIG_SOC_DEBUG_PROBE_MAX_OUTPUT_WIDTH=16
-CONFIG_SOC_RTCIO_PIN_COUNT=16
-CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y
-CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y
-CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y
-CONFIG_SOC_RTCIO_EDGE_WAKE_SUPPORTED=y
-CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8
-CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8
-CONFIG_SOC_DEDIC_PERIPH_ALWAYS_ENABLE=y
-CONFIG_SOC_ANA_CMPR_NUM=2
-CONFIG_SOC_ANA_CMPR_CAN_DISTINGUISH_EDGE=y
-CONFIG_SOC_ANA_CMPR_SUPPORT_ETM=y
-CONFIG_SOC_I2C_NUM=3
-CONFIG_SOC_HP_I2C_NUM=2
-CONFIG_SOC_I2C_FIFO_LEN=32
-CONFIG_SOC_I2C_CMD_REG_NUM=8
-CONFIG_SOC_I2C_SUPPORT_SLAVE=y
-CONFIG_SOC_I2C_SUPPORT_HW_FSM_RST=y
-CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y
-CONFIG_SOC_I2C_SUPPORT_XTAL=y
-CONFIG_SOC_I2C_SUPPORT_RTC=y
-CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y
-CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y
-CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y
-CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y
-CONFIG_SOC_I2C_SLAVE_SUPPORT_SLAVE_UNMATCH=y
-CONFIG_SOC_I2C_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_LP_I2C_NUM=1
-CONFIG_SOC_LP_I2C_FIFO_LEN=16
-CONFIG_SOC_I2S_NUM=3
-CONFIG_SOC_I2S_HW_VERSION_2=y
-CONFIG_SOC_I2S_SUPPORTS_ETM=y
-CONFIG_SOC_I2S_SUPPORTS_XTAL=y
-CONFIG_SOC_I2S_SUPPORTS_APLL=y
-CONFIG_SOC_I2S_SUPPORTS_PCM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y
-CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y
-CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM_RX_HP_FILTER=y
-CONFIG_SOC_I2S_SUPPORTS_TX_SYNC_CNT=y
-CONFIG_SOC_I2S_SUPPORTS_TDM=y
-CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2
-CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4
-CONFIG_SOC_I2S_TDM_FULL_DATA_WIDTH=y
-CONFIG_SOC_I2S_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_LP_I2S_NUM=1
-CONFIG_SOC_ISP_BF_SUPPORTED=y
-CONFIG_SOC_ISP_BLC_SUPPORTED=y
-CONFIG_SOC_ISP_CCM_SUPPORTED=y
-CONFIG_SOC_ISP_COLOR_SUPPORTED=y
-CONFIG_SOC_ISP_CROP_SUPPORTED=y
-CONFIG_SOC_ISP_DEMOSAIC_SUPPORTED=y
-CONFIG_SOC_ISP_DVP_SUPPORTED=y
-CONFIG_SOC_ISP_LSC_SUPPORTED=y
-CONFIG_SOC_ISP_SHARPEN_SUPPORTED=y
-CONFIG_SOC_ISP_WBG_SUPPORTED=y
-CONFIG_SOC_ISP_SHARE_CSI_BRG=y
-CONFIG_SOC_ISP_NUMS=1
-CONFIG_SOC_ISP_DVP_CTLR_NUMS=1
-CONFIG_SOC_ISP_AE_CTLR_NUMS=1
-CONFIG_SOC_ISP_AE_BLOCK_X_NUMS=5
-CONFIG_SOC_ISP_AE_BLOCK_Y_NUMS=5
-CONFIG_SOC_ISP_AF_CTLR_NUMS=1
-CONFIG_SOC_ISP_AF_WINDOW_NUMS=3
-CONFIG_SOC_ISP_AWB_WINDOW_X_NUMS=5
-CONFIG_SOC_ISP_AWB_WINDOW_Y_NUMS=5
-CONFIG_SOC_ISP_BF_TEMPLATE_X_NUMS=3
-CONFIG_SOC_ISP_BF_TEMPLATE_Y_NUMS=3
-CONFIG_SOC_ISP_CCM_DIMENSION=3
-CONFIG_SOC_ISP_DEMOSAIC_GRAD_RATIO_INT_BITS=2
-CONFIG_SOC_ISP_DEMOSAIC_GRAD_RATIO_DEC_BITS=4
-CONFIG_SOC_ISP_DEMOSAIC_GRAD_RATIO_RES_BITS=26
-CONFIG_SOC_ISP_DVP_DATA_WIDTH_MAX=16
-CONFIG_SOC_ISP_SHARPEN_TEMPLATE_X_NUMS=3
-CONFIG_SOC_ISP_SHARPEN_TEMPLATE_Y_NUMS=3
-CONFIG_SOC_ISP_SHARPEN_H_FREQ_COEF_INT_BITS=3
-CONFIG_SOC_ISP_SHARPEN_H_FREQ_COEF_DEC_BITS=5
-CONFIG_SOC_ISP_SHARPEN_H_FREQ_COEF_RES_BITS=24
-CONFIG_SOC_ISP_SHARPEN_M_FREQ_COEF_INT_BITS=3
-CONFIG_SOC_ISP_SHARPEN_M_FREQ_COEF_DEC_BITS=5
-CONFIG_SOC_ISP_SHARPEN_M_FREQ_COEF_RES_BITS=24
-CONFIG_SOC_ISP_HIST_CTLR_NUMS=1
-CONFIG_SOC_ISP_HIST_BLOCK_X_NUMS=5
-CONFIG_SOC_ISP_HIST_BLOCK_Y_NUMS=5
-CONFIG_SOC_ISP_HIST_SEGMENT_NUMS=16
-CONFIG_SOC_ISP_HIST_INTERVAL_NUMS=15
-CONFIG_SOC_ISP_LSC_GRAD_RATIO_INT_BITS=2
-CONFIG_SOC_ISP_LSC_GRAD_RATIO_DEC_BITS=8
-CONFIG_SOC_ISP_LSC_GRAD_RATIO_RES_BITS=22
-CONFIG_SOC_LEDC_SUPPORT_PLL_DIV_CLOCK=y
-CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y
-CONFIG_SOC_LEDC_TIMER_NUM=4
-CONFIG_SOC_LEDC_CHANNEL_NUM=8
-CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20
-CONFIG_SOC_LEDC_GAMMA_CURVE_FADE_SUPPORTED=y
-CONFIG_SOC_LEDC_GAMMA_CURVE_FADE_RANGE_MAX=16
-CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y
-CONFIG_SOC_LEDC_FADE_PARAMS_BIT_WIDTH=10
-CONFIG_SOC_LEDC_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_MMU_PERIPH_NUM=2
-CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=2
-CONFIG_SOC_MMU_DI_VADDR_SHARED=y
-CONFIG_SOC_MMU_PER_EXT_MEM_TARGET=y
-CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000
-CONFIG_SOC_MPU_REGIONS_MAX_NUM=8
-CONFIG_SOC_PCNT_GROUPS=1
-CONFIG_SOC_PCNT_UNITS_PER_GROUP=4
-CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2
-CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2
-CONFIG_SOC_PCNT_SUPPORT_RUNTIME_THRES_UPDATE=y
-CONFIG_SOC_PCNT_SUPPORT_CLEAR_SIGNAL=y
-CONFIG_SOC_PCNT_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_RMT_GROUPS=1
-CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=4
-CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=4
-CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8
-CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48
-CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y
-CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y
-CONFIG_SOC_RMT_SUPPORT_ASYNC_STOP=y
-CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y
-CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y
-CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y
-CONFIG_SOC_RMT_SUPPORT_TX_CARRIER_DATA_ONLY=y
-CONFIG_SOC_RMT_SUPPORT_XTAL=y
-CONFIG_SOC_RMT_SUPPORT_RC_FAST=y
-CONFIG_SOC_RMT_SUPPORT_DMA=y
-CONFIG_SOC_RMT_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_LCD_I80_SUPPORTED=y
-CONFIG_SOC_LCD_RGB_SUPPORTED=y
-CONFIG_SOC_LCDCAM_I80_NUM_BUSES=1
-CONFIG_SOC_LCDCAM_I80_BUS_WIDTH=24
-CONFIG_SOC_LCDCAM_RGB_NUM_PANELS=1
-CONFIG_SOC_LCDCAM_RGB_DATA_WIDTH=24
-CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y
-CONFIG_SOC_MCPWM_GROUPS=2
-CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3
-CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3
-CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_EVENT_COMPARATORS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3
-CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y
-CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3
-CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3
-CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y
-CONFIG_SOC_MCPWM_SUPPORT_ETM=y
-CONFIG_SOC_MCPWM_SUPPORT_EVENT_COMPARATOR=y
-CONFIG_SOC_MCPWM_CAPTURE_CLK_FROM_GROUP=y
-CONFIG_SOC_MCPWM_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_USB_OTG_PERIPH_NUM=2
-CONFIG_SOC_USB_UTMI_PHY_NUM=1
-CONFIG_SOC_USB_UTMI_PHY_NO_POWER_OFF_ISO=y
-CONFIG_SOC_PARLIO_GROUPS=1
-CONFIG_SOC_PARLIO_TX_UNITS_PER_GROUP=1
-CONFIG_SOC_PARLIO_RX_UNITS_PER_GROUP=1
-CONFIG_SOC_PARLIO_TX_UNIT_MAX_DATA_WIDTH=16
-CONFIG_SOC_PARLIO_RX_UNIT_MAX_DATA_WIDTH=16
-CONFIG_SOC_PARLIO_TX_CLK_SUPPORT_GATING=y
-CONFIG_SOC_PARLIO_RX_CLK_SUPPORT_GATING=y
-CONFIG_SOC_PARLIO_RX_CLK_SUPPORT_OUTPUT=y
-CONFIG_SOC_PARLIO_TRANS_BIT_ALIGN=y
-CONFIG_SOC_PARLIO_TX_SUPPORT_LOOP_TRANSMISSION=y
-CONFIG_SOC_PARLIO_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_PARLIO_SUPPORT_SPI_LCD=y
-CONFIG_SOC_PARLIO_SUPPORT_I80_LCD=y
-CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4
-CONFIG_SOC_MPI_OPERATIONS_NUM=3
-CONFIG_SOC_RSA_MAX_BIT_LEN=4096
-CONFIG_SOC_SDMMC_USE_IOMUX=y
-CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y
-CONFIG_SOC_SDMMC_NUM_SLOTS=2
-CONFIG_SOC_SDMMC_DELAY_PHASE_NUM=4
-CONFIG_SOC_SDMMC_IO_POWER_EXTERNAL=y
-CONFIG_SOC_SDMMC_PSRAM_DMA_CAPABLE=y
-CONFIG_SOC_SDMMC_UHS_I_SUPPORTED=y
-CONFIG_SOC_SHA_DMA_MAX_BUFFER_SIZE=3968
-CONFIG_SOC_SHA_SUPPORT_DMA=y
-CONFIG_SOC_SHA_SUPPORT_RESUME=y
-CONFIG_SOC_SHA_GDMA=y
-CONFIG_SOC_SHA_SUPPORT_SHA1=y
-CONFIG_SOC_SHA_SUPPORT_SHA224=y
-CONFIG_SOC_SHA_SUPPORT_SHA256=y
-CONFIG_SOC_SHA_SUPPORT_SHA384=y
-CONFIG_SOC_SHA_SUPPORT_SHA512=y
-CONFIG_SOC_SHA_SUPPORT_SHA512_224=y
-CONFIG_SOC_SHA_SUPPORT_SHA512_256=y
-CONFIG_SOC_SHA_SUPPORT_SHA512_T=y
-CONFIG_SOC_ECC_CONSTANT_TIME_POINT_MUL=y
-CONFIG_SOC_ECC_SUPPORT_CURVE_P384=y
-CONFIG_SOC_ECDSA_SUPPORT_EXPORT_PUBKEY=y
-CONFIG_SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE=y
-CONFIG_SOC_ECDSA_USES_MPI=y
-CONFIG_SOC_SDM_GROUPS=1
-CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8
-CONFIG_SOC_SDM_CLK_SUPPORT_PLL_F80M=y
-CONFIG_SOC_SDM_CLK_SUPPORT_XTAL=y
-CONFIG_SOC_SPI_PERIPH_NUM=3
-CONFIG_SOC_SPI_MAX_CS_NUM=6
-CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64
-CONFIG_SOC_SPI_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y
-CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y
-CONFIG_SOC_SPI_SUPPORT_DDRCLK=y
-CONFIG_SOC_SPI_SUPPORT_CD_SIG=y
-CONFIG_SOC_SPI_SUPPORT_OCT=y
-CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y
-CONFIG_SOC_SPI_SUPPORT_CLK_RC_FAST=y
-CONFIG_SOC_SPI_SUPPORT_CLK_SPLL=y
-CONFIG_SOC_MSPI_HAS_INDEPENT_IOMUX=y
-CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y
-CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16
-CONFIG_SOC_LP_SPI_PERIPH_NUM=y
-CONFIG_SOC_LP_SPI_MAXIMUM_BUFFER_SIZE=64
-CONFIG_SOC_SPIRAM_XIP_SUPPORTED=y
-CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y
-CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y
-CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y
-CONFIG_SOC_SPI_MEM_SUPPORT_IDLE_INTR=y
-CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y
-CONFIG_SOC_SPI_MEM_SUPPORT_CHECK_SUS=y
-CONFIG_SOC_SPI_MEM_SUPPORT_TIMING_TUNING=y
-CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_DQS=y
-CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_FLASH_DELAY=y
-CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y
-CONFIG_SOC_SPI_MEM_PSRAM_FREQ_AXI_CONSTRAINED=y
-CONFIG_SOC_SPI_MEM_SUPPORT_TSUS_TRES_SEPERATE_CTR=y
-CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_FLASH_PSRAM_INDEPENDENT=y
-CONFIG_SOC_SYSTIMER_COUNTER_NUM=2
-CONFIG_SOC_SYSTIMER_ALARM_NUM=3
-CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32
-CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20
-CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y
-CONFIG_SOC_SYSTIMER_SUPPORT_RC_FAST=y
-CONFIG_SOC_SYSTIMER_INT_LEVEL=y
-CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y
-CONFIG_SOC_SYSTIMER_SUPPORT_ETM=y
-CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32
-CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16
-CONFIG_SOC_TIMER_GROUPS=2
-CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2
-CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54
-CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y
-CONFIG_SOC_TIMER_GROUP_SUPPORT_RC_FAST=y
-CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4
-CONFIG_SOC_TIMER_SUPPORT_ETM=y
-CONFIG_SOC_TIMER_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_MWDT_SUPPORT_XTAL=y
-CONFIG_SOC_MWDT_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_TOUCH_SENSOR_VERSION=3
-CONFIG_SOC_TOUCH_SENSOR_NUM=14
-CONFIG_SOC_TOUCH_MIN_CHAN_ID=1
-CONFIG_SOC_TOUCH_MAX_CHAN_ID=14
-CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y
-CONFIG_SOC_TOUCH_SUPPORT_BENCHMARK=y
-CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y
-CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y
-CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3
-CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y
-CONFIG_SOC_TOUCH_SUPPORT_FREQ_HOP=y
-CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=3
-CONFIG_SOC_TWAI_CONTROLLER_NUM=3
-CONFIG_SOC_TWAI_MASK_FILTER_NUM=1
-CONFIG_SOC_TWAI_CLK_SUPPORT_XTAL=y
-CONFIG_SOC_TWAI_BRP_MIN=2
-CONFIG_SOC_TWAI_BRP_MAX=32768
-CONFIG_SOC_TWAI_SUPPORTS_RX_STATUS=y
-CONFIG_SOC_TWAI_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_EFUSE_DIS_PAD_JTAG=y
-CONFIG_SOC_EFUSE_DIS_USB_JTAG=y
-CONFIG_SOC_EFUSE_DIS_DIRECT_BOOT=y
-CONFIG_SOC_EFUSE_SOFT_DIS_JTAG=y
-CONFIG_SOC_EFUSE_DIS_DOWNLOAD_MSPI=y
-CONFIG_SOC_EFUSE_ECDSA_KEY=y
-CONFIG_SOC_KEY_MANAGER_SUPPORT_KEY_DEPLOYMENT=y
-CONFIG_SOC_KEY_MANAGER_ECDSA_KEY_DEPLOY=y
-CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY=y
-CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY_XTS_AES_128=y
-CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY_XTS_AES_256=y
-CONFIG_SOC_SECURE_BOOT_V2_RSA=y
-CONFIG_SOC_SECURE_BOOT_V2_ECC=y
-CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3
-CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y
-CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y
-CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND=y
-CONFIG_SOC_UART_NUM=6
-CONFIG_SOC_UART_HP_NUM=5
-CONFIG_SOC_UART_LP_NUM=1
-CONFIG_SOC_UART_FIFO_LEN=128
-CONFIG_SOC_LP_UART_FIFO_LEN=16
-CONFIG_SOC_UART_BITRATE_MAX=5000000
-CONFIG_SOC_UART_SUPPORT_PLL_F80M_CLK=y
-CONFIG_SOC_UART_SUPPORT_RTC_CLK=y
-CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y
-CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y
-CONFIG_SOC_UART_HAS_LP_UART=y
-CONFIG_SOC_UART_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y
-CONFIG_SOC_UART_WAKEUP_CHARS_SEQ_MAX_LEN=5
-CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y
-CONFIG_SOC_UART_WAKEUP_SUPPORT_FIFO_THRESH_MODE=y
-CONFIG_SOC_UART_WAKEUP_SUPPORT_START_BIT_MODE=y
-CONFIG_SOC_UART_WAKEUP_SUPPORT_CHAR_SEQ_MODE=y
-CONFIG_SOC_LP_I2S_SUPPORT_VAD=y
-CONFIG_SOC_UHCI_NUM=1
-CONFIG_SOC_COEX_HW_PTI=y
-CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21
-CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12
-CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y
-CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN=y
-CONFIG_SOC_PM_EXT1_WAKEUP_BY_PMU=y
-CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y
-CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y
-CONFIG_SOC_PM_SUPPORT_CPU_PD=y
-CONFIG_SOC_PM_SUPPORT_XTAL32K_PD=y
-CONFIG_SOC_PM_SUPPORT_RC32K_PD=y
-CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y
-CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y
-CONFIG_SOC_PM_SUPPORT_TOP_PD=y
-CONFIG_SOC_PM_SUPPORT_CNNT_PD=y
-CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y
-CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y
-CONFIG_SOC_PM_CPU_RETENTION_BY_SW=y
-CONFIG_SOC_PM_CACHE_RETENTION_BY_PAU=y
-CONFIG_SOC_PM_PAU_LINK_NUM=4
-CONFIG_SOC_PM_PAU_REGDMA_LINK_MULTI_ADDR=y
-CONFIG_SOC_PAU_IN_TOP_DOMAIN=y
-CONFIG_SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE=y
-CONFIG_SOC_SLEEP_SYSTIMER_STALL_WORKAROUND=y
-CONFIG_SOC_SLEEP_TGWDT_STOP_WORKAROUND=y
-CONFIG_SOC_PM_RETENTION_MODULE_NUM=64
-CONFIG_SOC_PSRAM_VDD_POWER_MPLL=y
-CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y
-CONFIG_SOC_CLK_APLL_SUPPORTED=y
-CONFIG_SOC_CLK_MPLL_SUPPORTED=y
-CONFIG_SOC_CLK_SDIO_PLL_SUPPORTED=y
-CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y
-CONFIG_SOC_CLK_RC32K_SUPPORTED=y
-CONFIG_SOC_CLK_LP_FAST_SUPPORT_LP_PLL=y
-CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL=y
-CONFIG_SOC_PERIPH_CLK_CTRL_SHARED=y
-CONFIG_SOC_CLK_ANA_I2C_MST_HAS_ROOT_GATE=y
-CONFIG_SOC_TEMPERATURE_SENSOR_LP_PLL_SUPPORT=y
-CONFIG_SOC_TEMPERATURE_SENSOR_INTR_SUPPORT=y
-CONFIG_SOC_TSENS_IS_INDEPENDENT_FROM_ADC=y
-CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_ETM=y
-CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_MEM_TCM_SUPPORTED=y
-CONFIG_SOC_ASYNCHRONOUS_BUS_ERROR_MODE=y
-CONFIG_SOC_EMAC_IEEE1588V2_SUPPORTED=y
-CONFIG_SOC_EMAC_USE_MULTI_IO_MUX=y
-CONFIG_SOC_EMAC_MII_USE_GPIO_MATRIX=y
-CONFIG_SOC_JPEG_CODEC_SUPPORTED=y
-CONFIG_SOC_JPEG_DECODE_SUPPORTED=y
-CONFIG_SOC_JPEG_ENCODE_SUPPORTED=y
-CONFIG_SOC_LCDCAM_CAM_SUPPORT_RGB_YUV_CONV=y
-CONFIG_SOC_LCDCAM_CAM_PERIPH_NUM=1
-CONFIG_SOC_LCDCAM_CAM_DATA_WIDTH_MAX=16
-CONFIG_SOC_I3C_MASTER_PERIPH_NUM=y
-CONFIG_SOC_I3C_MASTER_ADDRESS_TABLE_NUM=12
-CONFIG_SOC_I3C_MASTER_COMMAND_TABLE_NUM=12
-CONFIG_SOC_LP_CORE_SUPPORT_ETM=y
-CONFIG_SOC_LP_CORE_SUPPORT_LP_ADC=y
-CONFIG_SOC_LP_CORE_SUPPORT_LP_VAD=y
-CONFIG_SOC_LP_CORE_SUPPORT_STORE_LOAD_EXCEPTIONS=y
-CONFIG_IDF_CMAKE=y
-CONFIG_IDF_TOOLCHAIN="gcc"
-CONFIG_IDF_TOOLCHAIN_GCC=y
-CONFIG_IDF_TARGET_ARCH_RISCV=y
-CONFIG_IDF_TARGET_ARCH="riscv"
-CONFIG_IDF_TARGET="esp32p4"
-CONFIG_IDF_INIT_VERSION="5.5.1"
-CONFIG_IDF_TARGET_ESP32P4=y
-CONFIG_IDF_FIRMWARE_CHIP_ID=0x0012
-
-#
-# Build type
-#
-CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y
-# CONFIG_APP_BUILD_TYPE_RAM is not set
-CONFIG_APP_BUILD_GENERATE_BINARIES=y
-CONFIG_APP_BUILD_BOOTLOADER=y
-CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y
-# CONFIG_APP_REPRODUCIBLE_BUILD is not set
-# CONFIG_APP_NO_BLOBS is not set
-# end of Build type
-
-#
-# Bootloader config
-#
-
-#
-# Bootloader manager
-#
-CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y
-CONFIG_BOOTLOADER_PROJECT_VER=1
-# end of Bootloader manager
-
-#
-# Application Rollback
-#
-CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
-# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set
-# end of Application Rollback
-
-#
-# Recovery Bootloader and Rollback
-#
-# end of Recovery Bootloader and Rollback
-
-CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x2000
-CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
-# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set
-# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set
-
-#
-# Log
-#
-CONFIG_BOOTLOADER_LOG_VERSION_1=y
-CONFIG_BOOTLOADER_LOG_VERSION=1
-# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
-# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
-# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
-CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
-# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
-# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
-CONFIG_BOOTLOADER_LOG_LEVEL=3
-
-#
-# Format
-#
-# CONFIG_BOOTLOADER_LOG_COLORS is not set
-CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y
-# end of Format
-
-#
-# Settings
-#
-CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y
-CONFIG_BOOTLOADER_LOG_MODE_TEXT=y
-# end of Settings
-# end of Log
-
-#
-# Serial Flash Configurations
-#
-# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set
-CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
-CONFIG_BOOTLOADER_FLASH_32BIT_ADDR=y
-CONFIG_BOOTLOADER_FLASH_NEEDS_32BIT_FEAT=y
-CONFIG_BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH=y
-# end of Serial Flash Configurations
-
-# CONFIG_BOOTLOADER_FACTORY_RESET is not set
-# CONFIG_BOOTLOADER_APP_TEST is not set
-CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y
-CONFIG_BOOTLOADER_WDT_ENABLE=y
-# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set
-CONFIG_BOOTLOADER_WDT_TIME_MS=9000
-# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set
-# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set
-# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set
-CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0
-# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set
-# end of Bootloader config
-
-#
-# Security features
-#
-CONFIG_SECURE_BOOT_V2_RSA_SUPPORTED=y
-CONFIG_SECURE_BOOT_V2_ECC_SUPPORTED=y
-CONFIG_SECURE_BOOT_V2_PREFERRED=y
-# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set
-# CONFIG_SECURE_BOOT is not set
-# CONFIG_SECURE_FLASH_ENC_ENABLED is not set
-CONFIG_SECURE_ROM_DL_MODE_ENABLED=y
-# end of Security features
-
-#
-# Application manager
-#
-CONFIG_APP_COMPILE_TIME_DATE=y
-# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
-# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
-# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set
-CONFIG_APP_RETRIEVE_LEN_ELF_SHA=9
-# end of Application manager
-
-CONFIG_ESP_ROM_HAS_CRC_LE=y
-CONFIG_ESP_ROM_HAS_CRC_BE=y
-CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y
-CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=6
-CONFIG_ESP_ROM_USB_OTG_NUM=5
-CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y
-CONFIG_ESP_ROM_GET_CLK_FREQ=y
-CONFIG_ESP_ROM_HAS_RVFPLIB=y
-CONFIG_ESP_ROM_HAS_HAL_WDT=y
-CONFIG_ESP_ROM_HAS_HAL_SYSTIMER=y
-CONFIG_ESP_ROM_SYSTIMER_INIT_PATCH=y
-CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y
-CONFIG_ESP_ROM_WDT_INIT_PATCH=y
-CONFIG_ESP_ROM_HAS_LP_ROM=y
-CONFIG_ESP_ROM_WITHOUT_REGI2C=y
-CONFIG_ESP_ROM_HAS_NEWLIB=y
-CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y
-CONFIG_ESP_ROM_HAS_NEWLIB_NANO_PRINTF_FLOAT_BUG=y
-CONFIG_ESP_ROM_HAS_VERSION=y
-CONFIG_ESP_ROM_CLIC_INT_TYPE_PATCH=y
-CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y
-CONFIG_ESP_ROM_HAS_SUBOPTIMAL_NEWLIB_ON_MISALIGNED_MEMORY=y
-
-#
-# Boot ROM Behavior
-#
-CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y
-# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set
-# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set
-# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set
-# end of Boot ROM Behavior
-
-#
-# Serial flasher config
-#
-# CONFIG_ESPTOOLPY_NO_STUB is not set
-# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set
-# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
-CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
-# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
-CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y
-CONFIG_ESPTOOLPY_FLASHMODE="dio"
-CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
-# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
-# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
-CONFIG_ESPTOOLPY_FLASHFREQ_VAL=80
-CONFIG_ESPTOOLPY_FLASHFREQ="80m"
-# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
-# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE="32MB"
-# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
-CONFIG_ESPTOOLPY_BEFORE_RESET=y
-# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
-CONFIG_ESPTOOLPY_BEFORE="default_reset"
-CONFIG_ESPTOOLPY_AFTER_RESET=y
-# CONFIG_ESPTOOLPY_AFTER_NORESET is not set
-CONFIG_ESPTOOLPY_AFTER="hard_reset"
-CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
-# end of Serial flasher config
-
-#
-# Partition Table
-#
-# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
-# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
-# CONFIG_PARTITION_TABLE_TWO_OTA is not set
-# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set
-CONFIG_PARTITION_TABLE_CUSTOM=y
-CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_OFFSET=0x8000
-CONFIG_PARTITION_TABLE_MD5=y
-# end of Partition Table
-
-#
-# Compiler options
-#
-CONFIG_COMPILER_OPTIMIZATION_DEBUG=y
-# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
-# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
-# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
-CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
-# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
-# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
-CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y
-# CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB is not set
-CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB=y
-CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
-# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set
-CONFIG_COMPILER_HIDE_PATHS_MACROS=y
-# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
-# CONFIG_COMPILER_CXX_RTTI is not set
-CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
-# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set
-# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
-# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
-# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set
-# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
-# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set
-CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y
-# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set
-# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set
-# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set
-# CONFIG_COMPILER_DUMP_RTL_FILES is not set
-CONFIG_COMPILER_RT_LIB_GCCLIB=y
-CONFIG_COMPILER_RT_LIB_NAME="gcc"
-CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y
-# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set
-# CONFIG_COMPILER_STATIC_ANALYZER is not set
-# end of Compiler options
-
-#
-# Component config
-#
-
-#
-# Application Level Tracing
-#
-# CONFIG_APPTRACE_DEST_JTAG is not set
-CONFIG_APPTRACE_DEST_NONE=y
-# CONFIG_APPTRACE_DEST_UART1 is not set
-# CONFIG_APPTRACE_DEST_UART2 is not set
-CONFIG_APPTRACE_DEST_UART_NONE=y
-CONFIG_APPTRACE_UART_TASK_PRIO=1
-CONFIG_APPTRACE_LOCK_ENABLE=y
-# end of Application Level Tracing
-
-#
-# Bluetooth
-#
-# CONFIG_BT_ENABLED is not set
-
-#
-# Common Options
-#
-
-#
-# BLE Log
-#
-# CONFIG_BLE_LOG_ENABLED is not set
-# end of BLE Log
-
-# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set
-# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set
-# CONFIG_BT_LE_USED_MEM_STATISTICS_ENABLED is not set
-# end of Common Options
-# end of Bluetooth
-
-#
-# Console Library
-#
-# CONFIG_CONSOLE_SORTED_HELP is not set
-# end of Console Library
-
-#
-# Driver Configurations
-#
-
-#
-# Legacy TWAI Driver Configurations
-#
-# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy TWAI Driver Configurations
-
-#
-# Legacy ADC Driver Configuration
-#
-# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set
-
-#
-# Legacy ADC Calibration Configuration
-#
-# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set
-# end of Legacy ADC Calibration Configuration
-# end of Legacy ADC Driver Configuration
-
-#
-# Legacy MCPWM Driver Configurations
-#
-# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy MCPWM Driver Configurations
-
-#
-# Legacy Timer Group Driver Configurations
-#
-# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy Timer Group Driver Configurations
-
-#
-# Legacy RMT Driver Configurations
-#
-# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy RMT Driver Configurations
-
-#
-# Legacy I2S Driver Configurations
-#
-# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy I2S Driver Configurations
-
-#
-# Legacy I2C Driver Configurations
-#
-# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy I2C Driver Configurations
-
-#
-# Legacy PCNT Driver Configurations
-#
-# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy PCNT Driver Configurations
-
-#
-# Legacy SDM Driver Configurations
-#
-# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy SDM Driver Configurations
-
-#
-# Legacy Temperature Sensor Driver Configurations
-#
-# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy Temperature Sensor Driver Configurations
-
-#
-# Legacy Touch Sensor Driver Configurations
-#
-# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy Touch Sensor Driver Configurations
-# end of Driver Configurations
-
-#
-# eFuse Bit Manager
-#
-# CONFIG_EFUSE_CUSTOM_TABLE is not set
-# CONFIG_EFUSE_VIRTUAL is not set
-CONFIG_EFUSE_MAX_BLK_LEN=256
-# end of eFuse Bit Manager
-
-#
-# ESP-TLS
-#
-CONFIG_ESP_TLS_USING_MBEDTLS=y
-# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set
-CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
-# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set
-# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set
-# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set
-# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set
-# CONFIG_ESP_TLS_PSK_VERIFICATION is not set
-# CONFIG_ESP_TLS_INSECURE is not set
-CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y
-# end of ESP-TLS
-
-#
-# ADC and ADC Calibration
-#
-# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set
-# CONFIG_ADC_ENABLE_DEBUG_LOG is not set
-# end of ADC and ADC Calibration
-
-#
-# Wireless Coexistence
-#
-# CONFIG_ESP_COEX_GPIO_DEBUG is not set
-# end of Wireless Coexistence
-
-#
-# Common ESP-related
-#
-CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
-# end of Common ESP-related
-
-#
-# ESP-Driver:Analog Comparator Configurations
-#
-CONFIG_ANA_CMPR_ISR_HANDLER_IN_IRAM=y
-# CONFIG_ANA_CMPR_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_ANA_CMPR_ISR_CACHE_SAFE is not set
-CONFIG_ANA_CMPR_OBJ_CACHE_SAFE=y
-# CONFIG_ANA_CMPR_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:Analog Comparator Configurations
-
-#
-# ESP-Driver:BitScrambler Configurations
-#
-# CONFIG_BITSCRAMBLER_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:BitScrambler Configurations
-
-#
-# ESP-Driver:Camera Controller Configurations
-#
-# CONFIG_CAM_CTLR_MIPI_CSI_ISR_CACHE_SAFE is not set
-# CONFIG_CAM_CTLR_ISP_DVP_ISR_CACHE_SAFE is not set
-# CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE is not set
-# end of ESP-Driver:Camera Controller Configurations
-
-#
-# ESP-Driver:GPIO Configurations
-#
-# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:GPIO Configurations
-
-#
-# ESP-Driver:GPTimer Configurations
-#
-CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
-# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set
-CONFIG_GPTIMER_OBJ_CACHE_SAFE=y
-# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:GPTimer Configurations
-
-#
-# ESP-Driver:I2C Configurations
-#
-# CONFIG_I2C_ISR_IRAM_SAFE is not set
-# CONFIG_I2C_ENABLE_DEBUG_LOG is not set
-# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set
-CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y
-# end of ESP-Driver:I2C Configurations
-
-#
-# ESP-Driver:I2S Configurations
-#
-# CONFIG_I2S_ISR_IRAM_SAFE is not set
-# CONFIG_I2S_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:I2S Configurations
-
-#
-# ESP-Driver:ISP Configurations
-#
-# CONFIG_ISP_ISR_IRAM_SAFE is not set
-# CONFIG_ISP_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:ISP Configurations
-
-#
-# ESP-Driver:JPEG-Codec Configurations
-#
-# CONFIG_JPEG_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:JPEG-Codec Configurations
-
-#
-# ESP-Driver:LEDC Configurations
-#
-# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:LEDC Configurations
-
-#
-# ESP-Driver:MCPWM Configurations
-#
-CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y
-# CONFIG_MCPWM_ISR_CACHE_SAFE is not set
-# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set
-CONFIG_MCPWM_OBJ_CACHE_SAFE=y
-# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:MCPWM Configurations
-
-#
-# ESP-Driver:Parallel IO Configurations
-#
-CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=y
-CONFIG_PARLIO_RX_ISR_HANDLER_IN_IRAM=y
-# CONFIG_PARLIO_TX_ISR_CACHE_SAFE is not set
-# CONFIG_PARLIO_RX_ISR_CACHE_SAFE is not set
-CONFIG_PARLIO_OBJ_CACHE_SAFE=y
-# CONFIG_PARLIO_ENABLE_DEBUG_LOG is not set
-# CONFIG_PARLIO_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:Parallel IO Configurations
-
-#
-# ESP-Driver:PCNT Configurations
-#
-# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_PCNT_ISR_IRAM_SAFE is not set
-# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:PCNT Configurations
-
-#
-# ESP-Driver:RMT Configurations
-#
-CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y
-CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y
-CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y
-# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set
-# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set
-# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set
-CONFIG_RMT_OBJ_CACHE_SAFE=y
-# CONFIG_RMT_ENABLE_DEBUG_LOG is not set
-# CONFIG_RMT_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:RMT Configurations
-
-#
-# ESP-Driver:Sigma Delta Modulator Configurations
-#
-# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_SDM_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:Sigma Delta Modulator Configurations
-
-#
-# ESP-Driver:SPI Configurations
-#
-# CONFIG_SPI_MASTER_IN_IRAM is not set
-CONFIG_SPI_MASTER_ISR_IN_IRAM=y
-# CONFIG_SPI_SLAVE_IN_IRAM is not set
-CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
-# end of ESP-Driver:SPI Configurations
-
-#
-# ESP-Driver:Touch Sensor Configurations
-#
-# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_TOUCH_ISR_IRAM_SAFE is not set
-# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set
-# CONFIG_TOUCH_SKIP_FSM_CHECK is not set
-# end of ESP-Driver:Touch Sensor Configurations
-
-#
-# ESP-Driver:Temperature Sensor Configurations
-#
-# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set
-# CONFIG_TEMP_SENSOR_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:Temperature Sensor Configurations
-
-#
-# ESP-Driver:TWAI Configurations
-#
-# CONFIG_TWAI_ISR_IN_IRAM is not set
-# CONFIG_TWAI_IO_FUNC_IN_IRAM is not set
-# CONFIG_TWAI_ISR_CACHE_SAFE is not set
-# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:TWAI Configurations
-
-#
-# ESP-Driver:UART Configurations
-#
-# CONFIG_UART_ISR_IN_IRAM is not set
-# end of ESP-Driver:UART Configurations
-
-#
-# ESP-Driver:UHCI Configurations
-#
-# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set
-# CONFIG_UHCI_ISR_CACHE_SAFE is not set
-# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:UHCI Configurations
-
-#
-# ESP-Driver:USB Serial/JTAG Configuration
-#
-CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y
-# end of ESP-Driver:USB Serial/JTAG Configuration
-
-#
-# Ethernet
-#
-CONFIG_ETH_ENABLED=y
-CONFIG_ETH_USE_ESP32_EMAC=y
-CONFIG_ETH_PHY_INTERFACE_RMII=y
-CONFIG_ETH_DMA_BUFFER_SIZE=512
-CONFIG_ETH_DMA_RX_BUFFER_NUM=20
-CONFIG_ETH_DMA_TX_BUFFER_NUM=10
-# CONFIG_ETH_SOFT_FLOW_CONTROL is not set
-# CONFIG_ETH_IRAM_OPTIMIZATION is not set
-CONFIG_ETH_USE_SPI_ETHERNET=y
-# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set
-# CONFIG_ETH_SPI_ETHERNET_W5500 is not set
-# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set
-# CONFIG_ETH_USE_OPENETH is not set
-# CONFIG_ETH_TRANSMIT_MUTEX is not set
-# end of Ethernet
-
-#
-# Event Loop Library
-#
-# CONFIG_ESP_EVENT_LOOP_PROFILING is not set
-CONFIG_ESP_EVENT_POST_FROM_ISR=y
-CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y
-# end of Event Loop Library
-
-#
-# GDB Stub
-#
-CONFIG_ESP_GDBSTUB_ENABLED=y
-# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set
-CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y
-CONFIG_ESP_GDBSTUB_MAX_TASKS=32
-# end of GDB Stub
-
-#
-# ESP HID
-#
-CONFIG_ESPHID_TASK_SIZE_BT=2048
-CONFIG_ESPHID_TASK_SIZE_BLE=4096
-# end of ESP HID
-
-#
-# ESP HTTP client
-#
-CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
-# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
-# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set
-# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set
-CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000
-# end of ESP HTTP client
-
-#
-# HTTP Server
-#
-CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
-CONFIG_HTTPD_MAX_URI_LEN=512
-CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
-CONFIG_HTTPD_PURGE_BUF_LEN=32
-# CONFIG_HTTPD_LOG_PURGE_DATA is not set
-# CONFIG_HTTPD_WS_SUPPORT is not set
-# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set
-CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000
-# end of HTTP Server
-
-#
-# ESP HTTPS OTA
-#
-# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set
-# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set
-CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000
-# end of ESP HTTPS OTA
-
-#
-# ESP HTTPS server
-#
-# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set
-CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000
-# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set
-# end of ESP HTTPS server
-
-#
-# Hardware Settings
-#
-CONFIG_ESP_HW_SUPPORT_FUNC_IN_IRAM=y
-
-#
-# Chip revision
-#
-
-#
-# NOTE! Support of ESP32-P4 rev. <3.0 and >=3.0 is mutually exclusive
-#
-
-#
-# Read the help text of the option below for explanation
-#
-# CONFIG_ESP32P4_SELECTS_REV_LESS_V3 is not set
-# CONFIG_ESP32P4_REV_MIN_300 is not set
-CONFIG_ESP32P4_REV_MIN_301=y
-CONFIG_ESP32P4_REV_MIN_FULL=301
-CONFIG_ESP_REV_MIN_FULL=301
-
-#
-# Maximum Supported ESP32-P4 Revision (Rev v3.99)
-#
-CONFIG_ESP32P4_REV_MAX_FULL=399
-CONFIG_ESP_REV_MAX_FULL=399
-CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0
-CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=199
-
-#
-# Maximum Supported ESP32-P4 eFuse Block Revision (eFuse Block Rev v0.99)
-#
-# end of Chip revision
-
-#
-# MAC Config
-#
-CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y
-CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_ONE=y
-CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=1
-CONFIG_ESP32P4_UNIVERSAL_MAC_ADDRESSES_ONE=y
-CONFIG_ESP32P4_UNIVERSAL_MAC_ADDRESSES=1
-# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set
-# end of MAC Config
-
-#
-# Sleep Config
-#
-# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set
-CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y
-# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set
-# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set
-CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=0
-# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set
-# CONFIG_ESP_SLEEP_DEBUG is not set
-CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y
-# end of Sleep Config
-
-#
-# RTC Clock Config
-#
-CONFIG_RTC_CLK_SRC_INT_RC=y
-# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set
-CONFIG_RTC_CLK_CAL_CYCLES=1024
-CONFIG_RTC_FAST_CLK_SRC_RC_FAST=y
-# CONFIG_RTC_FAST_CLK_SRC_XTAL is not set
-CONFIG_RTC_CLK_FUNC_IN_IRAM=y
-CONFIG_RTC_TIME_FUNC_IN_IRAM=y
-# end of RTC Clock Config
-
-#
-# Peripheral Control
-#
-CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y
-CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y
-# end of Peripheral Control
-
-#
-# ETM Configuration
-#
-# CONFIG_ETM_ENABLE_DEBUG_LOG is not set
-# end of ETM Configuration
-
-#
-# GDMA Configurations
-#
-CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y
-CONFIG_GDMA_ISR_HANDLER_IN_IRAM=y
-CONFIG_GDMA_OBJ_DRAM_SAFE=y
-# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set
-# CONFIG_GDMA_ISR_IRAM_SAFE is not set
-# end of GDMA Configurations
-
-#
-# DW_GDMA Configurations
-#
-# CONFIG_DW_GDMA_ENABLE_DEBUG_LOG is not set
-# end of DW_GDMA Configurations
-
-#
-# 2D-DMA Configurations
-#
-# CONFIG_DMA2D_OPERATION_FUNC_IN_IRAM is not set
-# CONFIG_DMA2D_ISR_IRAM_SAFE is not set
-# end of 2D-DMA Configurations
-
-#
-# Main XTAL Config
-#
-CONFIG_XTAL_FREQ_40=y
-CONFIG_XTAL_FREQ=40
-# end of Main XTAL Config
-
-#
-# DCDC Regulator Configurations
-#
-CONFIG_ESP_SLEEP_DCM_VSET_VAL_IN_SLEEP=14
-# end of DCDC Regulator Configurations
-
-#
-# LDO Regulator Configurations
-#
-CONFIG_ESP_LDO_RESERVE_SPI_NOR_FLASH=y
-CONFIG_ESP_LDO_CHAN_SPI_NOR_FLASH_DOMAIN=1
-CONFIG_ESP_LDO_VOLTAGE_SPI_NOR_FLASH_3300_MV=y
-CONFIG_ESP_LDO_VOLTAGE_SPI_NOR_FLASH_DOMAIN=3300
-CONFIG_ESP_LDO_RESERVE_PSRAM=y
-CONFIG_ESP_LDO_CHAN_PSRAM_DOMAIN=2
-CONFIG_ESP_LDO_VOLTAGE_PSRAM_1800_MV=y
-CONFIG_ESP_LDO_VOLTAGE_PSRAM_DOMAIN=1800
-# end of LDO Regulator Configurations
-
-#
-# Power Supplier
-#
-
-#
-# Brownout Detector
-#
-CONFIG_ESP_BROWNOUT_DET=y
-CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y
-# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set
-# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set
-CONFIG_ESP_BROWNOUT_DET_LVL=7
-CONFIG_ESP_BROWNOUT_USE_INTR=y
-# end of Brownout Detector
-
-#
-# RTC Backup Battery
-#
-# CONFIG_ESP_VBAT_INIT_AUTO is not set
-# CONFIG_ESP_VBAT_WAKEUP_CHIP_ON_VBAT_BROWNOUT is not set
-# end of RTC Backup Battery
-# end of Power Supplier
-
-CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y
-CONFIG_ESP_ENABLE_PVT=y
-CONFIG_ESP_INTR_IN_IRAM=y
-CONFIG_P4_REV3_MSPI_WORKAROUND_SIZE=0
-# end of Hardware Settings
-
-#
-# ESP-Driver:LCD Controller Configurations
-#
-# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set
-# CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set
-CONFIG_LCD_DSI_ISR_HANDLER_IN_IRAM=y
-# CONFIG_LCD_DSI_ISR_CACHE_SAFE is not set
-CONFIG_LCD_DSI_OBJ_FORCE_INTERNAL=y
-# CONFIG_LCD_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:LCD Controller Configurations
-
-#
-# ESP-MM: Memory Management Configurations
-#
-# CONFIG_ESP_MM_CACHE_MSYNC_C2M_CHUNKED_OPS is not set
-# end of ESP-MM: Memory Management Configurations
-
-#
-# ESP NETIF Adapter
-#
-CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120
-# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set
-CONFIG_ESP_NETIF_TCPIP_LWIP=y
-# CONFIG_ESP_NETIF_LOOPBACK is not set
-CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y
-CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y
-# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set
-# CONFIG_ESP_NETIF_L2_TAP is not set
-# CONFIG_ESP_NETIF_BRIDGE_EN is not set
-# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set
-# end of ESP NETIF Adapter
-
-#
-# Partition API Configuration
-#
-# end of Partition API Configuration
-
-#
-# PHY
-#
-# end of PHY
-
-#
-# Power Management
-#
-CONFIG_PM_SLEEP_FUNC_IN_IRAM=y
-# CONFIG_PM_ENABLE is not set
-CONFIG_PM_SLP_IRAM_OPT=y
-CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
-# CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP is not set
-# end of Power Management
-
-#
-# ESP PSRAM
-#
-# CONFIG_SPIRAM is not set
-# end of ESP PSRAM
-
-#
-# ESP Ringbuf
-#
-# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set
-# end of ESP Ringbuf
-
-#
-# ESP-ROM
-#
-CONFIG_ESP_ROM_PRINT_IN_IRAM=y
-# end of ESP-ROM
-
-#
-# ESP Security Specific
-#
-# CONFIG_ESP_CRYPTO_FORCE_ECC_CONSTANT_TIME_POINT_MUL is not set
-# end of ESP Security Specific
-
-#
-# ESP System Settings
-#
-CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_400=y
-CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=400
-
-#
-# Cache config
-#
-CONFIG_CACHE_L2_CACHE_128KB=y
-# CONFIG_CACHE_L2_CACHE_256KB is not set
-# CONFIG_CACHE_L2_CACHE_512KB is not set
-CONFIG_CACHE_L2_CACHE_SIZE=0x20000
-CONFIG_CACHE_L2_CACHE_LINE_64B=y
-# CONFIG_CACHE_L2_CACHE_LINE_128B is not set
-CONFIG_CACHE_L2_CACHE_LINE_SIZE=64
-CONFIG_CACHE_L1_CACHE_LINE_SIZE=64
-# end of Cache config
-
-CONFIG_ESP_SYSTEM_IN_IRAM=y
-# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set
-CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
-# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
-# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set
-CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0
-CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y
-CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y
-CONFIG_ESP_SYSTEM_NO_BACKTRACE=y
-# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set
-# CONFIG_ESP_SYSTEM_USE_FRAME_POINTER is not set
-
-#
-# Memory protection
-#
-CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=y
-# CONFIG_ESP_SYSTEM_PMP_LP_CORE_RESERVE_MEM_EXECUTABLE is not set
-# end of Memory protection
-
-CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32
-CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304
-CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
-CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y
-# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set
-# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set
-CONFIG_ESP_MAIN_TASK_AFFINITY=0x0
-CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048
-CONFIG_ESP_CONSOLE_UART_DEFAULT=y
-# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set
-# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
-# CONFIG_ESP_CONSOLE_NONE is not set
-# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set
-CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
-CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
-CONFIG_ESP_CONSOLE_UART=y
-CONFIG_ESP_CONSOLE_UART_NUM=0
-CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0
-CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
-CONFIG_ESP_INT_WDT=y
-CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
-CONFIG_ESP_INT_WDT_CHECK_CPU1=y
-CONFIG_ESP_TASK_WDT_EN=y
-CONFIG_ESP_TASK_WDT_INIT=y
-# CONFIG_ESP_TASK_WDT_PANIC is not set
-CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
-CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
-CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
-# CONFIG_ESP_PANIC_HANDLER_IRAM is not set
-# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set
-CONFIG_ESP_DEBUG_OCDAWARE=y
-CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y
-CONFIG_ESP_SYSTEM_HW_STACK_GUARD=y
-CONFIG_ESP_SYSTEM_HW_PC_RECORD=y
-# end of ESP System Settings
-
-#
-# IPC (Inter-Processor Call)
-#
-CONFIG_ESP_IPC_ENABLE=y
-CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
-CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y
-CONFIG_ESP_IPC_ISR_ENABLE=y
-# end of IPC (Inter-Processor Call)
-
-#
-# ESP Timer (High Resolution Timer)
-#
-CONFIG_ESP_TIMER_IN_IRAM=y
-# CONFIG_ESP_TIMER_PROFILING is not set
-CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y
-CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y
-CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584
-CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1
-# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set
-CONFIG_ESP_TIMER_TASK_AFFINITY=0x0
-CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y
-CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y
-# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set
-CONFIG_ESP_TIMER_IMPL_SYSTIMER=y
-# end of ESP Timer (High Resolution Timer)
-
-#
-# Wi-Fi
-#
-# CONFIG_ESP_HOST_WIFI_ENABLED is not set
-# end of Wi-Fi
-
-#
-# Core dump
-#
-# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set
-# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set
-CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y
-# end of Core dump
-
-#
-# FAT Filesystem support
-#
-CONFIG_FATFS_VOLUME_COUNT=2
-# CONFIG_FATFS_LFN_NONE is not set
-CONFIG_FATFS_LFN_HEAP=y
-# CONFIG_FATFS_LFN_STACK is not set
-# CONFIG_FATFS_SECTOR_512 is not set
-CONFIG_FATFS_SECTOR_4096=y
-# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set
-CONFIG_FATFS_CODEPAGE_437=y
-# CONFIG_FATFS_CODEPAGE_720 is not set
-# CONFIG_FATFS_CODEPAGE_737 is not set
-# CONFIG_FATFS_CODEPAGE_771 is not set
-# CONFIG_FATFS_CODEPAGE_775 is not set
-# CONFIG_FATFS_CODEPAGE_850 is not set
-# CONFIG_FATFS_CODEPAGE_852 is not set
-# CONFIG_FATFS_CODEPAGE_855 is not set
-# CONFIG_FATFS_CODEPAGE_857 is not set
-# CONFIG_FATFS_CODEPAGE_860 is not set
-# CONFIG_FATFS_CODEPAGE_861 is not set
-# CONFIG_FATFS_CODEPAGE_862 is not set
-# CONFIG_FATFS_CODEPAGE_863 is not set
-# CONFIG_FATFS_CODEPAGE_864 is not set
-# CONFIG_FATFS_CODEPAGE_865 is not set
-# CONFIG_FATFS_CODEPAGE_866 is not set
-# CONFIG_FATFS_CODEPAGE_869 is not set
-# CONFIG_FATFS_CODEPAGE_932 is not set
-# CONFIG_FATFS_CODEPAGE_936 is not set
-# CONFIG_FATFS_CODEPAGE_949 is not set
-# CONFIG_FATFS_CODEPAGE_950 is not set
-CONFIG_FATFS_CODEPAGE=437
-CONFIG_FATFS_MAX_LFN=255
-CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
-# CONFIG_FATFS_API_ENCODING_UTF_8 is not set
-CONFIG_FATFS_FS_LOCK=0
-CONFIG_FATFS_TIMEOUT_MS=10000
-CONFIG_FATFS_PER_FILE_CACHE=y
-# CONFIG_FATFS_USE_FASTSEEK is not set
-CONFIG_FATFS_USE_STRFUNC_NONE=y
-# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set
-# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set
-CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0
-# CONFIG_FATFS_IMMEDIATE_FSYNC is not set
-# CONFIG_FATFS_USE_LABEL is not set
-CONFIG_FATFS_LINK_LOCK=y
-# CONFIG_FATFS_USE_DYN_BUFFERS is not set
-
-#
-# File system free space calculation behavior
-#
-CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0
-CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0
-# end of File system free space calculation behavior
-# end of FAT Filesystem support
-
-#
-# FreeRTOS
-#
-
-#
-# Kernel
-#
-# CONFIG_FREERTOS_UNICORE is not set
-CONFIG_FREERTOS_HZ=100
-# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set
-# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
-CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
-CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
-CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
-# CONFIG_FREERTOS_USE_IDLE_HOOK is not set
-# CONFIG_FREERTOS_USE_TICK_HOOK is not set
-CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
-# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set
-CONFIG_FREERTOS_USE_TIMERS=y
-CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc"
-# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set
-# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set
-CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y
-CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF
-CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1
-CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048
-CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10
-CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
-CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
-CONFIG_FREERTOS_USE_TRACE_FACILITY=y
-CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
-# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set
-# CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID is not set
-# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set
-# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set
-# end of Kernel
-
-#
-# Port
-#
-CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
-# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
-CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y
-# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set
-# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set
-CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y
-CONFIG_FREERTOS_ISR_STACKSIZE=1536
-CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y
-CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y
-CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y
-# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set
-CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y
-# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set
-# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set
-# end of Port
-
-#
-# Extra
-#
-# end of Extra
-
-CONFIG_FREERTOS_PORT=y
-CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF
-CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
-CONFIG_FREERTOS_DEBUG_OCDAWARE=y
-CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y
-CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
-CONFIG_FREERTOS_NUMBER_OF_CORES=2
-CONFIG_FREERTOS_IN_IRAM=y
-# end of FreeRTOS
-
-#
-# Hardware Abstraction Layer (HAL) and Low Level (LL)
-#
-CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y
-# CONFIG_HAL_ASSERTION_DISABLE is not set
-# CONFIG_HAL_ASSERTION_SILENT is not set
-# CONFIG_HAL_ASSERTION_ENABLE is not set
-CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2
-CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=y
-CONFIG_HAL_WDT_USE_ROM_IMPL=y
-# end of Hardware Abstraction Layer (HAL) and Low Level (LL)
-
-#
-# Heap memory debugging
-#
-CONFIG_HEAP_POISONING_DISABLED=y
-# CONFIG_HEAP_POISONING_LIGHT is not set
-# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set
-CONFIG_HEAP_TRACING_OFF=y
-# CONFIG_HEAP_TRACING_STANDALONE is not set
-# CONFIG_HEAP_TRACING_TOHOST is not set
-# CONFIG_HEAP_USE_HOOKS is not set
-# CONFIG_HEAP_TASK_TRACKING is not set
-# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set
-# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set
-# end of Heap memory debugging
-
-#
-# Log
-#
-CONFIG_LOG_VERSION_1=y
-# CONFIG_LOG_VERSION_2 is not set
-CONFIG_LOG_VERSION=1
-
-#
-# Log Level
-#
-# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
-# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
-# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
-CONFIG_LOG_DEFAULT_LEVEL_INFO=y
-# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
-# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
-CONFIG_LOG_DEFAULT_LEVEL=3
-CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
-# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
-# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
-CONFIG_LOG_MAXIMUM_LEVEL=3
-
-#
-# Level Settings
-#
-# CONFIG_LOG_MASTER_LEVEL is not set
-CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y
-# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set
-# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set
-CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y
-# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set
-CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y
-CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31
-# end of Level Settings
-# end of Log Level
-
-#
-# Format
-#
-# CONFIG_LOG_COLORS is not set
-CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
-# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
-# end of Format
-
-#
-# Settings
-#
-CONFIG_LOG_MODE_TEXT_EN=y
-CONFIG_LOG_MODE_TEXT=y
-# end of Settings
-
-CONFIG_LOG_IN_IRAM=y
-# end of Log
-
-#
-# LWIP
-#
-CONFIG_LWIP_ENABLE=y
-CONFIG_LWIP_LOCAL_HOSTNAME="espressif"
-CONFIG_LWIP_TCPIP_TASK_PRIO=18
-# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set
-# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set
-CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
-# CONFIG_LWIP_L2_TO_L3_COPY is not set
-# CONFIG_LWIP_IRAM_OPTIMIZATION is not set
-# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set
-CONFIG_LWIP_TIMERS_ONDEMAND=y
-CONFIG_LWIP_ND6=y
-# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set
-CONFIG_LWIP_MAX_SOCKETS=10
-# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set
-# CONFIG_LWIP_SO_LINGER is not set
-CONFIG_LWIP_SO_REUSE=y
-CONFIG_LWIP_SO_REUSE_RXTOALL=y
-# CONFIG_LWIP_SO_RCVBUF is not set
-# CONFIG_LWIP_NETBUF_RECVINFO is not set
-CONFIG_LWIP_IP_DEFAULT_TTL=64
-CONFIG_LWIP_IP4_FRAG=y
-CONFIG_LWIP_IP6_FRAG=y
-# CONFIG_LWIP_IP4_REASSEMBLY is not set
-# CONFIG_LWIP_IP6_REASSEMBLY is not set
-CONFIG_LWIP_IP_REASS_MAX_PBUFS=10
-# CONFIG_LWIP_IP_FORWARD is not set
-# CONFIG_LWIP_STATS is not set
-CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
-CONFIG_LWIP_GARP_TMR_INTERVAL=60
-CONFIG_LWIP_ESP_MLDV6_REPORT=y
-CONFIG_LWIP_MLDV6_TMR_INTERVAL=40
-CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
-CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
-# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set
-# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set
-# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set
-CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y
-# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set
-CONFIG_LWIP_DHCP_OPTIONS_LEN=69
-CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0
-CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1
-
-#
-# DHCP server
-#
-CONFIG_LWIP_DHCPS=y
-CONFIG_LWIP_DHCPS_LEASE_UNIT=60
-CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
-CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y
-CONFIG_LWIP_DHCPS_ADD_DNS=y
-# end of DHCP server
-
-# CONFIG_LWIP_AUTOIP is not set
-CONFIG_LWIP_IPV4=y
-CONFIG_LWIP_IPV6=y
-# CONFIG_LWIP_IPV6_AUTOCONFIG is not set
-CONFIG_LWIP_IPV6_NUM_ADDRESSES=3
-# CONFIG_LWIP_IPV6_FORWARD is not set
-# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set
-CONFIG_LWIP_NETIF_LOOPBACK=y
-CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
-
-#
-# TCP
-#
-CONFIG_LWIP_MAX_ACTIVE_TCP=16
-CONFIG_LWIP_MAX_LISTENING_TCP=16
-CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y
-CONFIG_LWIP_TCP_MAXRTX=12
-CONFIG_LWIP_TCP_SYNMAXRTX=12
-CONFIG_LWIP_TCP_MSS=1440
-CONFIG_LWIP_TCP_TMR_INTERVAL=250
-CONFIG_LWIP_TCP_MSL=60000
-CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000
-CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760
-CONFIG_LWIP_TCP_WND_DEFAULT=5760
-CONFIG_LWIP_TCP_RECVMBOX_SIZE=6
-CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6
-CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
-CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6
-CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4
-# CONFIG_LWIP_TCP_SACK_OUT is not set
-CONFIG_LWIP_TCP_OVERSIZE_MSS=y
-# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set
-# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set
-CONFIG_LWIP_TCP_RTO_TIME=1500
-# end of TCP
-
-#
-# UDP
-#
-CONFIG_LWIP_MAX_UDP_PCBS=16
-CONFIG_LWIP_UDP_RECVMBOX_SIZE=6
-# end of UDP
-
-#
-# Checksums
-#
-# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set
-# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set
-CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y
-# end of Checksums
-
-CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072
-CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
-# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set
-# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set
-CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF
-CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3
-CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5
-CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5
-CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3
-CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10
-# CONFIG_LWIP_IPV6_ND6_ROUTE_INFO_OPTION_SUPPORT is not set
-# CONFIG_LWIP_PPP_SUPPORT is not set
-# CONFIG_LWIP_SLIP_SUPPORT is not set
-
-#
-# ICMP
-#
-CONFIG_LWIP_ICMP=y
-# CONFIG_LWIP_MULTICAST_PING is not set
-# CONFIG_LWIP_BROADCAST_PING is not set
-# end of ICMP
-
-#
-# LWIP RAW API
-#
-CONFIG_LWIP_MAX_RAW_PCBS=16
-# end of LWIP RAW API
-
-#
-# SNTP
-#
-CONFIG_LWIP_SNTP_MAX_SERVERS=1
-# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set
-CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
-CONFIG_LWIP_SNTP_STARTUP_DELAY=y
-CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000
-# end of SNTP
-
-#
-# DNS
-#
-CONFIG_LWIP_DNS_MAX_HOST_IP=1
-CONFIG_LWIP_DNS_MAX_SERVERS=3
-# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set
-# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set
-# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set
-# end of DNS
-
-CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7
-CONFIG_LWIP_ESP_LWIP_ASSERT=y
-
-#
-# Hooks
-#
-# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set
-CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y
-# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set
-CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y
-# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set
-# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set
-CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y
-# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set
-# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set
-CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y
-# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set
-# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set
-CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y
-# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set
-# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set
-CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y
-# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set
-# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set
-CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y
-# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set
-# CONFIG_LWIP_HOOK_IP6_INPUT_NONE is not set
-CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT=y
-# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set
-# end of Hooks
-
-# CONFIG_LWIP_DEBUG is not set
-# end of LWIP
-
-#
-# mbedTLS
-#
-CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
-# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set
-# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set
-CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y
-CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384
-CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096
-# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set
-# CONFIG_MBEDTLS_DEBUG is not set
-
-#
-# mbedTLS v3.x related
-#
-# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set
-# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set
-# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set
-# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set
-CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y
-# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set
-CONFIG_MBEDTLS_PKCS7_C=y
-# end of mbedTLS v3.x related
-
-#
-# Certificate Bundle
-#
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
-# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set
-# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set
-# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set
-# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
-# end of Certificate Bundle
-
-# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set
-# CONFIG_MBEDTLS_CMAC_C is not set
-CONFIG_MBEDTLS_HARDWARE_AES=y
-CONFIG_MBEDTLS_AES_USE_INTERRUPT=y
-CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0
-# CONFIG_MBEDTLS_AES_USE_PSEUDO_ROUND_FUNC is not set
-CONFIG_MBEDTLS_HARDWARE_GCM=y
-CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y
-CONFIG_MBEDTLS_HARDWARE_MPI=y
-# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set
-CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y
-CONFIG_MBEDTLS_MPI_INTERRUPT_LEVEL=0
-CONFIG_MBEDTLS_HARDWARE_SHA=y
-CONFIG_MBEDTLS_HARDWARE_ECC=y
-CONFIG_MBEDTLS_ECC_OTHER_CURVES_SOFT_FALLBACK=y
-CONFIG_MBEDTLS_ROM_MD5=y
-# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set
-# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set
-CONFIG_MBEDTLS_HAVE_TIME=y
-# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set
-# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set
-CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y
-CONFIG_MBEDTLS_SHA1_C=y
-CONFIG_MBEDTLS_SHA512_C=y
-# CONFIG_MBEDTLS_SHA3_C is not set
-CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
-# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set
-# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set
-# CONFIG_MBEDTLS_TLS_DISABLED is not set
-CONFIG_MBEDTLS_TLS_SERVER=y
-CONFIG_MBEDTLS_TLS_CLIENT=y
-CONFIG_MBEDTLS_TLS_ENABLED=y
-
-#
-# TLS Key Exchange Methods
-#
-# CONFIG_MBEDTLS_PSK_MODES is not set
-CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
-# end of TLS Key Exchange Methods
-
-CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
-CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
-# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set
-# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set
-CONFIG_MBEDTLS_SSL_ALPN=y
-CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y
-CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y
-
-#
-# Symmetric Ciphers
-#
-CONFIG_MBEDTLS_AES_C=y
-# CONFIG_MBEDTLS_CAMELLIA_C is not set
-# CONFIG_MBEDTLS_DES_C is not set
-# CONFIG_MBEDTLS_BLOWFISH_C is not set
-# CONFIG_MBEDTLS_XTEA_C is not set
-CONFIG_MBEDTLS_CCM_C=y
-CONFIG_MBEDTLS_GCM_C=y
-# CONFIG_MBEDTLS_NIST_KW_C is not set
-# end of Symmetric Ciphers
-
-# CONFIG_MBEDTLS_RIPEMD160_C is not set
-
-#
-# Certificates
-#
-CONFIG_MBEDTLS_PEM_PARSE_C=y
-CONFIG_MBEDTLS_PEM_WRITE_C=y
-CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
-CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
-# end of Certificates
-
-CONFIG_MBEDTLS_ECP_C=y
-CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y
-CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y
-# CONFIG_MBEDTLS_DHM_C is not set
-CONFIG_MBEDTLS_ECDH_C=y
-CONFIG_MBEDTLS_ECDSA_C=y
-# CONFIG_MBEDTLS_ECJPAKE_C is not set
-CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
-CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
-# CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is not set
-# CONFIG_MBEDTLS_POLY1305_C is not set
-# CONFIG_MBEDTLS_CHACHA20_C is not set
-# CONFIG_MBEDTLS_HKDF_C is not set
-# CONFIG_MBEDTLS_THREADING_C is not set
-CONFIG_MBEDTLS_ERROR_STRINGS=y
-CONFIG_MBEDTLS_FS_IO=y
-# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set
-# end of mbedTLS
-
-#
-# ESP-MQTT Configurations
-#
-CONFIG_MQTT_PROTOCOL_311=y
-# CONFIG_MQTT_PROTOCOL_5 is not set
-CONFIG_MQTT_TRANSPORT_SSL=y
-CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
-CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
-# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set
-# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set
-# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set
-# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set
-# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set
-# CONFIG_MQTT_CUSTOM_OUTBOX is not set
-# end of ESP-MQTT Configurations
-
-#
-# LibC
-#
-CONFIG_LIBC_NEWLIB=y
-CONFIG_LIBC_MISC_IN_IRAM=y
-CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y
-CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y
-# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set
-# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set
-# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set
-# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set
-CONFIG_LIBC_STDIN_LINE_ENDING_CR=y
-# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set
-CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y
-# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set
-# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set
-# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set
-# CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS is not set
-# end of LibC
-
-#
-# NVS
-#
-# CONFIG_NVS_ENCRYPTION is not set
-# CONFIG_NVS_ASSERT_ERROR_CHECK is not set
-# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set
-# end of NVS
-
-#
-# OpenThread
-#
-# CONFIG_OPENTHREAD_ENABLED is not set
-
-#
-# OpenThread Spinel
-#
-# CONFIG_OPENTHREAD_SPINEL_ONLY is not set
-# end of OpenThread Spinel
-
-# CONFIG_OPENTHREAD_DEBUG is not set
-# end of OpenThread
-
-#
-# Protocomm
-#
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y
-# end of Protocomm
-
-#
-# PThreads
-#
-CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y
-# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set
-# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set
-CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1
-CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
-# end of PThreads
-
-#
-# MMU Config
-#
-CONFIG_MMU_PAGE_SIZE_64KB=y
-CONFIG_MMU_PAGE_MODE="64KB"
-CONFIG_MMU_PAGE_SIZE=0x10000
-# end of MMU Config
-
-#
-# Main Flash configuration
-#
-
-#
-# SPI Flash behavior when brownout
-#
-CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y
-CONFIG_SPI_FLASH_BROWNOUT_RESET=y
-# end of SPI Flash behavior when brownout
-
-#
-# Optional and Experimental Features (READ DOCS FIRST)
-#
-
-#
-# Features here require specific hardware (READ DOCS FIRST!)
-#
-# CONFIG_SPI_FLASH_HPM_ENA is not set
-CONFIG_SPI_FLASH_HPM_AUTO=y
-# CONFIG_SPI_FLASH_HPM_DIS is not set
-CONFIG_SPI_FLASH_HPM_ON=y
-CONFIG_SPI_FLASH_HPM_DC_AUTO=y
-# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set
-# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set
-CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50
-CONFIG_SPI_FLASH_SUSPEND_TRS_VAL_US=50
-# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set
-# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set
-CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y
-# end of Optional and Experimental Features (READ DOCS FIRST)
-# end of Main Flash configuration
-
-#
-# SPI Flash driver
-#
-# CONFIG_SPI_FLASH_VERIFY_WRITE is not set
-# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set
-CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
-CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
-# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set
-# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set
-# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set
-CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y
-CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20
-CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1
-CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192
-# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set
-# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set
-# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set
-
-#
-# Auto-detect flash chips
-#
-CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y
-CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y
-# CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP is not set
-# CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP is not set
-CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y
-# CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP is not set
-# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set
-# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set
-# end of Auto-detect flash chips
-
-CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y
-# end of SPI Flash driver
-
-#
-# SPIFFS Configuration
-#
-CONFIG_SPIFFS_MAX_PARTITIONS=3
-
-#
-# SPIFFS Cache Configuration
-#
-CONFIG_SPIFFS_CACHE=y
-CONFIG_SPIFFS_CACHE_WR=y
-# CONFIG_SPIFFS_CACHE_STATS is not set
-# end of SPIFFS Cache Configuration
-
-CONFIG_SPIFFS_PAGE_CHECK=y
-CONFIG_SPIFFS_GC_MAX_RUNS=10
-# CONFIG_SPIFFS_GC_STATS is not set
-CONFIG_SPIFFS_PAGE_SIZE=256
-CONFIG_SPIFFS_OBJ_NAME_LEN=32
-# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set
-CONFIG_SPIFFS_USE_MAGIC=y
-CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
-CONFIG_SPIFFS_META_LENGTH=4
-CONFIG_SPIFFS_USE_MTIME=y
-
-#
-# Debug Configuration
-#
-# CONFIG_SPIFFS_DBG is not set
-# CONFIG_SPIFFS_API_DBG is not set
-# CONFIG_SPIFFS_GC_DBG is not set
-# CONFIG_SPIFFS_CACHE_DBG is not set
-# CONFIG_SPIFFS_CHECK_DBG is not set
-# CONFIG_SPIFFS_TEST_VISUALISATION is not set
-# end of Debug Configuration
-# end of SPIFFS Configuration
-
-#
-# TCP Transport
-#
-
-#
-# Websocket
-#
-CONFIG_WS_TRANSPORT=y
-CONFIG_WS_BUFFER_SIZE=1024
-# CONFIG_WS_DYNAMIC_BUFFER is not set
-# end of Websocket
-# end of TCP Transport
-
-#
-# Ultra Low Power (ULP) Co-processor
-#
-# CONFIG_ULP_COPROC_ENABLED is not set
-
-#
-# ULP Debugging Options
-#
-# end of ULP Debugging Options
-# end of Ultra Low Power (ULP) Co-processor
-
-#
-# Unity unit testing library
-#
-CONFIG_UNITY_ENABLE_FLOAT=y
-CONFIG_UNITY_ENABLE_DOUBLE=y
-# CONFIG_UNITY_ENABLE_64BIT is not set
-# CONFIG_UNITY_ENABLE_COLOR is not set
-CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
-# CONFIG_UNITY_ENABLE_FIXTURE is not set
-# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set
-# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set
-# end of Unity unit testing library
-
-#
-# USB-OTG
-#
-CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256
-CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y
-# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set
-# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set
-
-#
-# Hub Driver Configuration
-#
-
-#
-# Root Port configuration
-#
-CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250
-CONFIG_USB_HOST_RESET_HOLD_MS=30
-CONFIG_USB_HOST_RESET_RECOVERY_MS=30
-CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10
-# end of Root Port configuration
-
-# CONFIG_USB_HOST_HUBS_SUPPORTED is not set
-# end of Hub Driver Configuration
-
-# CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set
-CONFIG_USB_OTG_SUPPORTED=y
-# end of USB-OTG
-
-#
-# Virtual file system
-#
-CONFIG_VFS_SUPPORT_IO=y
-CONFIG_VFS_SUPPORT_DIR=y
-CONFIG_VFS_SUPPORT_SELECT=y
-CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
-# CONFIG_VFS_SELECT_IN_RAM is not set
-CONFIG_VFS_SUPPORT_TERMIOS=y
-CONFIG_VFS_MAX_COUNT=8
-
-#
-# Host File System I/O (Semihosting)
-#
-CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1
-# end of Host File System I/O (Semihosting)
-
-CONFIG_VFS_INITIALIZE_DEV_NULL=y
-# end of Virtual file system
-
-#
-# Wear Levelling
-#
-# CONFIG_WL_SECTOR_SIZE_512 is not set
-CONFIG_WL_SECTOR_SIZE_4096=y
-CONFIG_WL_SECTOR_SIZE=4096
-# end of Wear Levelling
-
-#
-# Wi-Fi Provisioning Manager
-#
-CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16
-CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30
-CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
-# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set
-# end of Wi-Fi Provisioning Manager
-
-#
-# cJSON
-#
-CONFIG_CJSON_NESTING_LIMIT=1000
-CONFIG_CJSON_CIRCULAR_LIMIT=10000
-# end of cJSON
-
-#
-# TinyUSB Stack
-#
-CONFIG_TINYUSB_DEBUG_LEVEL=1
-
-#
-# TinyUSB DCD
-#
-# CONFIG_TINYUSB_MODE_SLAVE is not set
-CONFIG_TINYUSB_MODE_DMA=y
-# end of TinyUSB DCD
-
-#
-# TinyUSB callbacks
-#
-# CONFIG_TINYUSB_SUSPEND_CALLBACK is not set
-# CONFIG_TINYUSB_RESUME_CALLBACK is not set
-# end of TinyUSB callbacks
-
-#
-# Descriptor configuration
-#
-
-#
-# You can provide your custom descriptors via tinyusb_driver_install()
-#
-CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID=y
-CONFIG_TINYUSB_DESC_USE_DEFAULT_PID=y
-CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100
-CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Espressif Systems"
-CONFIG_TINYUSB_DESC_PRODUCT_STRING="Espressif Device"
-CONFIG_TINYUSB_DESC_SERIAL_STRING="123456"
-# end of Descriptor configuration
-
-#
-# Mass Storage Class (MSC)
-#
-# CONFIG_TINYUSB_MSC_ENABLED is not set
-# end of Mass Storage Class (MSC)
-
-#
-# Communication Device Class (CDC)
-#
-# CONFIG_TINYUSB_CDC_ENABLED is not set
-# end of Communication Device Class (CDC)
-
-#
-# Musical Instrument Digital Interface (MIDI)
-#
-CONFIG_TINYUSB_MIDI_COUNT=0
-# end of Musical Instrument Digital Interface (MIDI)
-
-#
-# Human Interface Device Class (HID)
-#
-CONFIG_TINYUSB_HID_COUNT=2
-# end of Human Interface Device Class (HID)
-
-#
-# Device Firmware Upgrade (DFU)
-#
-# CONFIG_TINYUSB_DFU_MODE_DFU is not set
-# CONFIG_TINYUSB_DFU_MODE_DFU_RUNTIME is not set
-CONFIG_TINYUSB_DFU_MODE_NONE=y
-# end of Device Firmware Upgrade (DFU)
-
-#
-# Bluetooth Host Class (BTH)
-#
-# CONFIG_TINYUSB_BTH_ENABLED is not set
-# end of Bluetooth Host Class (BTH)
-
-#
-# Network driver (ECM/NCM/RNDIS)
-#
-# CONFIG_TINYUSB_NET_MODE_ECM_RNDIS is not set
-# CONFIG_TINYUSB_NET_MODE_NCM is not set
-CONFIG_TINYUSB_NET_MODE_NONE=y
-# end of Network driver (ECM/NCM/RNDIS)
-
-#
-# Vendor Specific Interface
-#
-CONFIG_TINYUSB_VENDOR_COUNT=0
-# end of Vendor Specific Interface
-# end of TinyUSB Stack
-
-#
-# LittleFS
-#
-# CONFIG_LITTLEFS_SDMMC_SUPPORT is not set
-CONFIG_LITTLEFS_MAX_PARTITIONS=3
-CONFIG_LITTLEFS_PAGE_SIZE=256
-CONFIG_LITTLEFS_OBJ_NAME_LEN=64
-CONFIG_LITTLEFS_READ_SIZE=128
-CONFIG_LITTLEFS_WRITE_SIZE=128
-CONFIG_LITTLEFS_LOOKAHEAD_SIZE=128
-CONFIG_LITTLEFS_CACHE_SIZE=512
-CONFIG_LITTLEFS_BLOCK_CYCLES=512
-CONFIG_LITTLEFS_USE_MTIME=y
-# CONFIG_LITTLEFS_USE_ONLY_HASH is not set
-# CONFIG_LITTLEFS_HUMAN_READABLE is not set
-CONFIG_LITTLEFS_MTIME_USE_SECONDS=y
-# CONFIG_LITTLEFS_MTIME_USE_NONCE is not set
-# CONFIG_LITTLEFS_SPIFFS_COMPAT is not set
-# CONFIG_LITTLEFS_FLUSH_FILE_EVERY_WRITE is not set
-# CONFIG_LITTLEFS_FCNTL_GET_PATH is not set
-# CONFIG_LITTLEFS_MULTIVERSION is not set
-# CONFIG_LITTLEFS_MALLOC_STRATEGY_DISABLE is not set
-CONFIG_LITTLEFS_MALLOC_STRATEGY_DEFAULT=y
-# CONFIG_LITTLEFS_MALLOC_STRATEGY_INTERNAL is not set
-CONFIG_LITTLEFS_ASSERTS=y
-# CONFIG_LITTLEFS_MMAP_PARTITION is not set
-# CONFIG_LITTLEFS_WDT_RESET is not set
-# end of LittleFS
-
-#
-# LVGL configuration
-#
-CONFIG_LV_CONF_SKIP=y
-# CONFIG_LV_CONF_MINIMAL is not set
-
-#
-# Color Settings
-#
-# CONFIG_LV_COLOR_DEPTH_32 is not set
-# CONFIG_LV_COLOR_DEPTH_24 is not set
-CONFIG_LV_COLOR_DEPTH_16=y
-# CONFIG_LV_COLOR_DEPTH_8 is not set
-# CONFIG_LV_COLOR_DEPTH_1 is not set
-CONFIG_LV_COLOR_DEPTH=16
-# end of Color Settings
-
-#
-# Memory Settings
-#
-CONFIG_LV_USE_BUILTIN_MALLOC=y
-# CONFIG_LV_USE_CLIB_MALLOC is not set
-# CONFIG_LV_USE_MICROPYTHON_MALLOC is not set
-# CONFIG_LV_USE_RTTHREAD_MALLOC is not set
-# CONFIG_LV_USE_CUSTOM_MALLOC is not set
-CONFIG_LV_USE_BUILTIN_STRING=y
-# CONFIG_LV_USE_CLIB_STRING is not set
-# CONFIG_LV_USE_CUSTOM_STRING is not set
-CONFIG_LV_USE_BUILTIN_SPRINTF=y
-# CONFIG_LV_USE_CLIB_SPRINTF is not set
-# CONFIG_LV_USE_CUSTOM_SPRINTF is not set
-CONFIG_LV_MEM_SIZE_KILOBYTES=128
-CONFIG_LV_MEM_POOL_EXPAND_SIZE_KILOBYTES=64
-CONFIG_LV_MEM_ADR=0x0
-# end of Memory Settings
-
-#
-# HAL Settings
-#
-CONFIG_LV_DEF_REFR_PERIOD=33
-CONFIG_LV_DPI_DEF=130
-# end of HAL Settings
-
-#
-# Operating System (OS)
-#
-CONFIG_LV_OS_NONE=y
-# CONFIG_LV_OS_PTHREAD is not set
-# CONFIG_LV_OS_FREERTOS is not set
-# CONFIG_LV_OS_CMSIS_RTOS2 is not set
-# CONFIG_LV_OS_RTTHREAD is not set
-# CONFIG_LV_OS_WINDOWS is not set
-# CONFIG_LV_OS_MQX is not set
-# CONFIG_LV_OS_SDL2 is not set
-# CONFIG_LV_OS_CUSTOM is not set
-# end of Operating System (OS)
-
-#
-# Rendering Configuration
-#
-CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=1
-CONFIG_LV_DRAW_BUF_ALIGN=4
-CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE=24576
-CONFIG_LV_DRAW_LAYER_MAX_MEMORY=0
-CONFIG_LV_USE_DRAW_SW=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB565=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB565_SWAPPED=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB565A8=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB888=y
-CONFIG_LV_DRAW_SW_SUPPORT_XRGB8888=y
-CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888=y
-CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888_PREMULTIPLIED=y
-CONFIG_LV_DRAW_SW_SUPPORT_L8=y
-CONFIG_LV_DRAW_SW_SUPPORT_AL88=y
-CONFIG_LV_DRAW_SW_SUPPORT_A8=y
-CONFIG_LV_DRAW_SW_SUPPORT_I1=y
-CONFIG_LV_DRAW_SW_I1_LUM_THRESHOLD=127
-CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT=1
-# CONFIG_LV_USE_DRAW_ARM2D_SYNC is not set
-# CONFIG_LV_USE_NATIVE_HELIUM_ASM is not set
-CONFIG_LV_DRAW_SW_COMPLEX=y
-# CONFIG_LV_USE_DRAW_SW_COMPLEX_GRADIENTS is not set
-CONFIG_LV_DRAW_SW_SHADOW_CACHE_SIZE=0
-CONFIG_LV_DRAW_SW_CIRCLE_CACHE_SIZE=4
-CONFIG_LV_DRAW_SW_ASM_NONE=y
-# CONFIG_LV_DRAW_SW_ASM_NEON is not set
-# CONFIG_LV_DRAW_SW_ASM_HELIUM is not set
-# CONFIG_LV_DRAW_SW_ASM_RISCV_V is not set
-# CONFIG_LV_DRAW_SW_ASM_CUSTOM is not set
-CONFIG_LV_USE_DRAW_SW_ASM=0
-# CONFIG_LV_USE_PXP is not set
-# CONFIG_LV_USE_G2D is not set
-# CONFIG_LV_USE_DRAW_DAVE2D is not set
-# CONFIG_LV_USE_DRAW_SDL is not set
-# CONFIG_LV_USE_DRAW_VG_LITE is not set
-# CONFIG_LV_USE_VECTOR_GRAPHIC is not set
-# CONFIG_LV_USE_DRAW_DMA2D is not set
-# CONFIG_LV_USE_PPA is not set
-# CONFIG_LV_USE_DRAW_EVE is not set
-# end of Rendering Configuration
-
-#
-# Feature Configuration
-#
-
-#
-# Logging
-#
-# CONFIG_LV_USE_LOG is not set
-# end of Logging
-
-#
-# Asserts
-#
-CONFIG_LV_USE_ASSERT_NULL=y
-CONFIG_LV_USE_ASSERT_MALLOC=y
-# CONFIG_LV_USE_ASSERT_STYLE is not set
-# CONFIG_LV_USE_ASSERT_MEM_INTEGRITY is not set
-# CONFIG_LV_USE_ASSERT_OBJ is not set
-CONFIG_LV_ASSERT_HANDLER_INCLUDE="assert.h"
-# end of Asserts
-
-#
-# Debug
-#
-# CONFIG_LV_USE_REFR_DEBUG is not set
-# CONFIG_LV_USE_LAYER_DEBUG is not set
-# CONFIG_LV_USE_PARALLEL_DRAW_DEBUG is not set
-# end of Debug
-
-#
-# Others
-#
-# CONFIG_LV_ENABLE_GLOBAL_CUSTOM is not set
-CONFIG_LV_CACHE_DEF_SIZE=0
-CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT=0
-CONFIG_LV_GRADIENT_MAX_STOPS=2
-CONFIG_LV_COLOR_MIX_ROUND_OFS=128
-# CONFIG_LV_OBJ_STYLE_CACHE is not set
-# CONFIG_LV_USE_OBJ_ID is not set
-# CONFIG_LV_USE_OBJ_NAME is not set
-# CONFIG_LV_USE_OBJ_PROPERTY is not set
-# CONFIG_LV_USE_EXT_DATA is not set
-# end of Others
-# end of Feature Configuration
-
-#
-# Compiler Settings
-#
-# CONFIG_LV_BIG_ENDIAN_SYSTEM is not set
-CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE=1
-# CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM is not set
-# CONFIG_LV_USE_FLOAT is not set
-# CONFIG_LV_USE_MATRIX is not set
-# CONFIG_LV_USE_PRIVATE_API is not set
-# end of Compiler Settings
-
-#
-# Font Usage
-#
-
-#
-# Enable built-in fonts
-#
-# CONFIG_LV_FONT_MONTSERRAT_8 is not set
-# CONFIG_LV_FONT_MONTSERRAT_10 is not set
-CONFIG_LV_FONT_MONTSERRAT_12=y
-CONFIG_LV_FONT_MONTSERRAT_14=y
-# CONFIG_LV_FONT_MONTSERRAT_16 is not set
-# CONFIG_LV_FONT_MONTSERRAT_18 is not set
-# CONFIG_LV_FONT_MONTSERRAT_20 is not set
-# CONFIG_LV_FONT_MONTSERRAT_22 is not set
-# CONFIG_LV_FONT_MONTSERRAT_24 is not set
-# CONFIG_LV_FONT_MONTSERRAT_26 is not set
-# CONFIG_LV_FONT_MONTSERRAT_28 is not set
-# CONFIG_LV_FONT_MONTSERRAT_30 is not set
-# CONFIG_LV_FONT_MONTSERRAT_32 is not set
-# CONFIG_LV_FONT_MONTSERRAT_34 is not set
-# CONFIG_LV_FONT_MONTSERRAT_36 is not set
-# CONFIG_LV_FONT_MONTSERRAT_38 is not set
-# CONFIG_LV_FONT_MONTSERRAT_40 is not set
-# CONFIG_LV_FONT_MONTSERRAT_42 is not set
-# CONFIG_LV_FONT_MONTSERRAT_44 is not set
-# CONFIG_LV_FONT_MONTSERRAT_46 is not set
-# CONFIG_LV_FONT_MONTSERRAT_48 is not set
-# CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED is not set
-# CONFIG_LV_FONT_DEJAVU_16_PERSIAN_HEBREW is not set
-# CONFIG_LV_FONT_SOURCE_HAN_SANS_SC_14_CJK is not set
-# CONFIG_LV_FONT_SOURCE_HAN_SANS_SC_16_CJK is not set
-# CONFIG_LV_FONT_UNSCII_8 is not set
-# CONFIG_LV_FONT_UNSCII_16 is not set
-# end of Enable built-in fonts
-
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_8 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_10 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12 is not set
-CONFIG_LV_FONT_DEFAULT_MONTSERRAT_14=y
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_16 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_18 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_20 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_22 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_24 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_30 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_32 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_34 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_36 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_38 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_40 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_42 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_44 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_46 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_48 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED is not set
-# CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW is not set
-# CONFIG_LV_FONT_DEFAULT_SOURCE_HAN_SANS_SC_14_CJK is not set
-# CONFIG_LV_FONT_DEFAULT_SOURCE_HAN_SANS_SC_16_CJK is not set
-# CONFIG_LV_FONT_DEFAULT_UNSCII_8 is not set
-# CONFIG_LV_FONT_DEFAULT_UNSCII_16 is not set
-# CONFIG_LV_FONT_FMT_TXT_LARGE is not set
-# CONFIG_LV_USE_FONT_COMPRESSED is not set
-CONFIG_LV_USE_FONT_PLACEHOLDER=y
-
-#
-# Enable static fonts
-#
-# end of Enable static fonts
-# end of Font Usage
-
-#
-# Text Settings
-#
-CONFIG_LV_TXT_ENC_UTF8=y
-# CONFIG_LV_TXT_ENC_ASCII is not set
-CONFIG_LV_TXT_BREAK_CHARS=" ,.;:-_)}"
-CONFIG_LV_TXT_LINE_BREAK_LONG_LEN=0
-CONFIG_LV_TXT_COLOR_CMD="#"
-# CONFIG_LV_USE_BIDI is not set
-# CONFIG_LV_USE_ARABIC_PERSIAN_CHARS is not set
-# end of Text Settings
-
-#
-# Widget Usage
-#
-CONFIG_LV_WIDGETS_HAS_DEFAULT_VALUE=y
-CONFIG_LV_USE_ANIMIMG=y
-CONFIG_LV_USE_ARC=y
-CONFIG_LV_USE_ARCLABEL=y
-CONFIG_LV_USE_BAR=y
-CONFIG_LV_USE_BUTTON=y
-CONFIG_LV_USE_BUTTONMATRIX=y
-CONFIG_LV_USE_CALENDAR=y
-# CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY is not set
-
-#
-# Days name configuration
-#
-CONFIG_LV_MONDAY_STR="Mo"
-CONFIG_LV_TUESDAY_STR="Tu"
-CONFIG_LV_WEDNESDAY_STR="We"
-CONFIG_LV_THURSDAY_STR="Th"
-CONFIG_LV_FRIDAY_STR="Fr"
-CONFIG_LV_SATURDAY_STR="Sa"
-CONFIG_LV_SUNDAY_STR="Su"
-# end of Days name configuration
-
-CONFIG_LV_USE_CALENDAR_HEADER_ARROW=y
-CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN=y
-# CONFIG_LV_USE_CALENDAR_CHINESE is not set
-CONFIG_LV_USE_CANVAS=y
-CONFIG_LV_USE_CHART=y
-CONFIG_LV_USE_CHECKBOX=y
-CONFIG_LV_USE_DROPDOWN=y
-CONFIG_LV_USE_IMAGE=y
-CONFIG_LV_USE_IMAGEBUTTON=y
-CONFIG_LV_USE_KEYBOARD=y
-CONFIG_LV_USE_LABEL=y
-CONFIG_LV_LABEL_TEXT_SELECTION=y
-CONFIG_LV_LABEL_LONG_TXT_HINT=y
-CONFIG_LV_LABEL_WAIT_CHAR_COUNT=3
-CONFIG_LV_USE_LED=y
-CONFIG_LV_USE_LINE=y
-CONFIG_LV_USE_LIST=y
-CONFIG_LV_USE_MENU=y
-CONFIG_LV_USE_MSGBOX=y
-CONFIG_LV_USE_ROLLER=y
-CONFIG_LV_USE_SCALE=y
-CONFIG_LV_USE_SLIDER=y
-CONFIG_LV_USE_SPAN=y
-CONFIG_LV_SPAN_SNIPPET_STACK_SIZE=64
-CONFIG_LV_USE_SPINBOX=y
-CONFIG_LV_USE_SPINNER=y
-CONFIG_LV_USE_SWITCH=y
-CONFIG_LV_USE_TEXTAREA=y
-CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME=1500
-CONFIG_LV_USE_TABLE=y
-CONFIG_LV_USE_TABVIEW=y
-CONFIG_LV_USE_TILEVIEW=y
-CONFIG_LV_USE_WIN=y
-# end of Widget Usage
-
-#
-# Themes
-#
-CONFIG_LV_USE_THEME_DEFAULT=y
-# CONFIG_LV_THEME_DEFAULT_DARK is not set
-CONFIG_LV_THEME_DEFAULT_GROW=y
-CONFIG_LV_THEME_DEFAULT_TRANSITION_TIME=80
-CONFIG_LV_USE_THEME_SIMPLE=y
-# CONFIG_LV_USE_THEME_MONO is not set
-# end of Themes
-
-#
-# Layouts
-#
-CONFIG_LV_USE_FLEX=y
-CONFIG_LV_USE_GRID=y
-# end of Layouts
-
-#
-# 3rd Party Libraries
-#
-CONFIG_LV_FS_DEFAULT_DRIVER_LETTER=0
-# CONFIG_LV_USE_FS_STDIO is not set
-# CONFIG_LV_USE_FS_POSIX is not set
-# CONFIG_LV_USE_FS_WIN32 is not set
-# CONFIG_LV_USE_FS_FATFS is not set
-# CONFIG_LV_USE_FS_MEMFS is not set
-# CONFIG_LV_USE_FS_LITTLEFS is not set
-# CONFIG_LV_USE_FS_ARDUINO_ESP_LITTLEFS is not set
-# CONFIG_LV_USE_FS_ARDUINO_SD is not set
-# CONFIG_LV_USE_FS_UEFI is not set
-# CONFIG_LV_USE_FS_FROGFS is not set
-# CONFIG_LV_USE_LODEPNG is not set
-# CONFIG_LV_USE_LIBPNG is not set
-# CONFIG_LV_USE_BMP is not set
-# CONFIG_LV_USE_TJPGD is not set
-# CONFIG_LV_USE_LIBJPEG_TURBO is not set
-# CONFIG_LV_USE_LIBWEBP is not set
-# CONFIG_LV_USE_GIF is not set
-# CONFIG_LV_BIN_DECODER_RAM_LOAD is not set
-# CONFIG_LV_USE_RLE is not set
-# CONFIG_LV_USE_QRCODE is not set
-# CONFIG_LV_USE_BARCODE is not set
-# CONFIG_LV_USE_FREETYPE is not set
-# CONFIG_LV_USE_TINY_TTF is not set
-# CONFIG_LV_USE_RLOTTIE is not set
-# CONFIG_LV_USE_THORVG is not set
-# CONFIG_LV_USE_NANOVG is not set
-# CONFIG_LV_USE_LZ4 is not set
-# CONFIG_LV_USE_FFMPEG is not set
-# end of 3rd Party Libraries
-
-#
-# Others
-#
-# CONFIG_LV_USE_SNAPSHOT is not set
-# CONFIG_LV_USE_SYSMON is not set
-# CONFIG_LV_USE_PROFILER is not set
-# CONFIG_LV_USE_MONKEY is not set
-# CONFIG_LV_USE_GRIDNAV is not set
-# CONFIG_LV_USE_FRAGMENT is not set
-# CONFIG_LV_USE_IMGFONT is not set
-CONFIG_LV_USE_OBSERVER=y
-# CONFIG_LV_USE_IME_PINYIN is not set
-# CONFIG_LV_USE_FILE_EXPLORER is not set
-# CONFIG_LV_USE_FONT_MANAGER is not set
-# CONFIG_LV_USE_TEST is not set
-# CONFIG_LV_USE_TRANSLATION is not set
-# CONFIG_LV_USE_COLOR_FILTER is not set
-CONFIG_LVGL_VERSION_MAJOR=9
-CONFIG_LVGL_VERSION_MINOR=5
-CONFIG_LVGL_VERSION_PATCH=0
-# end of Others
-
-#
-# Devices
-#
-# CONFIG_LV_USE_SDL is not set
-# CONFIG_LV_USE_X11 is not set
-# CONFIG_LV_USE_WAYLAND is not set
-# CONFIG_LV_USE_LINUX_FBDEV is not set
-# CONFIG_LV_USE_NUTTX is not set
-# CONFIG_LV_USE_LINUX_DRM is not set
-# CONFIG_LV_USE_TFT_ESPI is not set
-# CONFIG_LV_USE_LOVYAN_GFX is not set
-# CONFIG_LV_USE_EVDEV is not set
-# CONFIG_LV_USE_LIBINPUT is not set
-# CONFIG_LV_USE_ST7735 is not set
-# CONFIG_LV_USE_ST7789 is not set
-# CONFIG_LV_USE_ST7796 is not set
-# CONFIG_LV_USE_ILI9341 is not set
-# CONFIG_LV_USE_GENERIC_MIPI is not set
-# CONFIG_LV_USE_NXP_ELCDIF is not set
-# CONFIG_LV_USE_RENESAS_GLCDC is not set
-# CONFIG_LV_USE_ST_LTDC is not set
-# CONFIG_LV_USE_FT81X is not set
-# CONFIG_LV_USE_UEFI is not set
-# CONFIG_LV_USE_QNX is not set
-# end of Devices
-
-#
-# Examples
-#
-CONFIG_LV_BUILD_EXAMPLES=y
-# end of Examples
-
-#
-# Demos
-#
-CONFIG_LV_BUILD_DEMOS=y
-# CONFIG_LV_USE_DEMO_WIDGETS is not set
-# CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER is not set
-# CONFIG_LV_USE_DEMO_BENCHMARK is not set
-# CONFIG_LV_USE_DEMO_RENDER is not set
-# CONFIG_LV_USE_DEMO_STRESS is not set
-# CONFIG_LV_USE_DEMO_MUSIC is not set
-# CONFIG_LV_USE_DEMO_FLEX_LAYOUT is not set
-# CONFIG_LV_USE_DEMO_MULTILANG is not set
-# CONFIG_LV_USE_DEMO_SMARTWATCH is not set
-# CONFIG_LV_USE_DEMO_EBIKE is not set
-# CONFIG_LV_USE_DEMO_HIGH_RES is not set
-# end of Demos
-# end of LVGL configuration
-# end of Component config
-
-# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set
-
-# Deprecated options for backward compatibility
-# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set
-# CONFIG_NO_BLOBS is not set
-CONFIG_APP_ROLLBACK_ENABLE=y
-# CONFIG_APP_ANTI_ROLLBACK is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
-CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
-# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
-# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
-CONFIG_LOG_BOOTLOADER_LEVEL=3
-# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
-# CONFIG_FLASHMODE_QIO is not set
-# CONFIG_FLASHMODE_QOUT is not set
-CONFIG_FLASHMODE_DIO=y
-# CONFIG_FLASHMODE_DOUT is not set
-CONFIG_MONITOR_BAUD=115200
-CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
-CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y
-CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
-# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set
-# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set
-CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
-# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set
-# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set
-CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2
-# CONFIG_CXX_EXCEPTIONS is not set
-CONFIG_STACK_CHECK_NONE=y
-# CONFIG_STACK_CHECK_NORM is not set
-# CONFIG_STACK_CHECK_STRONG is not set
-# CONFIG_STACK_CHECK_ALL is not set
-# CONFIG_WARN_WRITE_STRINGS is not set
-# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
-CONFIG_ESP32_APPTRACE_DEST_NONE=y
-CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
-# CONFIG_ANA_CMPR_ISR_IRAM_SAFE is not set
-# CONFIG_CAM_CTLR_MIPI_CSI_ISR_IRAM_SAFE is not set
-# CONFIG_CAM_CTLR_ISP_DVP_ISR_IRAM_SAFE is not set
-# CONFIG_CAM_CTLR_DVP_CAM_ISR_IRAM_SAFE is not set
-# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
-# CONFIG_MCPWM_ISR_IRAM_SAFE is not set
-# CONFIG_EVENT_LOOP_PROFILING is not set
-CONFIG_POST_EVENTS_FROM_ISR=y
-CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
-CONFIG_GDBSTUB_SUPPORT_TASKS=y
-CONFIG_GDBSTUB_MAX_TASKS=32
-# CONFIG_OTA_ALLOW_HTTP is not set
-# CONFIG_ESP_SYSTEM_PD_FLASH is not set
-CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
-CONFIG_BROWNOUT_DET=y
-CONFIG_BROWNOUT_DET_LVL_SEL_7=y
-# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set
-# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set
-CONFIG_BROWNOUT_DET_LVL=7
-CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y
-# CONFIG_LCD_DSI_ISR_IRAM_SAFE is not set
-CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y
-CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
-CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
-CONFIG_MAIN_TASK_STACK_SIZE=8192
-CONFIG_CONSOLE_UART_DEFAULT=y
-# CONFIG_CONSOLE_UART_CUSTOM is not set
-# CONFIG_CONSOLE_UART_NONE is not set
-# CONFIG_ESP_CONSOLE_UART_NONE is not set
-CONFIG_CONSOLE_UART=y
-CONFIG_CONSOLE_UART_NUM=0
-CONFIG_CONSOLE_UART_BAUDRATE=115200
-CONFIG_INT_WDT=y
-CONFIG_INT_WDT_TIMEOUT_MS=300
-CONFIG_INT_WDT_CHECK_CPU1=y
-CONFIG_TASK_WDT=y
-CONFIG_ESP_TASK_WDT=y
-# CONFIG_TASK_WDT_PANIC is not set
-CONFIG_TASK_WDT_TIMEOUT_S=5
-CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
-CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
-# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set
-CONFIG_IPC_TASK_STACK_SIZE=1024
-CONFIG_TIMER_TASK_STACK_SIZE=3584
-# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
-# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set
-CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
-CONFIG_TIMER_TASK_PRIORITY=1
-CONFIG_TIMER_TASK_STACK_DEPTH=2048
-CONFIG_TIMER_QUEUE_LENGTH=10
-# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set
-# CONFIG_HAL_ASSERTION_SILIENT is not set
-# CONFIG_L2_TO_L3_COPY is not set
-CONFIG_ESP_GRATUITOUS_ARP=y
-CONFIG_GARP_TMR_INTERVAL=60
-CONFIG_TCPIP_RECVMBOX_SIZE=32
-CONFIG_TCP_MAXRTX=12
-CONFIG_TCP_SYNMAXRTX=12
-CONFIG_TCP_MSS=1440
-CONFIG_TCP_MSL=60000
-CONFIG_TCP_SND_BUF_DEFAULT=5760
-CONFIG_TCP_WND_DEFAULT=5760
-CONFIG_TCP_RECVMBOX_SIZE=6
-CONFIG_TCP_QUEUE_OOSEQ=y
-CONFIG_TCP_OVERSIZE_MSS=y
-# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set
-# CONFIG_TCP_OVERSIZE_DISABLE is not set
-CONFIG_UDP_RECVMBOX_SIZE=6
-CONFIG_TCPIP_TASK_STACK_SIZE=3072
-CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
-# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set
-# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set
-CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
-# CONFIG_PPP_SUPPORT is not set
-CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
-# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set
-# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set
-# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set
-# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set
-CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
-# CONFIG_NEWLIB_NANO_FORMAT is not set
-CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y
-# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set
-# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set
-# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set
-CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y
-# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set
-# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
-CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
-# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
-# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
-CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
-CONFIG_SUPPORT_TERMIOS=y
-CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
-# End of deprecated options
diff --git a/firmware_p4/sdkconfig.defaults b/firmware_p4/sdkconfig.defaults
new file mode 100644
index 00000000..6940570c
--- /dev/null
+++ b/firmware_p4/sdkconfig.defaults
@@ -0,0 +1,44 @@
+# Flash — 32MB, 80MHz, DIO
+CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
+CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
+CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
+
+# Custom partition table (with OTA)
+CONFIG_PARTITION_TABLE_CUSTOM=y
+CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
+
+# OTA rollback support in bootloader
+CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
+
+# CPU 360MHz (P4 maximum)
+CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_360=y
+
+# PSRAM hex-octal mode, 200MHz — P4 specific
+CONFIG_SPIRAM=y
+CONFIG_SPIRAM_MODE_HEX=y
+CONFIG_SPIRAM_SPEED_200M=y
+CONFIG_SPIRAM_USE_MALLOC=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
+
+# Larger stack for kernel_init
+CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
+
+# Primary console UART0, secondary USB JTAG
+CONFIG_ESP_CONSOLE_UART_DEFAULT=y
+CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
+
+# TinyUSB HID — 2 interfaces (keyboard + mouse) for Bad USB
+CONFIG_TINYUSB_HID_COUNT=2
+CONFIG_TINYUSB_MODE_DMA=y
+
+# Required for sys_monitor (uxTaskGetSystemState / vTaskList)
+CONFIG_FREERTOS_USE_TRACE_FACILITY=y
+CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
+
+# LVGL fonts used by UI components
+CONFIG_LV_FONT_MONTSERRAT_12=y
+CONFIG_LV_FONT_MONTSERRAT_14=y
+
+# Default log level INFO
+CONFIG_LOG_DEFAULT_LEVEL_INFO=y
diff --git a/firmware_p4/sdkconfig.old b/firmware_p4/sdkconfig.old
deleted file mode 100644
index f2bf5b89..00000000
--- a/firmware_p4/sdkconfig.old
+++ /dev/null
@@ -1,2934 +0,0 @@
-#
-# Automatically generated file. DO NOT EDIT.
-# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration
-#
-CONFIG_SOC_ADC_SUPPORTED=y
-CONFIG_SOC_ANA_CMPR_SUPPORTED=y
-CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y
-CONFIG_SOC_UART_SUPPORTED=y
-CONFIG_SOC_GDMA_SUPPORTED=y
-CONFIG_SOC_UHCI_SUPPORTED=y
-CONFIG_SOC_AHB_GDMA_SUPPORTED=y
-CONFIG_SOC_AXI_GDMA_SUPPORTED=y
-CONFIG_SOC_DW_GDMA_SUPPORTED=y
-CONFIG_SOC_DMA2D_SUPPORTED=y
-CONFIG_SOC_GPTIMER_SUPPORTED=y
-CONFIG_SOC_PCNT_SUPPORTED=y
-CONFIG_SOC_LCDCAM_SUPPORTED=y
-CONFIG_SOC_LCDCAM_CAM_SUPPORTED=y
-CONFIG_SOC_LCDCAM_I80_LCD_SUPPORTED=y
-CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED=y
-CONFIG_SOC_MIPI_CSI_SUPPORTED=y
-CONFIG_SOC_MIPI_DSI_SUPPORTED=y
-CONFIG_SOC_MCPWM_SUPPORTED=y
-CONFIG_SOC_TWAI_SUPPORTED=y
-CONFIG_SOC_ETM_SUPPORTED=y
-CONFIG_SOC_PARLIO_SUPPORTED=y
-CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y
-CONFIG_SOC_EMAC_SUPPORTED=y
-CONFIG_SOC_USB_OTG_SUPPORTED=y
-CONFIG_SOC_WIRELESS_HOST_SUPPORTED=y
-CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y
-CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y
-CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y
-CONFIG_SOC_ULP_SUPPORTED=y
-CONFIG_SOC_LP_CORE_SUPPORTED=y
-CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y
-CONFIG_SOC_EFUSE_SUPPORTED=y
-CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y
-CONFIG_SOC_RTC_MEM_SUPPORTED=y
-CONFIG_SOC_RMT_SUPPORTED=y
-CONFIG_SOC_I2S_SUPPORTED=y
-CONFIG_SOC_SDM_SUPPORTED=y
-CONFIG_SOC_GPSPI_SUPPORTED=y
-CONFIG_SOC_LEDC_SUPPORTED=y
-CONFIG_SOC_ISP_SUPPORTED=y
-CONFIG_SOC_I2C_SUPPORTED=y
-CONFIG_SOC_SYSTIMER_SUPPORTED=y
-CONFIG_SOC_AES_SUPPORTED=y
-CONFIG_SOC_MPI_SUPPORTED=y
-CONFIG_SOC_SHA_SUPPORTED=y
-CONFIG_SOC_HMAC_SUPPORTED=y
-CONFIG_SOC_DIG_SIGN_SUPPORTED=y
-CONFIG_SOC_ECC_SUPPORTED=y
-CONFIG_SOC_ECC_EXTENDED_MODES_SUPPORTED=y
-CONFIG_SOC_FLASH_ENC_SUPPORTED=y
-CONFIG_SOC_SECURE_BOOT_SUPPORTED=y
-CONFIG_SOC_BOD_SUPPORTED=y
-CONFIG_SOC_VBAT_SUPPORTED=y
-CONFIG_SOC_APM_SUPPORTED=y
-CONFIG_SOC_PMU_SUPPORTED=y
-CONFIG_SOC_PMU_PVT_SUPPORTED=y
-CONFIG_SOC_DCDC_SUPPORTED=y
-CONFIG_SOC_PAU_SUPPORTED=y
-CONFIG_SOC_LP_TIMER_SUPPORTED=y
-CONFIG_SOC_ULP_LP_UART_SUPPORTED=y
-CONFIG_SOC_LP_GPIO_MATRIX_SUPPORTED=y
-CONFIG_SOC_LP_PERIPHERALS_SUPPORTED=y
-CONFIG_SOC_LP_I2C_SUPPORTED=y
-CONFIG_SOC_LP_I2S_SUPPORTED=y
-CONFIG_SOC_LP_SPI_SUPPORTED=y
-CONFIG_SOC_LP_ADC_SUPPORTED=y
-CONFIG_SOC_LP_VAD_SUPPORTED=y
-CONFIG_SOC_SPIRAM_SUPPORTED=y
-CONFIG_SOC_PSRAM_DMA_CAPABLE=y
-CONFIG_SOC_SDMMC_HOST_SUPPORTED=y
-CONFIG_SOC_CLK_TREE_SUPPORTED=y
-CONFIG_SOC_ASSIST_DEBUG_SUPPORTED=y
-CONFIG_SOC_DEBUG_PROBE_SUPPORTED=y
-CONFIG_SOC_WDT_SUPPORTED=y
-CONFIG_SOC_SPI_FLASH_SUPPORTED=y
-CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y
-CONFIG_SOC_RNG_SUPPORTED=y
-CONFIG_SOC_GP_LDO_SUPPORTED=y
-CONFIG_SOC_PPA_SUPPORTED=y
-CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y
-CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y
-CONFIG_SOC_PM_SUPPORTED=y
-CONFIG_SOC_BITSCRAMBLER_SUPPORTED=y
-CONFIG_SOC_SIMD_INSTRUCTION_SUPPORTED=y
-CONFIG_SOC_I3C_MASTER_SUPPORTED=y
-CONFIG_SOC_XTAL_SUPPORT_40M=y
-CONFIG_SOC_AES_SUPPORT_DMA=y
-CONFIG_SOC_AES_SUPPORT_GCM=y
-CONFIG_SOC_AES_GDMA=y
-CONFIG_SOC_AES_SUPPORT_AES_128=y
-CONFIG_SOC_AES_SUPPORT_AES_256=y
-CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y
-CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y
-CONFIG_SOC_ADC_DMA_SUPPORTED=y
-CONFIG_SOC_ADC_PERIPH_NUM=2
-CONFIG_SOC_ADC_MAX_CHANNEL_NUM=8
-CONFIG_SOC_ADC_ATTEN_NUM=4
-CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2
-CONFIG_SOC_ADC_PATT_LEN_MAX=16
-CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12
-CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12
-CONFIG_SOC_ADC_DIGI_IIR_FILTER_NUM=2
-CONFIG_SOC_ADC_DIGI_MONITOR_NUM=2
-CONFIG_SOC_ADC_DIGI_RESULT_BYTES=4
-CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4
-CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333
-CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611
-CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12
-CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12
-CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y
-CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y
-CONFIG_SOC_ADC_CALIB_CHAN_COMPENS_SUPPORTED=y
-CONFIG_SOC_ADC_SHARED_POWER=y
-CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y
-CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y
-CONFIG_SOC_CACHE_WRITEBACK_SUPPORTED=y
-CONFIG_SOC_CACHE_FREEZE_SUPPORTED=y
-CONFIG_SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE=y
-CONFIG_SOC_CPU_CORES_NUM=2
-CONFIG_SOC_CPU_INTR_NUM=32
-CONFIG_SOC_CPU_HAS_FLEXIBLE_INTC=y
-CONFIG_SOC_INT_CLIC_SUPPORTED=y
-CONFIG_SOC_INT_HW_NESTED_SUPPORTED=y
-CONFIG_SOC_BRANCH_PREDICTOR_SUPPORTED=y
-CONFIG_SOC_CPU_COPROC_NUM=3
-CONFIG_SOC_CPU_HAS_FPU=y
-CONFIG_SOC_CPU_HAS_FPU_EXT_ILL_BUG=y
-CONFIG_SOC_CPU_HAS_HWLOOP=y
-CONFIG_SOC_CPU_HAS_HWLOOP_STATE_BUG=y
-CONFIG_SOC_CPU_HAS_PIE=y
-CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y
-CONFIG_SOC_CPU_BREAKPOINTS_NUM=3
-CONFIG_SOC_CPU_WATCHPOINTS_NUM=3
-CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x100
-CONFIG_SOC_CPU_HAS_PMA=y
-CONFIG_SOC_CPU_IDRAM_SPLIT_USING_PMP=y
-CONFIG_SOC_CPU_PMP_REGION_GRANULARITY=128
-CONFIG_SOC_CPU_HAS_LOCKUP_RESET=y
-CONFIG_SOC_SIMD_PREFERRED_DATA_ALIGNMENT=16
-CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096
-CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16
-CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100
-CONFIG_SOC_DMA_CAN_ACCESS_FLASH=y
-CONFIG_SOC_AHB_GDMA_VERSION=2
-CONFIG_SOC_GDMA_SUPPORT_CRC=y
-CONFIG_SOC_GDMA_NUM_GROUPS_MAX=2
-CONFIG_SOC_GDMA_PAIRS_PER_GROUP_MAX=3
-CONFIG_SOC_AXI_GDMA_SUPPORT_PSRAM=y
-CONFIG_SOC_GDMA_SUPPORT_ETM=y
-CONFIG_SOC_GDMA_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT=16
-CONFIG_SOC_DMA2D_GROUPS=1
-CONFIG_SOC_DMA2D_TX_CHANNELS_PER_GROUP=3
-CONFIG_SOC_DMA2D_RX_CHANNELS_PER_GROUP=2
-CONFIG_SOC_ETM_GROUPS=1
-CONFIG_SOC_ETM_CHANNELS_PER_GROUP=50
-CONFIG_SOC_ETM_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_GPIO_PORT=1
-CONFIG_SOC_GPIO_PIN_COUNT=55
-CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER=y
-CONFIG_SOC_GPIO_FLEX_GLITCH_FILTER_NUM=8
-CONFIG_SOC_GPIO_SUPPORT_PIN_HYS_FILTER=y
-CONFIG_SOC_GPIO_SUPPORT_ETM=y
-CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y
-CONFIG_SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP=y
-CONFIG_SOC_LP_IO_HAS_INDEPENDENT_WAKEUP_SOURCE=y
-CONFIG_SOC_LP_IO_CLOCK_IS_INDEPENDENT=y
-CONFIG_SOC_GPIO_VALID_GPIO_MASK=0x007FFFFFFFFFFFFF
-CONFIG_SOC_GPIO_IN_RANGE_MAX=54
-CONFIG_SOC_GPIO_OUT_RANGE_MAX=54
-CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK=0
-CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT=16
-CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x007FFFFFFFFF0000
-CONFIG_SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX=y
-CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=2
-CONFIG_SOC_CLOCKOUT_SUPPORT_CHANNEL_DIVIDER=y
-CONFIG_SOC_DEBUG_PROBE_NUM_UNIT=1
-CONFIG_SOC_DEBUG_PROBE_MAX_OUTPUT_WIDTH=16
-CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y
-CONFIG_SOC_RTCIO_PIN_COUNT=16
-CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y
-CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y
-CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y
-CONFIG_SOC_RTCIO_EDGE_WAKE_SUPPORTED=y
-CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8
-CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8
-CONFIG_SOC_DEDIC_PERIPH_ALWAYS_ENABLE=y
-CONFIG_SOC_ANA_CMPR_NUM=2
-CONFIG_SOC_ANA_CMPR_CAN_DISTINGUISH_EDGE=y
-CONFIG_SOC_ANA_CMPR_SUPPORT_ETM=y
-CONFIG_SOC_I2C_NUM=3
-CONFIG_SOC_HP_I2C_NUM=2
-CONFIG_SOC_I2C_FIFO_LEN=32
-CONFIG_SOC_I2C_CMD_REG_NUM=8
-CONFIG_SOC_I2C_SUPPORT_SLAVE=y
-CONFIG_SOC_I2C_SUPPORT_HW_FSM_RST=y
-CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y
-CONFIG_SOC_I2C_SUPPORT_XTAL=y
-CONFIG_SOC_I2C_SUPPORT_RTC=y
-CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y
-CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y
-CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y
-CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y
-CONFIG_SOC_I2C_SLAVE_SUPPORT_SLAVE_UNMATCH=y
-CONFIG_SOC_I2C_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_LP_I2C_NUM=1
-CONFIG_SOC_LP_I2C_FIFO_LEN=16
-CONFIG_SOC_I2S_NUM=3
-CONFIG_SOC_I2S_HW_VERSION_2=y
-CONFIG_SOC_I2S_SUPPORTS_ETM=y
-CONFIG_SOC_I2S_SUPPORTS_XTAL=y
-CONFIG_SOC_I2S_SUPPORTS_APLL=y
-CONFIG_SOC_I2S_SUPPORTS_PCM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y
-CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y
-CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y
-CONFIG_SOC_I2S_SUPPORTS_PDM_RX_HP_FILTER=y
-CONFIG_SOC_I2S_SUPPORTS_TX_SYNC_CNT=y
-CONFIG_SOC_I2S_SUPPORTS_TDM=y
-CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2
-CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4
-CONFIG_SOC_I2S_TDM_FULL_DATA_WIDTH=y
-CONFIG_SOC_I2S_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_LP_I2S_NUM=1
-CONFIG_SOC_ISP_BF_SUPPORTED=y
-CONFIG_SOC_ISP_CCM_SUPPORTED=y
-CONFIG_SOC_ISP_DEMOSAIC_SUPPORTED=y
-CONFIG_SOC_ISP_DVP_SUPPORTED=y
-CONFIG_SOC_ISP_SHARPEN_SUPPORTED=y
-CONFIG_SOC_ISP_COLOR_SUPPORTED=y
-CONFIG_SOC_ISP_LSC_SUPPORTED=y
-CONFIG_SOC_ISP_SHARE_CSI_BRG=y
-CONFIG_SOC_ISP_NUMS=1
-CONFIG_SOC_ISP_DVP_CTLR_NUMS=1
-CONFIG_SOC_ISP_AE_CTLR_NUMS=1
-CONFIG_SOC_ISP_AE_BLOCK_X_NUMS=5
-CONFIG_SOC_ISP_AE_BLOCK_Y_NUMS=5
-CONFIG_SOC_ISP_AF_CTLR_NUMS=1
-CONFIG_SOC_ISP_AF_WINDOW_NUMS=3
-CONFIG_SOC_ISP_BF_TEMPLATE_X_NUMS=3
-CONFIG_SOC_ISP_BF_TEMPLATE_Y_NUMS=3
-CONFIG_SOC_ISP_CCM_DIMENSION=3
-CONFIG_SOC_ISP_DEMOSAIC_GRAD_RATIO_INT_BITS=2
-CONFIG_SOC_ISP_DEMOSAIC_GRAD_RATIO_DEC_BITS=4
-CONFIG_SOC_ISP_DEMOSAIC_GRAD_RATIO_RES_BITS=26
-CONFIG_SOC_ISP_DVP_DATA_WIDTH_MAX=16
-CONFIG_SOC_ISP_SHARPEN_TEMPLATE_X_NUMS=3
-CONFIG_SOC_ISP_SHARPEN_TEMPLATE_Y_NUMS=3
-CONFIG_SOC_ISP_SHARPEN_H_FREQ_COEF_INT_BITS=3
-CONFIG_SOC_ISP_SHARPEN_H_FREQ_COEF_DEC_BITS=5
-CONFIG_SOC_ISP_SHARPEN_H_FREQ_COEF_RES_BITS=24
-CONFIG_SOC_ISP_SHARPEN_M_FREQ_COEF_INT_BITS=3
-CONFIG_SOC_ISP_SHARPEN_M_FREQ_COEF_DEC_BITS=5
-CONFIG_SOC_ISP_SHARPEN_M_FREQ_COEF_RES_BITS=24
-CONFIG_SOC_ISP_HIST_CTLR_NUMS=1
-CONFIG_SOC_ISP_HIST_BLOCK_X_NUMS=5
-CONFIG_SOC_ISP_HIST_BLOCK_Y_NUMS=5
-CONFIG_SOC_ISP_HIST_SEGMENT_NUMS=16
-CONFIG_SOC_ISP_HIST_INTERVAL_NUMS=15
-CONFIG_SOC_ISP_LSC_GRAD_RATIO_INT_BITS=2
-CONFIG_SOC_ISP_LSC_GRAD_RATIO_DEC_BITS=8
-CONFIG_SOC_ISP_LSC_GRAD_RATIO_RES_BITS=22
-CONFIG_SOC_LEDC_SUPPORT_PLL_DIV_CLOCK=y
-CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y
-CONFIG_SOC_LEDC_TIMER_NUM=4
-CONFIG_SOC_LEDC_CHANNEL_NUM=8
-CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20
-CONFIG_SOC_LEDC_GAMMA_CURVE_FADE_SUPPORTED=y
-CONFIG_SOC_LEDC_GAMMA_CURVE_FADE_RANGE_MAX=16
-CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y
-CONFIG_SOC_LEDC_FADE_PARAMS_BIT_WIDTH=10
-CONFIG_SOC_LEDC_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_MMU_PERIPH_NUM=2
-CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=2
-CONFIG_SOC_MMU_DI_VADDR_SHARED=y
-CONFIG_SOC_MMU_PER_EXT_MEM_TARGET=y
-CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000
-CONFIG_SOC_MPU_REGIONS_MAX_NUM=8
-CONFIG_SOC_PCNT_GROUPS=1
-CONFIG_SOC_PCNT_UNITS_PER_GROUP=4
-CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2
-CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2
-CONFIG_SOC_PCNT_SUPPORT_RUNTIME_THRES_UPDATE=y
-CONFIG_SOC_PCNT_SUPPORT_CLEAR_SIGNAL=y
-CONFIG_SOC_PCNT_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_RMT_GROUPS=1
-CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=4
-CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=4
-CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8
-CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48
-CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y
-CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y
-CONFIG_SOC_RMT_SUPPORT_TX_ASYNC_STOP=y
-CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y
-CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y
-CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y
-CONFIG_SOC_RMT_SUPPORT_TX_CARRIER_DATA_ONLY=y
-CONFIG_SOC_RMT_SUPPORT_XTAL=y
-CONFIG_SOC_RMT_SUPPORT_RC_FAST=y
-CONFIG_SOC_RMT_SUPPORT_DMA=y
-CONFIG_SOC_RMT_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_LCD_I80_SUPPORTED=y
-CONFIG_SOC_LCD_RGB_SUPPORTED=y
-CONFIG_SOC_LCDCAM_I80_NUM_BUSES=1
-CONFIG_SOC_LCDCAM_I80_BUS_WIDTH=24
-CONFIG_SOC_LCDCAM_RGB_NUM_PANELS=1
-CONFIG_SOC_LCDCAM_RGB_DATA_WIDTH=24
-CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y
-CONFIG_SOC_MCPWM_GROUPS=2
-CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3
-CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3
-CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_EVENT_COMPARATORS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2
-CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3
-CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y
-CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3
-CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3
-CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y
-CONFIG_SOC_MCPWM_SUPPORT_ETM=y
-CONFIG_SOC_MCPWM_SUPPORT_EVENT_COMPARATOR=y
-CONFIG_SOC_MCPWM_CAPTURE_CLK_FROM_GROUP=y
-CONFIG_SOC_MCPWM_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_USB_OTG_PERIPH_NUM=2
-CONFIG_SOC_USB_UTMI_PHY_NUM=1
-CONFIG_SOC_USB_UTMI_PHY_NO_POWER_OFF_ISO=y
-CONFIG_SOC_PARLIO_GROUPS=1
-CONFIG_SOC_PARLIO_TX_UNITS_PER_GROUP=1
-CONFIG_SOC_PARLIO_RX_UNITS_PER_GROUP=1
-CONFIG_SOC_PARLIO_TX_UNIT_MAX_DATA_WIDTH=16
-CONFIG_SOC_PARLIO_RX_UNIT_MAX_DATA_WIDTH=16
-CONFIG_SOC_PARLIO_TX_CLK_SUPPORT_GATING=y
-CONFIG_SOC_PARLIO_RX_CLK_SUPPORT_GATING=y
-CONFIG_SOC_PARLIO_RX_CLK_SUPPORT_OUTPUT=y
-CONFIG_SOC_PARLIO_TRANS_BIT_ALIGN=y
-CONFIG_SOC_PARLIO_TX_SUPPORT_LOOP_TRANSMISSION=y
-CONFIG_SOC_PARLIO_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_PARLIO_SUPPORT_SPI_LCD=y
-CONFIG_SOC_PARLIO_SUPPORT_I80_LCD=y
-CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4
-CONFIG_SOC_MPI_OPERATIONS_NUM=3
-CONFIG_SOC_RSA_MAX_BIT_LEN=4096
-CONFIG_SOC_SDMMC_USE_IOMUX=y
-CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y
-CONFIG_SOC_SDMMC_NUM_SLOTS=2
-CONFIG_SOC_SDMMC_DELAY_PHASE_NUM=4
-CONFIG_SOC_SDMMC_IO_POWER_EXTERNAL=y
-CONFIG_SOC_SDMMC_PSRAM_DMA_CAPABLE=y
-CONFIG_SOC_SDMMC_UHS_I_SUPPORTED=y
-CONFIG_SOC_SHA_DMA_MAX_BUFFER_SIZE=3968
-CONFIG_SOC_SHA_SUPPORT_DMA=y
-CONFIG_SOC_SHA_SUPPORT_RESUME=y
-CONFIG_SOC_SHA_GDMA=y
-CONFIG_SOC_SHA_SUPPORT_SHA1=y
-CONFIG_SOC_SHA_SUPPORT_SHA224=y
-CONFIG_SOC_SHA_SUPPORT_SHA256=y
-CONFIG_SOC_SHA_SUPPORT_SHA384=y
-CONFIG_SOC_SHA_SUPPORT_SHA512=y
-CONFIG_SOC_SHA_SUPPORT_SHA512_224=y
-CONFIG_SOC_SHA_SUPPORT_SHA512_256=y
-CONFIG_SOC_SHA_SUPPORT_SHA512_T=y
-CONFIG_SOC_ECDSA_SUPPORT_EXPORT_PUBKEY=y
-CONFIG_SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE=y
-CONFIG_SOC_ECDSA_USES_MPI=y
-CONFIG_SOC_SDM_GROUPS=1
-CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8
-CONFIG_SOC_SDM_CLK_SUPPORT_PLL_F80M=y
-CONFIG_SOC_SDM_CLK_SUPPORT_XTAL=y
-CONFIG_SOC_SPI_PERIPH_NUM=3
-CONFIG_SOC_SPI_MAX_CS_NUM=6
-CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64
-CONFIG_SOC_SPI_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y
-CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y
-CONFIG_SOC_SPI_SUPPORT_DDRCLK=y
-CONFIG_SOC_SPI_SUPPORT_CD_SIG=y
-CONFIG_SOC_SPI_SUPPORT_OCT=y
-CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y
-CONFIG_SOC_SPI_SUPPORT_CLK_RC_FAST=y
-CONFIG_SOC_SPI_SUPPORT_CLK_SPLL=y
-CONFIG_SOC_MSPI_HAS_INDEPENT_IOMUX=y
-CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y
-CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16
-CONFIG_SOC_LP_SPI_PERIPH_NUM=y
-CONFIG_SOC_LP_SPI_MAXIMUM_BUFFER_SIZE=64
-CONFIG_SOC_SPIRAM_XIP_SUPPORTED=y
-CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y
-CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y
-CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y
-CONFIG_SOC_SPI_MEM_SUPPORT_IDLE_INTR=y
-CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y
-CONFIG_SOC_SPI_MEM_SUPPORT_CHECK_SUS=y
-CONFIG_SOC_SPI_MEM_SUPPORT_TIMING_TUNING=y
-CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_DQS=y
-CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_FLASH_DELAY=y
-CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y
-CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y
-CONFIG_SOC_MEMSPI_FLASH_PSRAM_INDEPENDENT=y
-CONFIG_SOC_SYSTIMER_COUNTER_NUM=2
-CONFIG_SOC_SYSTIMER_ALARM_NUM=3
-CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32
-CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20
-CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y
-CONFIG_SOC_SYSTIMER_SUPPORT_RC_FAST=y
-CONFIG_SOC_SYSTIMER_INT_LEVEL=y
-CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y
-CONFIG_SOC_SYSTIMER_SUPPORT_ETM=y
-CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32
-CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16
-CONFIG_SOC_TIMER_GROUPS=2
-CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2
-CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54
-CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y
-CONFIG_SOC_TIMER_GROUP_SUPPORT_RC_FAST=y
-CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4
-CONFIG_SOC_TIMER_SUPPORT_ETM=y
-CONFIG_SOC_TIMER_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_MWDT_SUPPORT_XTAL=y
-CONFIG_SOC_MWDT_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_TOUCH_SENSOR_VERSION=3
-CONFIG_SOC_TOUCH_SENSOR_NUM=14
-CONFIG_SOC_TOUCH_MIN_CHAN_ID=1
-CONFIG_SOC_TOUCH_MAX_CHAN_ID=14
-CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y
-CONFIG_SOC_TOUCH_SUPPORT_BENCHMARK=y
-CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y
-CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y
-CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3
-CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y
-CONFIG_SOC_TOUCH_SUPPORT_FREQ_HOP=y
-CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=3
-CONFIG_SOC_TWAI_CONTROLLER_NUM=3
-CONFIG_SOC_TWAI_MASK_FILTER_NUM=1
-CONFIG_SOC_TWAI_CLK_SUPPORT_XTAL=y
-CONFIG_SOC_TWAI_BRP_MIN=2
-CONFIG_SOC_TWAI_BRP_MAX=32768
-CONFIG_SOC_TWAI_SUPPORTS_RX_STATUS=y
-CONFIG_SOC_TWAI_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_EFUSE_DIS_PAD_JTAG=y
-CONFIG_SOC_EFUSE_DIS_USB_JTAG=y
-CONFIG_SOC_EFUSE_DIS_DIRECT_BOOT=y
-CONFIG_SOC_EFUSE_SOFT_DIS_JTAG=y
-CONFIG_SOC_EFUSE_DIS_DOWNLOAD_MSPI=y
-CONFIG_SOC_EFUSE_ECDSA_KEY=y
-CONFIG_SOC_KEY_MANAGER_SUPPORT_KEY_DEPLOYMENT=y
-CONFIG_SOC_KEY_MANAGER_ECDSA_KEY_DEPLOY=y
-CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY=y
-CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY_XTS_AES_128=y
-CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY_XTS_AES_256=y
-CONFIG_SOC_SECURE_BOOT_V2_RSA=y
-CONFIG_SOC_SECURE_BOOT_V2_ECC=y
-CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3
-CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y
-CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y
-CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y
-CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y
-CONFIG_SOC_UART_NUM=6
-CONFIG_SOC_UART_HP_NUM=5
-CONFIG_SOC_UART_LP_NUM=1
-CONFIG_SOC_UART_FIFO_LEN=128
-CONFIG_SOC_LP_UART_FIFO_LEN=16
-CONFIG_SOC_UART_BITRATE_MAX=5000000
-CONFIG_SOC_UART_SUPPORT_PLL_F80M_CLK=y
-CONFIG_SOC_UART_SUPPORT_RTC_CLK=y
-CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y
-CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y
-CONFIG_SOC_UART_HAS_LP_UART=y
-CONFIG_SOC_UART_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y
-CONFIG_SOC_UART_WAKEUP_CHARS_SEQ_MAX_LEN=5
-CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y
-CONFIG_SOC_UART_WAKEUP_SUPPORT_FIFO_THRESH_MODE=y
-CONFIG_SOC_UART_WAKEUP_SUPPORT_START_BIT_MODE=y
-CONFIG_SOC_UART_WAKEUP_SUPPORT_CHAR_SEQ_MODE=y
-CONFIG_SOC_LP_I2S_SUPPORT_VAD=y
-CONFIG_SOC_UHCI_NUM=1
-CONFIG_SOC_COEX_HW_PTI=y
-CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21
-CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12
-CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y
-CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN=y
-CONFIG_SOC_PM_EXT1_WAKEUP_BY_PMU=y
-CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y
-CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y
-CONFIG_SOC_PM_SUPPORT_XTAL32K_PD=y
-CONFIG_SOC_PM_SUPPORT_RC32K_PD=y
-CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y
-CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y
-CONFIG_SOC_PM_SUPPORT_TOP_PD=y
-CONFIG_SOC_PM_SUPPORT_CNNT_PD=y
-CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y
-CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y
-CONFIG_SOC_PM_CPU_RETENTION_BY_SW=y
-CONFIG_SOC_PM_CACHE_RETENTION_BY_PAU=y
-CONFIG_SOC_PM_PAU_LINK_NUM=4
-CONFIG_SOC_PM_PAU_REGDMA_LINK_MULTI_ADDR=y
-CONFIG_SOC_PAU_IN_TOP_DOMAIN=y
-CONFIG_SOC_CPU_IN_TOP_DOMAIN=y
-CONFIG_SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE=y
-CONFIG_SOC_SLEEP_SYSTIMER_STALL_WORKAROUND=y
-CONFIG_SOC_SLEEP_TGWDT_STOP_WORKAROUND=y
-CONFIG_SOC_PM_RETENTION_MODULE_NUM=64
-CONFIG_SOC_PSRAM_VDD_POWER_MPLL=y
-CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y
-CONFIG_SOC_CLK_APLL_SUPPORTED=y
-CONFIG_SOC_CLK_MPLL_SUPPORTED=y
-CONFIG_SOC_CLK_SDIO_PLL_SUPPORTED=y
-CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y
-CONFIG_SOC_CLK_RC32K_SUPPORTED=y
-CONFIG_SOC_CLK_LP_FAST_SUPPORT_LP_PLL=y
-CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL=y
-CONFIG_SOC_PERIPH_CLK_CTRL_SHARED=y
-CONFIG_SOC_CLK_ANA_I2C_MST_HAS_ROOT_GATE=y
-CONFIG_SOC_TEMPERATURE_SENSOR_LP_PLL_SUPPORT=y
-CONFIG_SOC_TEMPERATURE_SENSOR_INTR_SUPPORT=y
-CONFIG_SOC_TSENS_IS_INDEPENDENT_FROM_ADC=y
-CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_ETM=y
-CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_SLEEP_RETENTION=y
-CONFIG_SOC_MEM_TCM_SUPPORTED=y
-CONFIG_SOC_MEM_NON_CONTIGUOUS_SRAM=y
-CONFIG_SOC_ASYNCHRONOUS_BUS_ERROR_MODE=y
-CONFIG_SOC_EMAC_IEEE1588V2_SUPPORTED=y
-CONFIG_SOC_EMAC_USE_MULTI_IO_MUX=y
-CONFIG_SOC_EMAC_MII_USE_GPIO_MATRIX=y
-CONFIG_SOC_JPEG_CODEC_SUPPORTED=y
-CONFIG_SOC_JPEG_DECODE_SUPPORTED=y
-CONFIG_SOC_JPEG_ENCODE_SUPPORTED=y
-CONFIG_SOC_LCDCAM_CAM_SUPPORT_RGB_YUV_CONV=y
-CONFIG_SOC_LCDCAM_CAM_PERIPH_NUM=1
-CONFIG_SOC_LCDCAM_CAM_DATA_WIDTH_MAX=16
-CONFIG_SOC_I3C_MASTER_PERIPH_NUM=y
-CONFIG_SOC_I3C_MASTER_ADDRESS_TABLE_NUM=12
-CONFIG_SOC_I3C_MASTER_COMMAND_TABLE_NUM=12
-CONFIG_SOC_LP_CORE_SUPPORT_ETM=y
-CONFIG_SOC_LP_CORE_SUPPORT_LP_ADC=y
-CONFIG_SOC_LP_CORE_SUPPORT_LP_VAD=y
-CONFIG_SOC_LP_CORE_SUPPORT_STORE_LOAD_EXCEPTIONS=y
-CONFIG_IDF_CMAKE=y
-CONFIG_IDF_TOOLCHAIN="gcc"
-CONFIG_IDF_TOOLCHAIN_GCC=y
-CONFIG_IDF_TARGET_ARCH_RISCV=y
-CONFIG_IDF_TARGET_ARCH="riscv"
-CONFIG_IDF_TARGET="esp32p4"
-CONFIG_IDF_INIT_VERSION="5.5.1"
-CONFIG_IDF_TARGET_ESP32P4=y
-CONFIG_IDF_FIRMWARE_CHIP_ID=0x0012
-
-#
-# Build type
-#
-CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y
-# CONFIG_APP_BUILD_TYPE_RAM is not set
-CONFIG_APP_BUILD_GENERATE_BINARIES=y
-CONFIG_APP_BUILD_BOOTLOADER=y
-CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y
-# CONFIG_APP_REPRODUCIBLE_BUILD is not set
-# CONFIG_APP_NO_BLOBS is not set
-# end of Build type
-
-#
-# Bootloader config
-#
-
-#
-# Bootloader manager
-#
-CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y
-CONFIG_BOOTLOADER_PROJECT_VER=1
-# end of Bootloader manager
-
-#
-# Application Rollback
-#
-# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set
-# end of Application Rollback
-
-#
-# Recovery Bootloader and Rollback
-#
-# end of Recovery Bootloader and Rollback
-
-CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x2000
-CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
-# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set
-# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set
-
-#
-# Log
-#
-CONFIG_BOOTLOADER_LOG_VERSION_1=y
-CONFIG_BOOTLOADER_LOG_VERSION=1
-# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
-# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
-# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
-CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
-# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
-# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
-CONFIG_BOOTLOADER_LOG_LEVEL=3
-
-#
-# Format
-#
-# CONFIG_BOOTLOADER_LOG_COLORS is not set
-CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y
-# end of Format
-
-#
-# Settings
-#
-CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y
-CONFIG_BOOTLOADER_LOG_MODE_TEXT=y
-# end of Settings
-# end of Log
-
-#
-# Serial Flash Configurations
-#
-# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set
-CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
-CONFIG_BOOTLOADER_FLASH_32BIT_ADDR=y
-CONFIG_BOOTLOADER_FLASH_NEEDS_32BIT_FEAT=y
-CONFIG_BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH=y
-# end of Serial Flash Configurations
-
-# CONFIG_BOOTLOADER_FACTORY_RESET is not set
-# CONFIG_BOOTLOADER_APP_TEST is not set
-CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y
-CONFIG_BOOTLOADER_WDT_ENABLE=y
-# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set
-CONFIG_BOOTLOADER_WDT_TIME_MS=9000
-# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set
-# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set
-# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set
-CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0
-# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set
-# end of Bootloader config
-
-#
-# Security features
-#
-CONFIG_SECURE_BOOT_V2_RSA_SUPPORTED=y
-CONFIG_SECURE_BOOT_V2_ECC_SUPPORTED=y
-CONFIG_SECURE_BOOT_V2_PREFERRED=y
-# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set
-# CONFIG_SECURE_BOOT is not set
-# CONFIG_SECURE_FLASH_ENC_ENABLED is not set
-CONFIG_SECURE_ROM_DL_MODE_ENABLED=y
-# end of Security features
-
-#
-# Application manager
-#
-CONFIG_APP_COMPILE_TIME_DATE=y
-# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
-# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
-# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set
-CONFIG_APP_RETRIEVE_LEN_ELF_SHA=9
-# end of Application manager
-
-CONFIG_ESP_ROM_HAS_CRC_LE=y
-CONFIG_ESP_ROM_HAS_CRC_BE=y
-CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y
-CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=6
-CONFIG_ESP_ROM_USB_OTG_NUM=5
-CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y
-CONFIG_ESP_ROM_GET_CLK_FREQ=y
-CONFIG_ESP_ROM_HAS_RVFPLIB=y
-CONFIG_ESP_ROM_HAS_HAL_WDT=y
-CONFIG_ESP_ROM_HAS_HAL_SYSTIMER=y
-CONFIG_ESP_ROM_SYSTIMER_INIT_PATCH=y
-CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y
-CONFIG_ESP_ROM_WDT_INIT_PATCH=y
-CONFIG_ESP_ROM_HAS_LP_ROM=y
-CONFIG_ESP_ROM_WITHOUT_REGI2C=y
-CONFIG_ESP_ROM_HAS_NEWLIB=y
-CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y
-CONFIG_ESP_ROM_HAS_NEWLIB_NANO_PRINTF_FLOAT_BUG=y
-CONFIG_ESP_ROM_HAS_VERSION=y
-CONFIG_ESP_ROM_CLIC_INT_TYPE_PATCH=y
-CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y
-CONFIG_ESP_ROM_HAS_SUBOPTIMAL_NEWLIB_ON_MISALIGNED_MEMORY=y
-
-#
-# Boot ROM Behavior
-#
-CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y
-# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set
-# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set
-# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set
-# end of Boot ROM Behavior
-
-#
-# Serial flasher config
-#
-# CONFIG_ESPTOOLPY_NO_STUB is not set
-# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set
-# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
-CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
-# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
-CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y
-CONFIG_ESPTOOLPY_FLASHMODE="dio"
-CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
-# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
-# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
-CONFIG_ESPTOOLPY_FLASHFREQ_VAL=80
-CONFIG_ESPTOOLPY_FLASHFREQ="80m"
-# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
-# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
-# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE="32MB"
-# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
-CONFIG_ESPTOOLPY_BEFORE_RESET=y
-# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
-CONFIG_ESPTOOLPY_BEFORE="default_reset"
-CONFIG_ESPTOOLPY_AFTER_RESET=y
-# CONFIG_ESPTOOLPY_AFTER_NORESET is not set
-CONFIG_ESPTOOLPY_AFTER="hard_reset"
-CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
-# end of Serial flasher config
-
-#
-# Partition Table
-#
-# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
-# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
-# CONFIG_PARTITION_TABLE_TWO_OTA is not set
-# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set
-CONFIG_PARTITION_TABLE_CUSTOM=y
-CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_OFFSET=0x8000
-CONFIG_PARTITION_TABLE_MD5=y
-# end of Partition Table
-
-#
-# Compiler options
-#
-CONFIG_COMPILER_OPTIMIZATION_DEBUG=y
-# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
-# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
-# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
-CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
-# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
-# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
-CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y
-# CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB is not set
-CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB=y
-CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
-# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set
-CONFIG_COMPILER_HIDE_PATHS_MACROS=y
-# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
-# CONFIG_COMPILER_CXX_RTTI is not set
-CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
-# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set
-# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
-# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
-# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set
-# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
-# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set
-CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y
-# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set
-# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set
-# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set
-# CONFIG_COMPILER_DUMP_RTL_FILES is not set
-CONFIG_COMPILER_RT_LIB_GCCLIB=y
-CONFIG_COMPILER_RT_LIB_NAME="gcc"
-CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y
-# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set
-# CONFIG_COMPILER_STATIC_ANALYZER is not set
-# end of Compiler options
-
-#
-# Component config
-#
-
-#
-# Application Level Tracing
-#
-# CONFIG_APPTRACE_DEST_JTAG is not set
-CONFIG_APPTRACE_DEST_NONE=y
-# CONFIG_APPTRACE_DEST_UART1 is not set
-# CONFIG_APPTRACE_DEST_UART2 is not set
-CONFIG_APPTRACE_DEST_UART_NONE=y
-CONFIG_APPTRACE_UART_TASK_PRIO=1
-CONFIG_APPTRACE_LOCK_ENABLE=y
-# end of Application Level Tracing
-
-#
-# Bluetooth
-#
-# CONFIG_BT_ENABLED is not set
-
-#
-# Common Options
-#
-# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set
-# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set
-# end of Common Options
-# end of Bluetooth
-
-#
-# Console Library
-#
-# CONFIG_CONSOLE_SORTED_HELP is not set
-# end of Console Library
-
-#
-# Driver Configurations
-#
-
-#
-# Legacy TWAI Driver Configurations
-#
-# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy TWAI Driver Configurations
-
-#
-# Legacy ADC Driver Configuration
-#
-# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set
-
-#
-# Legacy ADC Calibration Configuration
-#
-# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set
-# end of Legacy ADC Calibration Configuration
-# end of Legacy ADC Driver Configuration
-
-#
-# Legacy MCPWM Driver Configurations
-#
-# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy MCPWM Driver Configurations
-
-#
-# Legacy Timer Group Driver Configurations
-#
-# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy Timer Group Driver Configurations
-
-#
-# Legacy RMT Driver Configurations
-#
-# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy RMT Driver Configurations
-
-#
-# Legacy I2S Driver Configurations
-#
-# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy I2S Driver Configurations
-
-#
-# Legacy I2C Driver Configurations
-#
-# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy I2C Driver Configurations
-
-#
-# Legacy PCNT Driver Configurations
-#
-# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy PCNT Driver Configurations
-
-#
-# Legacy SDM Driver Configurations
-#
-# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy SDM Driver Configurations
-
-#
-# Legacy Temperature Sensor Driver Configurations
-#
-# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy Temperature Sensor Driver Configurations
-
-#
-# Legacy Touch Sensor Driver Configurations
-#
-# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set
-# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set
-# end of Legacy Touch Sensor Driver Configurations
-# end of Driver Configurations
-
-#
-# eFuse Bit Manager
-#
-# CONFIG_EFUSE_CUSTOM_TABLE is not set
-# CONFIG_EFUSE_VIRTUAL is not set
-CONFIG_EFUSE_MAX_BLK_LEN=256
-# end of eFuse Bit Manager
-
-#
-# ESP-TLS
-#
-CONFIG_ESP_TLS_USING_MBEDTLS=y
-# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set
-CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
-# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set
-# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set
-# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set
-# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set
-# CONFIG_ESP_TLS_PSK_VERIFICATION is not set
-# CONFIG_ESP_TLS_INSECURE is not set
-CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y
-# end of ESP-TLS
-
-#
-# ADC and ADC Calibration
-#
-# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set
-# CONFIG_ADC_ENABLE_DEBUG_LOG is not set
-# end of ADC and ADC Calibration
-
-#
-# Wireless Coexistence
-#
-# CONFIG_ESP_COEX_GPIO_DEBUG is not set
-# end of Wireless Coexistence
-
-#
-# Common ESP-related
-#
-CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
-# end of Common ESP-related
-
-#
-# ESP-Driver:Analog Comparator Configurations
-#
-CONFIG_ANA_CMPR_ISR_HANDLER_IN_IRAM=y
-# CONFIG_ANA_CMPR_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_ANA_CMPR_ISR_CACHE_SAFE is not set
-CONFIG_ANA_CMPR_OBJ_CACHE_SAFE=y
-# CONFIG_ANA_CMPR_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:Analog Comparator Configurations
-
-#
-# BitScrambler Configurations
-#
-# CONFIG_BITSCRAMBLER_CTRL_FUNC_IN_IRAM is not set
-# end of BitScrambler Configurations
-
-#
-# ESP-Driver:Camera Controller Configurations
-#
-# CONFIG_CAM_CTLR_MIPI_CSI_ISR_CACHE_SAFE is not set
-# CONFIG_CAM_CTLR_ISP_DVP_ISR_CACHE_SAFE is not set
-# CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE is not set
-# end of ESP-Driver:Camera Controller Configurations
-
-#
-# ESP-Driver:GPIO Configurations
-#
-# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:GPIO Configurations
-
-#
-# ESP-Driver:GPTimer Configurations
-#
-CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
-# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set
-CONFIG_GPTIMER_OBJ_CACHE_SAFE=y
-# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:GPTimer Configurations
-
-#
-# ESP-Driver:I2C Configurations
-#
-# CONFIG_I2C_ISR_IRAM_SAFE is not set
-# CONFIG_I2C_ENABLE_DEBUG_LOG is not set
-# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set
-CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y
-# end of ESP-Driver:I2C Configurations
-
-#
-# ESP-Driver:I2S Configurations
-#
-# CONFIG_I2S_ISR_IRAM_SAFE is not set
-# CONFIG_I2S_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:I2S Configurations
-
-#
-# ESP-Driver:ISP Configurations
-#
-# CONFIG_ISP_ISR_IRAM_SAFE is not set
-# CONFIG_ISP_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:ISP Configurations
-
-#
-# ESP-Driver:JPEG-Codec Configurations
-#
-# CONFIG_JPEG_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:JPEG-Codec Configurations
-
-#
-# ESP-Driver:LEDC Configurations
-#
-# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
-# end of ESP-Driver:LEDC Configurations
-
-#
-# ESP-Driver:MCPWM Configurations
-#
-CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y
-# CONFIG_MCPWM_ISR_CACHE_SAFE is not set
-# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set
-CONFIG_MCPWM_OBJ_CACHE_SAFE=y
-# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:MCPWM Configurations
-
-#
-# ESP-Driver:Parallel IO Configurations
-#
-CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=y
-CONFIG_PARLIO_RX_ISR_HANDLER_IN_IRAM=y
-# CONFIG_PARLIO_TX_ISR_CACHE_SAFE is not set
-# CONFIG_PARLIO_RX_ISR_CACHE_SAFE is not set
-CONFIG_PARLIO_OBJ_CACHE_SAFE=y
-# CONFIG_PARLIO_ENABLE_DEBUG_LOG is not set
-# CONFIG_PARLIO_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:Parallel IO Configurations
-
-#
-# ESP-Driver:PCNT Configurations
-#
-# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_PCNT_ISR_IRAM_SAFE is not set
-# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:PCNT Configurations
-
-#
-# ESP-Driver:RMT Configurations
-#
-CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y
-CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y
-CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y
-# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set
-# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set
-# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set
-CONFIG_RMT_OBJ_CACHE_SAFE=y
-# CONFIG_RMT_ENABLE_DEBUG_LOG is not set
-# CONFIG_RMT_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:RMT Configurations
-
-#
-# ESP-Driver:Sigma Delta Modulator Configurations
-#
-# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_SDM_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:Sigma Delta Modulator Configurations
-
-#
-# ESP-Driver:SPI Configurations
-#
-# CONFIG_SPI_MASTER_IN_IRAM is not set
-CONFIG_SPI_MASTER_ISR_IN_IRAM=y
-# CONFIG_SPI_SLAVE_IN_IRAM is not set
-CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
-# end of ESP-Driver:SPI Configurations
-
-#
-# ESP-Driver:Touch Sensor Configurations
-#
-# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set
-# CONFIG_TOUCH_ISR_IRAM_SAFE is not set
-# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set
-# CONFIG_TOUCH_SKIP_FSM_CHECK is not set
-# end of ESP-Driver:Touch Sensor Configurations
-
-#
-# ESP-Driver:Temperature Sensor Configurations
-#
-# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set
-# CONFIG_TEMP_SENSOR_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:Temperature Sensor Configurations
-
-#
-# ESP-Driver:TWAI Configurations
-#
-# CONFIG_TWAI_ISR_IN_IRAM is not set
-# CONFIG_TWAI_ISR_CACHE_SAFE is not set
-# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:TWAI Configurations
-
-#
-# ESP-Driver:UART Configurations
-#
-# CONFIG_UART_ISR_IN_IRAM is not set
-# end of ESP-Driver:UART Configurations
-
-#
-# ESP-Driver:UHCI Configurations
-#
-# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set
-# CONFIG_UHCI_ISR_CACHE_SAFE is not set
-# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set
-# end of ESP-Driver:UHCI Configurations
-
-#
-# ESP-Driver:USB Serial/JTAG Configuration
-#
-CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y
-# end of ESP-Driver:USB Serial/JTAG Configuration
-
-#
-# Ethernet
-#
-CONFIG_ETH_ENABLED=y
-CONFIG_ETH_USE_ESP32_EMAC=y
-CONFIG_ETH_PHY_INTERFACE_RMII=y
-CONFIG_ETH_DMA_BUFFER_SIZE=512
-CONFIG_ETH_DMA_RX_BUFFER_NUM=20
-CONFIG_ETH_DMA_TX_BUFFER_NUM=10
-# CONFIG_ETH_SOFT_FLOW_CONTROL is not set
-# CONFIG_ETH_IRAM_OPTIMIZATION is not set
-CONFIG_ETH_USE_SPI_ETHERNET=y
-# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set
-# CONFIG_ETH_SPI_ETHERNET_W5500 is not set
-# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set
-# CONFIG_ETH_USE_OPENETH is not set
-# CONFIG_ETH_TRANSMIT_MUTEX is not set
-# end of Ethernet
-
-#
-# Event Loop Library
-#
-# CONFIG_ESP_EVENT_LOOP_PROFILING is not set
-CONFIG_ESP_EVENT_POST_FROM_ISR=y
-CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y
-# end of Event Loop Library
-
-#
-# GDB Stub
-#
-CONFIG_ESP_GDBSTUB_ENABLED=y
-# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set
-CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y
-CONFIG_ESP_GDBSTUB_MAX_TASKS=32
-# end of GDB Stub
-
-#
-# ESP HID
-#
-CONFIG_ESPHID_TASK_SIZE_BT=2048
-CONFIG_ESPHID_TASK_SIZE_BLE=4096
-# end of ESP HID
-
-#
-# ESP HTTP client
-#
-CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
-# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
-# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set
-# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set
-CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000
-# end of ESP HTTP client
-
-#
-# HTTP Server
-#
-CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
-CONFIG_HTTPD_MAX_URI_LEN=512
-CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
-CONFIG_HTTPD_PURGE_BUF_LEN=32
-# CONFIG_HTTPD_LOG_PURGE_DATA is not set
-# CONFIG_HTTPD_WS_SUPPORT is not set
-# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set
-CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000
-# end of HTTP Server
-
-#
-# ESP HTTPS OTA
-#
-# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set
-# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set
-CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000
-# end of ESP HTTPS OTA
-
-#
-# ESP HTTPS server
-#
-# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set
-CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000
-# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set
-# end of ESP HTTPS server
-
-#
-# Hardware Settings
-#
-
-#
-# Chip revision
-#
-# CONFIG_ESP32P4_REV_MIN_0 is not set
-CONFIG_ESP32P4_REV_MIN_1=y
-# CONFIG_ESP32P4_REV_MIN_100 is not set
-CONFIG_ESP32P4_REV_MIN_FULL=1
-CONFIG_ESP_REV_MIN_FULL=1
-
-#
-# Maximum Supported ESP32-P4 Revision (Rev v1.99)
-#
-CONFIG_ESP32P4_REV_MAX_FULL=199
-CONFIG_ESP_REV_MAX_FULL=199
-CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0
-CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=99
-
-#
-# Maximum Supported ESP32-P4 eFuse Block Revision (eFuse Block Rev v0.99)
-#
-# end of Chip revision
-
-#
-# MAC Config
-#
-CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y
-CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_ONE=y
-CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=1
-CONFIG_ESP32P4_UNIVERSAL_MAC_ADDRESSES_ONE=y
-CONFIG_ESP32P4_UNIVERSAL_MAC_ADDRESSES=1
-# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set
-# end of MAC Config
-
-#
-# Sleep Config
-#
-CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y
-# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set
-# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set
-CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=0
-# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set
-# CONFIG_ESP_SLEEP_DEBUG is not set
-CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y
-# end of Sleep Config
-
-#
-# RTC Clock Config
-#
-CONFIG_RTC_CLK_SRC_INT_RC=y
-# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set
-CONFIG_RTC_CLK_CAL_CYCLES=1024
-CONFIG_RTC_FAST_CLK_SRC_RC_FAST=y
-# CONFIG_RTC_FAST_CLK_SRC_XTAL is not set
-# end of RTC Clock Config
-
-#
-# Peripheral Control
-#
-CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y
-CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y
-# end of Peripheral Control
-
-#
-# ETM Configuration
-#
-# CONFIG_ETM_ENABLE_DEBUG_LOG is not set
-# end of ETM Configuration
-
-#
-# GDMA Configurations
-#
-CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y
-CONFIG_GDMA_ISR_HANDLER_IN_IRAM=y
-CONFIG_GDMA_OBJ_DRAM_SAFE=y
-# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set
-# CONFIG_GDMA_ISR_IRAM_SAFE is not set
-# end of GDMA Configurations
-
-#
-# DW_GDMA Configurations
-#
-# CONFIG_DW_GDMA_ENABLE_DEBUG_LOG is not set
-# end of DW_GDMA Configurations
-
-#
-# 2D-DMA Configurations
-#
-# CONFIG_DMA2D_OPERATION_FUNC_IN_IRAM is not set
-# CONFIG_DMA2D_ISR_IRAM_SAFE is not set
-# end of 2D-DMA Configurations
-
-#
-# Main XTAL Config
-#
-CONFIG_XTAL_FREQ_40=y
-CONFIG_XTAL_FREQ=40
-# end of Main XTAL Config
-
-#
-# DCDC Regulator Configurations
-#
-CONFIG_ESP_SLEEP_KEEP_DCDC_ALWAYS_ON=y
-CONFIG_ESP_SLEEP_DCM_VSET_VAL_IN_SLEEP=14
-# end of DCDC Regulator Configurations
-
-#
-# LDO Regulator Configurations
-#
-CONFIG_ESP_LDO_RESERVE_SPI_NOR_FLASH=y
-CONFIG_ESP_LDO_CHAN_SPI_NOR_FLASH_DOMAIN=1
-CONFIG_ESP_LDO_VOLTAGE_SPI_NOR_FLASH_3300_MV=y
-CONFIG_ESP_LDO_VOLTAGE_SPI_NOR_FLASH_DOMAIN=3300
-CONFIG_ESP_LDO_RESERVE_PSRAM=y
-CONFIG_ESP_LDO_CHAN_PSRAM_DOMAIN=2
-CONFIG_ESP_LDO_VOLTAGE_PSRAM_1900_MV=y
-CONFIG_ESP_LDO_VOLTAGE_PSRAM_DOMAIN=1900
-# end of LDO Regulator Configurations
-
-#
-# Power Supplier
-#
-
-#
-# Brownout Detector
-#
-CONFIG_ESP_BROWNOUT_DET=y
-CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y
-# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set
-# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set
-CONFIG_ESP_BROWNOUT_DET_LVL=7
-CONFIG_ESP_BROWNOUT_USE_INTR=y
-# end of Brownout Detector
-
-#
-# RTC Backup Battery
-#
-# CONFIG_ESP_VBAT_INIT_AUTO is not set
-# CONFIG_ESP_VBAT_WAKEUP_CHIP_ON_VBAT_BROWNOUT is not set
-# end of RTC Backup Battery
-# end of Power Supplier
-
-CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y
-CONFIG_ESP_ENABLE_PVT=y
-CONFIG_ESP_INTR_IN_IRAM=y
-# end of Hardware Settings
-
-#
-# ESP-Driver:LCD Controller Configurations
-#
-# CONFIG_LCD_ENABLE_DEBUG_LOG is not set
-# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set
-# CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set
-# CONFIG_LCD_DSI_ISR_IRAM_SAFE is not set
-# end of ESP-Driver:LCD Controller Configurations
-
-#
-# ESP-MM: Memory Management Configurations
-#
-# CONFIG_ESP_MM_CACHE_MSYNC_C2M_CHUNKED_OPS is not set
-# end of ESP-MM: Memory Management Configurations
-
-#
-# ESP NETIF Adapter
-#
-CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120
-# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set
-CONFIG_ESP_NETIF_TCPIP_LWIP=y
-# CONFIG_ESP_NETIF_LOOPBACK is not set
-CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y
-CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y
-# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set
-# CONFIG_ESP_NETIF_L2_TAP is not set
-# CONFIG_ESP_NETIF_BRIDGE_EN is not set
-# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set
-# end of ESP NETIF Adapter
-
-#
-# Partition API Configuration
-#
-# end of Partition API Configuration
-
-#
-# PHY
-#
-# end of PHY
-
-#
-# Power Management
-#
-CONFIG_PM_SLEEP_FUNC_IN_IRAM=y
-# CONFIG_PM_ENABLE is not set
-CONFIG_PM_SLP_IRAM_OPT=y
-# CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP is not set
-# end of Power Management
-
-#
-# ESP PSRAM
-#
-# CONFIG_SPIRAM is not set
-# end of ESP PSRAM
-
-#
-# ESP Ringbuf
-#
-# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set
-# end of ESP Ringbuf
-
-#
-# ESP-ROM
-#
-CONFIG_ESP_ROM_PRINT_IN_IRAM=y
-# end of ESP-ROM
-
-#
-# ESP Security Specific
-#
-# end of ESP Security Specific
-
-#
-# ESP System Settings
-#
-CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_360=y
-CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=360
-
-#
-# Cache config
-#
-CONFIG_CACHE_L2_CACHE_128KB=y
-# CONFIG_CACHE_L2_CACHE_256KB is not set
-# CONFIG_CACHE_L2_CACHE_512KB is not set
-CONFIG_CACHE_L2_CACHE_SIZE=0x20000
-CONFIG_CACHE_L2_CACHE_LINE_64B=y
-# CONFIG_CACHE_L2_CACHE_LINE_128B is not set
-CONFIG_CACHE_L2_CACHE_LINE_SIZE=64
-CONFIG_CACHE_L1_CACHE_LINE_SIZE=64
-# end of Cache config
-
-CONFIG_ESP_SYSTEM_IN_IRAM=y
-# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set
-CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
-# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
-# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set
-CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0
-CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y
-CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y
-CONFIG_ESP_SYSTEM_NO_BACKTRACE=y
-# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set
-# CONFIG_ESP_SYSTEM_USE_FRAME_POINTER is not set
-
-#
-# Memory protection
-#
-CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=y
-# CONFIG_ESP_SYSTEM_PMP_LP_CORE_RESERVE_MEM_EXECUTABLE is not set
-# end of Memory protection
-
-CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32
-CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304
-CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584
-CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y
-# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set
-# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set
-CONFIG_ESP_MAIN_TASK_AFFINITY=0x0
-CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048
-CONFIG_ESP_CONSOLE_UART_DEFAULT=y
-# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set
-# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
-# CONFIG_ESP_CONSOLE_NONE is not set
-# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set
-CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
-CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
-CONFIG_ESP_CONSOLE_UART=y
-CONFIG_ESP_CONSOLE_UART_NUM=0
-CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0
-CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
-CONFIG_ESP_INT_WDT=y
-CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
-CONFIG_ESP_INT_WDT_CHECK_CPU1=y
-CONFIG_ESP_TASK_WDT_EN=y
-CONFIG_ESP_TASK_WDT_INIT=y
-# CONFIG_ESP_TASK_WDT_PANIC is not set
-CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
-CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
-CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
-# CONFIG_ESP_PANIC_HANDLER_IRAM is not set
-# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set
-CONFIG_ESP_DEBUG_OCDAWARE=y
-CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y
-CONFIG_ESP_SYSTEM_HW_STACK_GUARD=y
-CONFIG_ESP_SYSTEM_HW_PC_RECORD=y
-# end of ESP System Settings
-
-#
-# IPC (Inter-Processor Call)
-#
-CONFIG_ESP_IPC_ENABLE=y
-CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
-CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y
-CONFIG_ESP_IPC_ISR_ENABLE=y
-# end of IPC (Inter-Processor Call)
-
-#
-# ESP Timer (High Resolution Timer)
-#
-CONFIG_ESP_TIMER_IN_IRAM=y
-# CONFIG_ESP_TIMER_PROFILING is not set
-CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y
-CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y
-CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584
-CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1
-# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set
-CONFIG_ESP_TIMER_TASK_AFFINITY=0x0
-CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y
-CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y
-# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set
-CONFIG_ESP_TIMER_IMPL_SYSTIMER=y
-# end of ESP Timer (High Resolution Timer)
-
-#
-# Wi-Fi
-#
-# CONFIG_ESP_HOST_WIFI_ENABLED is not set
-# end of Wi-Fi
-
-#
-# Core dump
-#
-# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set
-# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set
-CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y
-# end of Core dump
-
-#
-# FAT Filesystem support
-#
-CONFIG_FATFS_VOLUME_COUNT=2
-CONFIG_FATFS_LFN_NONE=y
-# CONFIG_FATFS_LFN_HEAP is not set
-# CONFIG_FATFS_LFN_STACK is not set
-# CONFIG_FATFS_SECTOR_512 is not set
-CONFIG_FATFS_SECTOR_4096=y
-# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set
-CONFIG_FATFS_CODEPAGE_437=y
-# CONFIG_FATFS_CODEPAGE_720 is not set
-# CONFIG_FATFS_CODEPAGE_737 is not set
-# CONFIG_FATFS_CODEPAGE_771 is not set
-# CONFIG_FATFS_CODEPAGE_775 is not set
-# CONFIG_FATFS_CODEPAGE_850 is not set
-# CONFIG_FATFS_CODEPAGE_852 is not set
-# CONFIG_FATFS_CODEPAGE_855 is not set
-# CONFIG_FATFS_CODEPAGE_857 is not set
-# CONFIG_FATFS_CODEPAGE_860 is not set
-# CONFIG_FATFS_CODEPAGE_861 is not set
-# CONFIG_FATFS_CODEPAGE_862 is not set
-# CONFIG_FATFS_CODEPAGE_863 is not set
-# CONFIG_FATFS_CODEPAGE_864 is not set
-# CONFIG_FATFS_CODEPAGE_865 is not set
-# CONFIG_FATFS_CODEPAGE_866 is not set
-# CONFIG_FATFS_CODEPAGE_869 is not set
-# CONFIG_FATFS_CODEPAGE_932 is not set
-# CONFIG_FATFS_CODEPAGE_936 is not set
-# CONFIG_FATFS_CODEPAGE_949 is not set
-# CONFIG_FATFS_CODEPAGE_950 is not set
-CONFIG_FATFS_CODEPAGE=437
-CONFIG_FATFS_FS_LOCK=0
-CONFIG_FATFS_TIMEOUT_MS=10000
-CONFIG_FATFS_PER_FILE_CACHE=y
-# CONFIG_FATFS_USE_FASTSEEK is not set
-CONFIG_FATFS_USE_STRFUNC_NONE=y
-# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set
-# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set
-CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0
-# CONFIG_FATFS_IMMEDIATE_FSYNC is not set
-# CONFIG_FATFS_USE_LABEL is not set
-CONFIG_FATFS_LINK_LOCK=y
-# CONFIG_FATFS_USE_DYN_BUFFERS is not set
-
-#
-# File system free space calculation behavior
-#
-CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0
-CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0
-# end of File system free space calculation behavior
-# end of FAT Filesystem support
-
-#
-# FreeRTOS
-#
-
-#
-# Kernel
-#
-# CONFIG_FREERTOS_UNICORE is not set
-CONFIG_FREERTOS_HZ=100
-# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set
-# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
-CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
-CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
-CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
-# CONFIG_FREERTOS_USE_IDLE_HOOK is not set
-# CONFIG_FREERTOS_USE_TICK_HOOK is not set
-CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
-# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set
-CONFIG_FREERTOS_USE_TIMERS=y
-CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc"
-# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set
-# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set
-CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y
-CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF
-CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1
-CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048
-CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10
-CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
-CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
-# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set
-# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set
-# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set
-# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set
-# end of Kernel
-
-#
-# Port
-#
-CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
-# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
-CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y
-# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set
-# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set
-CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y
-CONFIG_FREERTOS_ISR_STACKSIZE=1536
-CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y
-CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y
-CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y
-# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set
-CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y
-# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set
-# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set
-# end of Port
-
-#
-# Extra
-#
-# end of Extra
-
-CONFIG_FREERTOS_PORT=y
-CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF
-CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
-CONFIG_FREERTOS_DEBUG_OCDAWARE=y
-CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y
-CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
-CONFIG_FREERTOS_NUMBER_OF_CORES=2
-CONFIG_FREERTOS_IN_IRAM=y
-# end of FreeRTOS
-
-#
-# Hardware Abstraction Layer (HAL) and Low Level (LL)
-#
-CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y
-# CONFIG_HAL_ASSERTION_DISABLE is not set
-# CONFIG_HAL_ASSERTION_SILENT is not set
-# CONFIG_HAL_ASSERTION_ENABLE is not set
-CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2
-CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=y
-CONFIG_HAL_WDT_USE_ROM_IMPL=y
-# end of Hardware Abstraction Layer (HAL) and Low Level (LL)
-
-#
-# Heap memory debugging
-#
-CONFIG_HEAP_POISONING_DISABLED=y
-# CONFIG_HEAP_POISONING_LIGHT is not set
-# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set
-CONFIG_HEAP_TRACING_OFF=y
-# CONFIG_HEAP_TRACING_STANDALONE is not set
-# CONFIG_HEAP_TRACING_TOHOST is not set
-# CONFIG_HEAP_USE_HOOKS is not set
-# CONFIG_HEAP_TASK_TRACKING is not set
-# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set
-# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set
-# end of Heap memory debugging
-
-#
-# Log
-#
-CONFIG_LOG_VERSION_1=y
-# CONFIG_LOG_VERSION_2 is not set
-CONFIG_LOG_VERSION=1
-
-#
-# Log Level
-#
-# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
-# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
-# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
-CONFIG_LOG_DEFAULT_LEVEL_INFO=y
-# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
-# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
-CONFIG_LOG_DEFAULT_LEVEL=3
-CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
-# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
-# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
-CONFIG_LOG_MAXIMUM_LEVEL=3
-
-#
-# Level Settings
-#
-# CONFIG_LOG_MASTER_LEVEL is not set
-CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y
-# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set
-# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set
-CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y
-# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set
-CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y
-CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31
-# end of Level Settings
-# end of Log Level
-
-#
-# Format
-#
-# CONFIG_LOG_COLORS is not set
-CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
-# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
-# end of Format
-
-#
-# Settings
-#
-CONFIG_LOG_MODE_TEXT_EN=y
-CONFIG_LOG_MODE_TEXT=y
-# end of Settings
-
-CONFIG_LOG_IN_IRAM=y
-# end of Log
-
-#
-# LWIP
-#
-CONFIG_LWIP_ENABLE=y
-CONFIG_LWIP_LOCAL_HOSTNAME="espressif"
-CONFIG_LWIP_TCPIP_TASK_PRIO=18
-# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set
-# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set
-CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
-# CONFIG_LWIP_L2_TO_L3_COPY is not set
-# CONFIG_LWIP_IRAM_OPTIMIZATION is not set
-# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set
-CONFIG_LWIP_TIMERS_ONDEMAND=y
-CONFIG_LWIP_ND6=y
-# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set
-CONFIG_LWIP_MAX_SOCKETS=10
-# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set
-# CONFIG_LWIP_SO_LINGER is not set
-CONFIG_LWIP_SO_REUSE=y
-CONFIG_LWIP_SO_REUSE_RXTOALL=y
-# CONFIG_LWIP_SO_RCVBUF is not set
-# CONFIG_LWIP_NETBUF_RECVINFO is not set
-CONFIG_LWIP_IP_DEFAULT_TTL=64
-CONFIG_LWIP_IP4_FRAG=y
-CONFIG_LWIP_IP6_FRAG=y
-# CONFIG_LWIP_IP4_REASSEMBLY is not set
-# CONFIG_LWIP_IP6_REASSEMBLY is not set
-CONFIG_LWIP_IP_REASS_MAX_PBUFS=10
-# CONFIG_LWIP_IP_FORWARD is not set
-# CONFIG_LWIP_STATS is not set
-CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
-CONFIG_LWIP_GARP_TMR_INTERVAL=60
-CONFIG_LWIP_ESP_MLDV6_REPORT=y
-CONFIG_LWIP_MLDV6_TMR_INTERVAL=40
-CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
-CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
-# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set
-# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set
-# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set
-CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y
-# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set
-CONFIG_LWIP_DHCP_OPTIONS_LEN=69
-CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0
-CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1
-
-#
-# DHCP server
-#
-CONFIG_LWIP_DHCPS=y
-CONFIG_LWIP_DHCPS_LEASE_UNIT=60
-CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
-CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y
-CONFIG_LWIP_DHCPS_ADD_DNS=y
-# end of DHCP server
-
-# CONFIG_LWIP_AUTOIP is not set
-CONFIG_LWIP_IPV4=y
-CONFIG_LWIP_IPV6=y
-# CONFIG_LWIP_IPV6_AUTOCONFIG is not set
-CONFIG_LWIP_IPV6_NUM_ADDRESSES=3
-# CONFIG_LWIP_IPV6_FORWARD is not set
-# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set
-CONFIG_LWIP_NETIF_LOOPBACK=y
-CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
-
-#
-# TCP
-#
-CONFIG_LWIP_MAX_ACTIVE_TCP=16
-CONFIG_LWIP_MAX_LISTENING_TCP=16
-CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y
-CONFIG_LWIP_TCP_MAXRTX=12
-CONFIG_LWIP_TCP_SYNMAXRTX=12
-CONFIG_LWIP_TCP_MSS=1440
-CONFIG_LWIP_TCP_TMR_INTERVAL=250
-CONFIG_LWIP_TCP_MSL=60000
-CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000
-CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760
-CONFIG_LWIP_TCP_WND_DEFAULT=5760
-CONFIG_LWIP_TCP_RECVMBOX_SIZE=6
-CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6
-CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
-CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6
-CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4
-# CONFIG_LWIP_TCP_SACK_OUT is not set
-CONFIG_LWIP_TCP_OVERSIZE_MSS=y
-# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set
-# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set
-CONFIG_LWIP_TCP_RTO_TIME=1500
-# end of TCP
-
-#
-# UDP
-#
-CONFIG_LWIP_MAX_UDP_PCBS=16
-CONFIG_LWIP_UDP_RECVMBOX_SIZE=6
-# end of UDP
-
-#
-# Checksums
-#
-# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set
-# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set
-CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y
-# end of Checksums
-
-CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072
-CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
-# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set
-# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set
-CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF
-CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3
-CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5
-CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5
-CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3
-CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10
-# CONFIG_LWIP_PPP_SUPPORT is not set
-# CONFIG_LWIP_SLIP_SUPPORT is not set
-
-#
-# ICMP
-#
-CONFIG_LWIP_ICMP=y
-# CONFIG_LWIP_MULTICAST_PING is not set
-# CONFIG_LWIP_BROADCAST_PING is not set
-# end of ICMP
-
-#
-# LWIP RAW API
-#
-CONFIG_LWIP_MAX_RAW_PCBS=16
-# end of LWIP RAW API
-
-#
-# SNTP
-#
-CONFIG_LWIP_SNTP_MAX_SERVERS=1
-# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set
-CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
-CONFIG_LWIP_SNTP_STARTUP_DELAY=y
-CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000
-# end of SNTP
-
-#
-# DNS
-#
-CONFIG_LWIP_DNS_MAX_HOST_IP=1
-CONFIG_LWIP_DNS_MAX_SERVERS=3
-# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set
-# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set
-# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set
-# end of DNS
-
-CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7
-CONFIG_LWIP_ESP_LWIP_ASSERT=y
-
-#
-# Hooks
-#
-# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set
-CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y
-# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set
-CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y
-# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set
-# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set
-CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y
-# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set
-# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set
-CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y
-# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set
-# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set
-CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y
-# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set
-# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set
-CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y
-# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set
-# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set
-CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y
-# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set
-# CONFIG_LWIP_HOOK_IP6_INPUT_NONE is not set
-CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT=y
-# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set
-# end of Hooks
-
-# CONFIG_LWIP_DEBUG is not set
-# end of LWIP
-
-#
-# mbedTLS
-#
-CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
-# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set
-# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set
-CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y
-CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384
-CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096
-# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set
-# CONFIG_MBEDTLS_DEBUG is not set
-
-#
-# mbedTLS v3.x related
-#
-# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set
-# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set
-# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set
-# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set
-CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y
-# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set
-CONFIG_MBEDTLS_PKCS7_C=y
-# end of mbedTLS v3.x related
-
-#
-# Certificate Bundle
-#
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
-# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set
-# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set
-# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set
-# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
-# end of Certificate Bundle
-
-# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set
-# CONFIG_MBEDTLS_CMAC_C is not set
-CONFIG_MBEDTLS_HARDWARE_AES=y
-CONFIG_MBEDTLS_AES_USE_INTERRUPT=y
-CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0
-CONFIG_MBEDTLS_HARDWARE_GCM=y
-CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y
-CONFIG_MBEDTLS_HARDWARE_MPI=y
-# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set
-CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y
-CONFIG_MBEDTLS_MPI_INTERRUPT_LEVEL=0
-CONFIG_MBEDTLS_HARDWARE_SHA=y
-CONFIG_MBEDTLS_HARDWARE_ECC=y
-CONFIG_MBEDTLS_ECC_OTHER_CURVES_SOFT_FALLBACK=y
-CONFIG_MBEDTLS_ROM_MD5=y
-# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set
-# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set
-CONFIG_MBEDTLS_HAVE_TIME=y
-# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set
-# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set
-CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y
-CONFIG_MBEDTLS_SHA1_C=y
-CONFIG_MBEDTLS_SHA512_C=y
-# CONFIG_MBEDTLS_SHA3_C is not set
-CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
-# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set
-# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set
-# CONFIG_MBEDTLS_TLS_DISABLED is not set
-CONFIG_MBEDTLS_TLS_SERVER=y
-CONFIG_MBEDTLS_TLS_CLIENT=y
-CONFIG_MBEDTLS_TLS_ENABLED=y
-
-#
-# TLS Key Exchange Methods
-#
-# CONFIG_MBEDTLS_PSK_MODES is not set
-CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
-CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
-# end of TLS Key Exchange Methods
-
-CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
-CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
-# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set
-# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set
-CONFIG_MBEDTLS_SSL_ALPN=y
-CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y
-CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y
-
-#
-# Symmetric Ciphers
-#
-CONFIG_MBEDTLS_AES_C=y
-# CONFIG_MBEDTLS_CAMELLIA_C is not set
-# CONFIG_MBEDTLS_DES_C is not set
-# CONFIG_MBEDTLS_BLOWFISH_C is not set
-# CONFIG_MBEDTLS_XTEA_C is not set
-CONFIG_MBEDTLS_CCM_C=y
-CONFIG_MBEDTLS_GCM_C=y
-# CONFIG_MBEDTLS_NIST_KW_C is not set
-# end of Symmetric Ciphers
-
-# CONFIG_MBEDTLS_RIPEMD160_C is not set
-
-#
-# Certificates
-#
-CONFIG_MBEDTLS_PEM_PARSE_C=y
-CONFIG_MBEDTLS_PEM_WRITE_C=y
-CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
-CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
-# end of Certificates
-
-CONFIG_MBEDTLS_ECP_C=y
-CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y
-CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y
-# CONFIG_MBEDTLS_DHM_C is not set
-CONFIG_MBEDTLS_ECDH_C=y
-CONFIG_MBEDTLS_ECDSA_C=y
-# CONFIG_MBEDTLS_ECJPAKE_C is not set
-CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
-CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
-CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
-# CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is not set
-# CONFIG_MBEDTLS_POLY1305_C is not set
-# CONFIG_MBEDTLS_CHACHA20_C is not set
-# CONFIG_MBEDTLS_HKDF_C is not set
-# CONFIG_MBEDTLS_THREADING_C is not set
-CONFIG_MBEDTLS_ERROR_STRINGS=y
-CONFIG_MBEDTLS_FS_IO=y
-# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set
-# end of mbedTLS
-
-#
-# ESP-MQTT Configurations
-#
-CONFIG_MQTT_PROTOCOL_311=y
-# CONFIG_MQTT_PROTOCOL_5 is not set
-CONFIG_MQTT_TRANSPORT_SSL=y
-CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
-CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
-# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set
-# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set
-# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set
-# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set
-# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set
-# CONFIG_MQTT_CUSTOM_OUTBOX is not set
-# end of ESP-MQTT Configurations
-
-#
-# LibC
-#
-CONFIG_LIBC_NEWLIB=y
-CONFIG_LIBC_MISC_IN_IRAM=y
-CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y
-CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y
-# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set
-# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set
-# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set
-# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set
-CONFIG_LIBC_STDIN_LINE_ENDING_CR=y
-# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set
-CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y
-# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set
-# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set
-# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set
-# CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS is not set
-# end of LibC
-
-#
-# NVS
-#
-# CONFIG_NVS_ENCRYPTION is not set
-# CONFIG_NVS_ASSERT_ERROR_CHECK is not set
-# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set
-# end of NVS
-
-#
-# OpenThread
-#
-# CONFIG_OPENTHREAD_ENABLED is not set
-
-#
-# OpenThread Spinel
-#
-# CONFIG_OPENTHREAD_SPINEL_ONLY is not set
-# end of OpenThread Spinel
-# end of OpenThread
-
-#
-# Protocomm
-#
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y
-# end of Protocomm
-
-#
-# PThreads
-#
-CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y
-# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set
-# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set
-CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1
-CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
-# end of PThreads
-
-#
-# MMU Config
-#
-CONFIG_MMU_PAGE_SIZE_64KB=y
-CONFIG_MMU_PAGE_MODE="64KB"
-CONFIG_MMU_PAGE_SIZE=0x10000
-# end of MMU Config
-
-#
-# Main Flash configuration
-#
-
-#
-# SPI Flash behavior when brownout
-#
-CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y
-CONFIG_SPI_FLASH_BROWNOUT_RESET=y
-# end of SPI Flash behavior when brownout
-
-#
-# Optional and Experimental Features (READ DOCS FIRST)
-#
-
-#
-# Features here require specific hardware (READ DOCS FIRST!)
-#
-# CONFIG_SPI_FLASH_HPM_ENA is not set
-CONFIG_SPI_FLASH_HPM_AUTO=y
-# CONFIG_SPI_FLASH_HPM_DIS is not set
-CONFIG_SPI_FLASH_HPM_ON=y
-CONFIG_SPI_FLASH_HPM_DC_AUTO=y
-# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set
-# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set
-CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50
-# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set
-# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set
-CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y
-# end of Optional and Experimental Features (READ DOCS FIRST)
-# end of Main Flash configuration
-
-#
-# SPI Flash driver
-#
-# CONFIG_SPI_FLASH_VERIFY_WRITE is not set
-# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set
-CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
-CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
-# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set
-# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set
-# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set
-CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y
-CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20
-CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1
-CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192
-# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set
-# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set
-# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set
-
-#
-# Auto-detect flash chips
-#
-CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y
-CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y
-# CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP is not set
-# CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP is not set
-CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y
-# CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP is not set
-# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set
-# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set
-# end of Auto-detect flash chips
-
-CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y
-# end of SPI Flash driver
-
-#
-# SPIFFS Configuration
-#
-CONFIG_SPIFFS_MAX_PARTITIONS=3
-
-#
-# SPIFFS Cache Configuration
-#
-CONFIG_SPIFFS_CACHE=y
-CONFIG_SPIFFS_CACHE_WR=y
-# CONFIG_SPIFFS_CACHE_STATS is not set
-# end of SPIFFS Cache Configuration
-
-CONFIG_SPIFFS_PAGE_CHECK=y
-CONFIG_SPIFFS_GC_MAX_RUNS=10
-# CONFIG_SPIFFS_GC_STATS is not set
-CONFIG_SPIFFS_PAGE_SIZE=256
-CONFIG_SPIFFS_OBJ_NAME_LEN=32
-# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set
-CONFIG_SPIFFS_USE_MAGIC=y
-CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
-CONFIG_SPIFFS_META_LENGTH=4
-CONFIG_SPIFFS_USE_MTIME=y
-
-#
-# Debug Configuration
-#
-# CONFIG_SPIFFS_DBG is not set
-# CONFIG_SPIFFS_API_DBG is not set
-# CONFIG_SPIFFS_GC_DBG is not set
-# CONFIG_SPIFFS_CACHE_DBG is not set
-# CONFIG_SPIFFS_CHECK_DBG is not set
-# CONFIG_SPIFFS_TEST_VISUALISATION is not set
-# end of Debug Configuration
-# end of SPIFFS Configuration
-
-#
-# TCP Transport
-#
-
-#
-# Websocket
-#
-CONFIG_WS_TRANSPORT=y
-CONFIG_WS_BUFFER_SIZE=1024
-# CONFIG_WS_DYNAMIC_BUFFER is not set
-# end of Websocket
-# end of TCP Transport
-
-#
-# Ultra Low Power (ULP) Co-processor
-#
-# CONFIG_ULP_COPROC_ENABLED is not set
-
-#
-# ULP Debugging Options
-#
-# end of ULP Debugging Options
-# end of Ultra Low Power (ULP) Co-processor
-
-#
-# Unity unit testing library
-#
-CONFIG_UNITY_ENABLE_FLOAT=y
-CONFIG_UNITY_ENABLE_DOUBLE=y
-# CONFIG_UNITY_ENABLE_64BIT is not set
-# CONFIG_UNITY_ENABLE_COLOR is not set
-CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
-# CONFIG_UNITY_ENABLE_FIXTURE is not set
-# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set
-# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set
-# end of Unity unit testing library
-
-#
-# USB-OTG
-#
-CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256
-CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y
-# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set
-# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set
-
-#
-# Hub Driver Configuration
-#
-
-#
-# Root Port configuration
-#
-CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250
-CONFIG_USB_HOST_RESET_HOLD_MS=30
-CONFIG_USB_HOST_RESET_RECOVERY_MS=30
-CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10
-# end of Root Port configuration
-
-# CONFIG_USB_HOST_HUBS_SUPPORTED is not set
-# end of Hub Driver Configuration
-
-# CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set
-CONFIG_USB_OTG_SUPPORTED=y
-# end of USB-OTG
-
-#
-# Virtual file system
-#
-CONFIG_VFS_SUPPORT_IO=y
-CONFIG_VFS_SUPPORT_DIR=y
-CONFIG_VFS_SUPPORT_SELECT=y
-CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
-# CONFIG_VFS_SELECT_IN_RAM is not set
-CONFIG_VFS_SUPPORT_TERMIOS=y
-CONFIG_VFS_MAX_COUNT=8
-
-#
-# Host File System I/O (Semihosting)
-#
-CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1
-# end of Host File System I/O (Semihosting)
-
-CONFIG_VFS_INITIALIZE_DEV_NULL=y
-# end of Virtual file system
-
-#
-# Wear Levelling
-#
-# CONFIG_WL_SECTOR_SIZE_512 is not set
-CONFIG_WL_SECTOR_SIZE_4096=y
-CONFIG_WL_SECTOR_SIZE=4096
-# end of Wear Levelling
-
-#
-# Wi-Fi Provisioning Manager
-#
-CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16
-CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30
-CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
-# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set
-# end of Wi-Fi Provisioning Manager
-
-#
-# TinyUSB Stack
-#
-CONFIG_TINYUSB_DEBUG_LEVEL=1
-CONFIG_TINYUSB_RHPORT_HS=y
-# CONFIG_TINYUSB_RHPORT_FS is not set
-
-#
-# TinyUSB DCD
-#
-# CONFIG_TINYUSB_MODE_SLAVE is not set
-CONFIG_TINYUSB_MODE_DMA=y
-# end of TinyUSB DCD
-
-#
-# TinyUSB task configuration
-#
-# CONFIG_TINYUSB_NO_DEFAULT_TASK is not set
-CONFIG_TINYUSB_TASK_PRIORITY=5
-CONFIG_TINYUSB_TASK_STACK_SIZE=4096
-# CONFIG_TINYUSB_TASK_AFFINITY_NO_AFFINITY is not set
-# CONFIG_TINYUSB_TASK_AFFINITY_CPU0 is not set
-CONFIG_TINYUSB_TASK_AFFINITY_CPU1=y
-CONFIG_TINYUSB_TASK_AFFINITY=0x1
-# CONFIG_TINYUSB_INIT_IN_DEFAULT_TASK is not set
-# end of TinyUSB task configuration
-
-#
-# Descriptor configuration
-#
-
-#
-# You can provide your custom descriptors via tinyusb_driver_install()
-#
-CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID=y
-CONFIG_TINYUSB_DESC_USE_DEFAULT_PID=y
-CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100
-CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Espressif Systems"
-CONFIG_TINYUSB_DESC_PRODUCT_STRING="Espressif Device"
-CONFIG_TINYUSB_DESC_SERIAL_STRING="123456"
-# end of Descriptor configuration
-
-#
-# Massive Storage Class (MSC)
-#
-# CONFIG_TINYUSB_MSC_ENABLED is not set
-
-#
-# TinyUSB FAT Format Options
-#
-CONFIG_TINYUSB_FAT_FORMAT_ANY=y
-# CONFIG_TINYUSB_FAT_FORMAT_FAT is not set
-# CONFIG_TINYUSB_FAT_FORMAT_FAT32 is not set
-# CONFIG_TINYUSB_FAT_FORMAT_EXFAT is not set
-# CONFIG_TINYUSB_FAT_FORMAT_SFD is not set
-# end of TinyUSB FAT Format Options
-# end of Massive Storage Class (MSC)
-
-#
-# Communication Device Class (CDC)
-#
-# CONFIG_TINYUSB_CDC_ENABLED is not set
-# end of Communication Device Class (CDC)
-
-#
-# Musical Instrument Digital Interface (MIDI)
-#
-CONFIG_TINYUSB_MIDI_COUNT=0
-# end of Musical Instrument Digital Interface (MIDI)
-
-#
-# Human Interface Device Class (HID)
-#
-CONFIG_TINYUSB_HID_COUNT=2
-# end of Human Interface Device Class (HID)
-
-#
-# Device Firmware Upgrade (DFU)
-#
-# CONFIG_TINYUSB_DFU_MODE_DFU is not set
-# CONFIG_TINYUSB_DFU_MODE_DFU_RUNTIME is not set
-CONFIG_TINYUSB_DFU_MODE_NONE=y
-# end of Device Firmware Upgrade (DFU)
-
-#
-# Bluetooth Host Class (BTH)
-#
-# CONFIG_TINYUSB_BTH_ENABLED is not set
-# end of Bluetooth Host Class (BTH)
-
-#
-# Network driver (ECM/NCM/RNDIS)
-#
-# CONFIG_TINYUSB_NET_MODE_ECM_RNDIS is not set
-# CONFIG_TINYUSB_NET_MODE_NCM is not set
-CONFIG_TINYUSB_NET_MODE_NONE=y
-# end of Network driver (ECM/NCM/RNDIS)
-
-#
-# Vendor Specific Interface
-#
-CONFIG_TINYUSB_VENDOR_COUNT=0
-# end of Vendor Specific Interface
-# end of TinyUSB Stack
-
-#
-# LittleFS
-#
-# CONFIG_LITTLEFS_SDMMC_SUPPORT is not set
-CONFIG_LITTLEFS_MAX_PARTITIONS=3
-CONFIG_LITTLEFS_PAGE_SIZE=256
-CONFIG_LITTLEFS_OBJ_NAME_LEN=64
-CONFIG_LITTLEFS_READ_SIZE=128
-CONFIG_LITTLEFS_WRITE_SIZE=128
-CONFIG_LITTLEFS_LOOKAHEAD_SIZE=128
-CONFIG_LITTLEFS_CACHE_SIZE=512
-CONFIG_LITTLEFS_BLOCK_CYCLES=512
-CONFIG_LITTLEFS_USE_MTIME=y
-# CONFIG_LITTLEFS_USE_ONLY_HASH is not set
-# CONFIG_LITTLEFS_HUMAN_READABLE is not set
-CONFIG_LITTLEFS_MTIME_USE_SECONDS=y
-# CONFIG_LITTLEFS_MTIME_USE_NONCE is not set
-# CONFIG_LITTLEFS_SPIFFS_COMPAT is not set
-# CONFIG_LITTLEFS_FLUSH_FILE_EVERY_WRITE is not set
-# CONFIG_LITTLEFS_FCNTL_GET_PATH is not set
-# CONFIG_LITTLEFS_MULTIVERSION is not set
-# CONFIG_LITTLEFS_MALLOC_STRATEGY_DISABLE is not set
-CONFIG_LITTLEFS_MALLOC_STRATEGY_DEFAULT=y
-# CONFIG_LITTLEFS_MALLOC_STRATEGY_INTERNAL is not set
-CONFIG_LITTLEFS_ASSERTS=y
-# CONFIG_LITTLEFS_MMAP_PARTITION is not set
-# CONFIG_LITTLEFS_WDT_RESET is not set
-# end of LittleFS
-
-#
-# LVGL configuration
-#
-CONFIG_LV_CONF_SKIP=y
-# CONFIG_LV_CONF_MINIMAL is not set
-
-#
-# Color Settings
-#
-# CONFIG_LV_COLOR_DEPTH_32 is not set
-# CONFIG_LV_COLOR_DEPTH_24 is not set
-CONFIG_LV_COLOR_DEPTH_16=y
-# CONFIG_LV_COLOR_DEPTH_8 is not set
-# CONFIG_LV_COLOR_DEPTH_1 is not set
-CONFIG_LV_COLOR_DEPTH=16
-# end of Color Settings
-
-#
-# Memory Settings
-#
-CONFIG_LV_USE_BUILTIN_MALLOC=y
-# CONFIG_LV_USE_CLIB_MALLOC is not set
-# CONFIG_LV_USE_MICROPYTHON_MALLOC is not set
-# CONFIG_LV_USE_RTTHREAD_MALLOC is not set
-# CONFIG_LV_USE_CUSTOM_MALLOC is not set
-CONFIG_LV_USE_BUILTIN_STRING=y
-# CONFIG_LV_USE_CLIB_STRING is not set
-# CONFIG_LV_USE_CUSTOM_STRING is not set
-CONFIG_LV_USE_BUILTIN_SPRINTF=y
-# CONFIG_LV_USE_CLIB_SPRINTF is not set
-# CONFIG_LV_USE_CUSTOM_SPRINTF is not set
-CONFIG_LV_MEM_SIZE_KILOBYTES=64
-CONFIG_LV_MEM_POOL_EXPAND_SIZE_KILOBYTES=0
-CONFIG_LV_MEM_ADR=0x0
-# end of Memory Settings
-
-#
-# HAL Settings
-#
-CONFIG_LV_DEF_REFR_PERIOD=33
-CONFIG_LV_DPI_DEF=130
-# end of HAL Settings
-
-#
-# Operating System (OS)
-#
-CONFIG_LV_OS_NONE=y
-# CONFIG_LV_OS_PTHREAD is not set
-# CONFIG_LV_OS_FREERTOS is not set
-# CONFIG_LV_OS_CMSIS_RTOS2 is not set
-# CONFIG_LV_OS_RTTHREAD is not set
-# CONFIG_LV_OS_WINDOWS is not set
-# CONFIG_LV_OS_MQX is not set
-# CONFIG_LV_OS_SDL2 is not set
-# CONFIG_LV_OS_CUSTOM is not set
-# end of Operating System (OS)
-
-#
-# Rendering Configuration
-#
-CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=1
-CONFIG_LV_DRAW_BUF_ALIGN=4
-CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE=24576
-CONFIG_LV_DRAW_LAYER_MAX_MEMORY=0
-CONFIG_LV_USE_DRAW_SW=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB565=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB565A8=y
-CONFIG_LV_DRAW_SW_SUPPORT_RGB888=y
-CONFIG_LV_DRAW_SW_SUPPORT_XRGB8888=y
-CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888=y
-CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888_PREMULTIPLIED=y
-CONFIG_LV_DRAW_SW_SUPPORT_L8=y
-CONFIG_LV_DRAW_SW_SUPPORT_AL88=y
-CONFIG_LV_DRAW_SW_SUPPORT_A8=y
-CONFIG_LV_DRAW_SW_SUPPORT_I1=y
-CONFIG_LV_DRAW_SW_I1_LUM_THRESHOLD=127
-CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT=1
-# CONFIG_LV_USE_DRAW_ARM2D_SYNC is not set
-# CONFIG_LV_USE_NATIVE_HELIUM_ASM is not set
-CONFIG_LV_DRAW_SW_COMPLEX=y
-# CONFIG_LV_USE_DRAW_SW_COMPLEX_GRADIENTS is not set
-CONFIG_LV_DRAW_SW_SHADOW_CACHE_SIZE=0
-CONFIG_LV_DRAW_SW_CIRCLE_CACHE_SIZE=4
-CONFIG_LV_DRAW_SW_ASM_NONE=y
-# CONFIG_LV_DRAW_SW_ASM_NEON is not set
-# CONFIG_LV_DRAW_SW_ASM_HELIUM is not set
-# CONFIG_LV_DRAW_SW_ASM_CUSTOM is not set
-CONFIG_LV_USE_DRAW_SW_ASM=0
-# CONFIG_LV_USE_PXP is not set
-# CONFIG_LV_USE_G2D is not set
-# CONFIG_LV_USE_DRAW_DAVE2D is not set
-# CONFIG_LV_USE_DRAW_SDL is not set
-# CONFIG_LV_USE_DRAW_VG_LITE is not set
-# CONFIG_LV_USE_VECTOR_GRAPHIC is not set
-# CONFIG_LV_USE_DRAW_DMA2D is not set
-# CONFIG_LV_USE_PPA is not set
-# CONFIG_LV_USE_DRAW_EVE is not set
-# end of Rendering Configuration
-
-#
-# Feature Configuration
-#
-
-#
-# Logging
-#
-# CONFIG_LV_USE_LOG is not set
-# end of Logging
-
-#
-# Asserts
-#
-CONFIG_LV_USE_ASSERT_NULL=y
-CONFIG_LV_USE_ASSERT_MALLOC=y
-# CONFIG_LV_USE_ASSERT_STYLE is not set
-# CONFIG_LV_USE_ASSERT_MEM_INTEGRITY is not set
-# CONFIG_LV_USE_ASSERT_OBJ is not set
-CONFIG_LV_ASSERT_HANDLER_INCLUDE="assert.h"
-# end of Asserts
-
-#
-# Debug
-#
-# CONFIG_LV_USE_REFR_DEBUG is not set
-# CONFIG_LV_USE_LAYER_DEBUG is not set
-# CONFIG_LV_USE_PARALLEL_DRAW_DEBUG is not set
-# end of Debug
-
-#
-# Others
-#
-# CONFIG_LV_ENABLE_GLOBAL_CUSTOM is not set
-CONFIG_LV_CACHE_DEF_SIZE=0
-CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT=0
-CONFIG_LV_GRADIENT_MAX_STOPS=2
-CONFIG_LV_COLOR_MIX_ROUND_OFS=128
-# CONFIG_LV_OBJ_STYLE_CACHE is not set
-# CONFIG_LV_USE_OBJ_ID is not set
-# CONFIG_LV_USE_OBJ_NAME is not set
-# CONFIG_LV_USE_OBJ_PROPERTY is not set
-# end of Others
-# end of Feature Configuration
-
-#
-# Compiler Settings
-#
-# CONFIG_LV_BIG_ENDIAN_SYSTEM is not set
-CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE=1
-# CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM is not set
-# CONFIG_LV_USE_FLOAT is not set
-# CONFIG_LV_USE_MATRIX is not set
-# CONFIG_LV_USE_PRIVATE_API is not set
-# end of Compiler Settings
-
-#
-# Font Usage
-#
-
-#
-# Enable built-in fonts
-#
-# CONFIG_LV_FONT_MONTSERRAT_8 is not set
-# CONFIG_LV_FONT_MONTSERRAT_10 is not set
-# CONFIG_LV_FONT_MONTSERRAT_12 is not set
-CONFIG_LV_FONT_MONTSERRAT_14=y
-# CONFIG_LV_FONT_MONTSERRAT_16 is not set
-# CONFIG_LV_FONT_MONTSERRAT_18 is not set
-# CONFIG_LV_FONT_MONTSERRAT_20 is not set
-# CONFIG_LV_FONT_MONTSERRAT_22 is not set
-# CONFIG_LV_FONT_MONTSERRAT_24 is not set
-# CONFIG_LV_FONT_MONTSERRAT_26 is not set
-# CONFIG_LV_FONT_MONTSERRAT_28 is not set
-# CONFIG_LV_FONT_MONTSERRAT_30 is not set
-# CONFIG_LV_FONT_MONTSERRAT_32 is not set
-# CONFIG_LV_FONT_MONTSERRAT_34 is not set
-# CONFIG_LV_FONT_MONTSERRAT_36 is not set
-# CONFIG_LV_FONT_MONTSERRAT_38 is not set
-# CONFIG_LV_FONT_MONTSERRAT_40 is not set
-# CONFIG_LV_FONT_MONTSERRAT_42 is not set
-# CONFIG_LV_FONT_MONTSERRAT_44 is not set
-# CONFIG_LV_FONT_MONTSERRAT_46 is not set
-# CONFIG_LV_FONT_MONTSERRAT_48 is not set
-# CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED is not set
-# CONFIG_LV_FONT_DEJAVU_16_PERSIAN_HEBREW is not set
-# CONFIG_LV_FONT_SOURCE_HAN_SANS_SC_14_CJK is not set
-# CONFIG_LV_FONT_SOURCE_HAN_SANS_SC_16_CJK is not set
-# CONFIG_LV_FONT_UNSCII_8 is not set
-# CONFIG_LV_FONT_UNSCII_16 is not set
-# end of Enable built-in fonts
-
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_8 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_10 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12 is not set
-CONFIG_LV_FONT_DEFAULT_MONTSERRAT_14=y
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_16 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_18 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_20 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_22 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_24 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_30 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_32 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_34 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_36 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_38 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_40 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_42 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_44 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_46 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_48 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED is not set
-# CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW is not set
-# CONFIG_LV_FONT_DEFAULT_SOURCE_HAN_SANS_SC_14_CJK is not set
-# CONFIG_LV_FONT_DEFAULT_SOURCE_HAN_SANS_SC_16_CJK is not set
-# CONFIG_LV_FONT_DEFAULT_UNSCII_8 is not set
-# CONFIG_LV_FONT_DEFAULT_UNSCII_16 is not set
-# CONFIG_LV_FONT_FMT_TXT_LARGE is not set
-# CONFIG_LV_USE_FONT_COMPRESSED is not set
-CONFIG_LV_USE_FONT_PLACEHOLDER=y
-
-#
-# Enable static fonts
-#
-# end of Enable static fonts
-# end of Font Usage
-
-#
-# Text Settings
-#
-CONFIG_LV_TXT_ENC_UTF8=y
-# CONFIG_LV_TXT_ENC_ASCII is not set
-CONFIG_LV_TXT_BREAK_CHARS=" ,.;:-_)}"
-CONFIG_LV_TXT_LINE_BREAK_LONG_LEN=0
-CONFIG_LV_TXT_COLOR_CMD="#"
-# CONFIG_LV_USE_BIDI is not set
-# CONFIG_LV_USE_ARABIC_PERSIAN_CHARS is not set
-# end of Text Settings
-
-#
-# Widget Usage
-#
-CONFIG_LV_WIDGETS_HAS_DEFAULT_VALUE=y
-CONFIG_LV_USE_ANIMIMG=y
-CONFIG_LV_USE_ARC=y
-CONFIG_LV_USE_ARCLABEL=y
-CONFIG_LV_USE_BAR=y
-CONFIG_LV_USE_BUTTON=y
-CONFIG_LV_USE_BUTTONMATRIX=y
-CONFIG_LV_USE_CALENDAR=y
-# CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY is not set
-
-#
-# Days name configuration
-#
-CONFIG_LV_MONDAY_STR="Mo"
-CONFIG_LV_TUESDAY_STR="Tu"
-CONFIG_LV_WEDNESDAY_STR="We"
-CONFIG_LV_THURSDAY_STR="Th"
-CONFIG_LV_FRIDAY_STR="Fr"
-CONFIG_LV_SATURDAY_STR="Sa"
-CONFIG_LV_SUNDAY_STR="Su"
-# end of Days name configuration
-
-CONFIG_LV_USE_CALENDAR_HEADER_ARROW=y
-CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN=y
-# CONFIG_LV_USE_CALENDAR_CHINESE is not set
-CONFIG_LV_USE_CANVAS=y
-CONFIG_LV_USE_CHART=y
-CONFIG_LV_USE_CHECKBOX=y
-CONFIG_LV_USE_DROPDOWN=y
-CONFIG_LV_USE_IMAGE=y
-CONFIG_LV_USE_IMAGEBUTTON=y
-CONFIG_LV_USE_KEYBOARD=y
-CONFIG_LV_USE_LABEL=y
-CONFIG_LV_LABEL_TEXT_SELECTION=y
-CONFIG_LV_LABEL_LONG_TXT_HINT=y
-CONFIG_LV_LABEL_WAIT_CHAR_COUNT=3
-CONFIG_LV_USE_LED=y
-CONFIG_LV_USE_LINE=y
-CONFIG_LV_USE_LIST=y
-CONFIG_LV_USE_MENU=y
-CONFIG_LV_USE_MSGBOX=y
-CONFIG_LV_USE_ROLLER=y
-CONFIG_LV_USE_SCALE=y
-CONFIG_LV_USE_SLIDER=y
-CONFIG_LV_USE_SPAN=y
-CONFIG_LV_SPAN_SNIPPET_STACK_SIZE=64
-CONFIG_LV_USE_SPINBOX=y
-CONFIG_LV_USE_SPINNER=y
-CONFIG_LV_USE_SWITCH=y
-CONFIG_LV_USE_TEXTAREA=y
-CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME=1500
-CONFIG_LV_USE_TABLE=y
-CONFIG_LV_USE_TABVIEW=y
-CONFIG_LV_USE_TILEVIEW=y
-CONFIG_LV_USE_WIN=y
-# end of Widget Usage
-
-#
-# Themes
-#
-CONFIG_LV_USE_THEME_DEFAULT=y
-# CONFIG_LV_THEME_DEFAULT_DARK is not set
-CONFIG_LV_THEME_DEFAULT_GROW=y
-CONFIG_LV_THEME_DEFAULT_TRANSITION_TIME=80
-CONFIG_LV_USE_THEME_SIMPLE=y
-# CONFIG_LV_USE_THEME_MONO is not set
-# end of Themes
-
-#
-# Layouts
-#
-CONFIG_LV_USE_FLEX=y
-CONFIG_LV_USE_GRID=y
-# end of Layouts
-
-#
-# 3rd Party Libraries
-#
-CONFIG_LV_FS_DEFAULT_DRIVER_LETTER=0
-# CONFIG_LV_USE_FS_STDIO is not set
-# CONFIG_LV_USE_FS_POSIX is not set
-# CONFIG_LV_USE_FS_WIN32 is not set
-# CONFIG_LV_USE_FS_FATFS is not set
-# CONFIG_LV_USE_FS_MEMFS is not set
-# CONFIG_LV_USE_FS_LITTLEFS is not set
-# CONFIG_LV_USE_FS_ARDUINO_ESP_LITTLEFS is not set
-# CONFIG_LV_USE_FS_ARDUINO_SD is not set
-# CONFIG_LV_USE_FS_UEFI is not set
-# CONFIG_LV_USE_FS_FROGFS is not set
-# CONFIG_LV_USE_LODEPNG is not set
-# CONFIG_LV_USE_LIBPNG is not set
-# CONFIG_LV_USE_BMP is not set
-# CONFIG_LV_USE_TJPGD is not set
-# CONFIG_LV_USE_LIBJPEG_TURBO is not set
-# CONFIG_LV_USE_GIF is not set
-# CONFIG_LV_BIN_DECODER_RAM_LOAD is not set
-# CONFIG_LV_USE_RLE is not set
-# CONFIG_LV_USE_QRCODE is not set
-# CONFIG_LV_USE_BARCODE is not set
-# CONFIG_LV_USE_FREETYPE is not set
-# CONFIG_LV_USE_TINY_TTF is not set
-# CONFIG_LV_USE_RLOTTIE is not set
-# CONFIG_LV_USE_THORVG is not set
-# CONFIG_LV_USE_LZ4 is not set
-# CONFIG_LV_USE_FFMPEG is not set
-# end of 3rd Party Libraries
-
-#
-# Others
-#
-# CONFIG_LV_USE_SNAPSHOT is not set
-# CONFIG_LV_USE_SYSMON is not set
-# CONFIG_LV_USE_PROFILER is not set
-# CONFIG_LV_USE_MONKEY is not set
-# CONFIG_LV_USE_GRIDNAV is not set
-# CONFIG_LV_USE_FRAGMENT is not set
-# CONFIG_LV_USE_IMGFONT is not set
-CONFIG_LV_USE_OBSERVER=y
-# CONFIG_LV_USE_IME_PINYIN is not set
-# CONFIG_LV_USE_FILE_EXPLORER is not set
-# CONFIG_LV_USE_FONT_MANAGER is not set
-# CONFIG_LV_USE_TEST is not set
-# CONFIG_LV_USE_TRANSLATION is not set
-# CONFIG_LV_USE_XML is not set
-# CONFIG_LV_USE_COLOR_FILTER is not set
-CONFIG_LVGL_VERSION_MAJOR=9
-CONFIG_LVGL_VERSION_MINOR=4
-CONFIG_LVGL_VERSION_PATCH=0
-# end of Others
-
-#
-# Devices
-#
-# CONFIG_LV_USE_SDL is not set
-# CONFIG_LV_USE_X11 is not set
-# CONFIG_LV_USE_WAYLAND is not set
-# CONFIG_LV_USE_LINUX_FBDEV is not set
-# CONFIG_LV_USE_NUTTX is not set
-# CONFIG_LV_USE_LINUX_DRM is not set
-# CONFIG_LV_USE_TFT_ESPI is not set
-# CONFIG_LV_USE_LOVYAN_GFX is not set
-# CONFIG_LV_USE_EVDEV is not set
-# CONFIG_LV_USE_LIBINPUT is not set
-# CONFIG_LV_USE_ST7735 is not set
-# CONFIG_LV_USE_ST7789 is not set
-# CONFIG_LV_USE_ST7796 is not set
-# CONFIG_LV_USE_ILI9341 is not set
-# CONFIG_LV_USE_GENERIC_MIPI is not set
-# CONFIG_LV_USE_NXP_ELCDIF is not set
-# CONFIG_LV_USE_RENESAS_GLCDC is not set
-# CONFIG_LV_USE_ST_LTDC is not set
-# CONFIG_LV_USE_FT81X is not set
-# CONFIG_LV_USE_UEFI is not set
-# CONFIG_LV_USE_OPENGLES is not set
-# CONFIG_LV_USE_QNX is not set
-# end of Devices
-
-#
-# Examples
-#
-CONFIG_LV_BUILD_EXAMPLES=y
-# end of Examples
-
-#
-# Demos
-#
-CONFIG_LV_BUILD_DEMOS=y
-# CONFIG_LV_USE_DEMO_WIDGETS is not set
-# CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER is not set
-# CONFIG_LV_USE_DEMO_BENCHMARK is not set
-# CONFIG_LV_USE_DEMO_RENDER is not set
-# CONFIG_LV_USE_DEMO_SCROLL is not set
-# CONFIG_LV_USE_DEMO_STRESS is not set
-# CONFIG_LV_USE_DEMO_MUSIC is not set
-# CONFIG_LV_USE_DEMO_FLEX_LAYOUT is not set
-# CONFIG_LV_USE_DEMO_MULTILANG is not set
-# CONFIG_LV_USE_DEMO_SMARTWATCH is not set
-# CONFIG_LV_USE_DEMO_EBIKE is not set
-# CONFIG_LV_USE_DEMO_HIGH_RES is not set
-# end of Demos
-# end of LVGL configuration
-# end of Component config
-
-# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set
diff --git a/tools/build.sh b/tools/build.sh
index 3b04d157..5225e2ef 100755
--- a/tools/build.sh
+++ b/tools/build.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
+
# Configuration
PROJECT_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." &> /dev/null && pwd)
C5_DIR="$PROJECT_ROOT/firmware_c5"
@@ -25,7 +41,7 @@ echo -e "${BLUE}>>> Starting TentacleOS Build${NC}"
echo -e "${BLUE}>>> Building ESP32-C5 firmware...${NC}"
cd "$C5_DIR" || exit
-idf.py reconfigure build
+idf.py -DIDF_TARGET=esp32c5 reconfigure build
if [ $? -ne 0 ]; then
echo -e "${RED}Error: Failed to build C5 firmware.${NC}"
@@ -34,7 +50,7 @@ fi
echo -e "${BLUE}>>> Building ESP32-P4 firmware (Embedding C5 binary)...${NC}"
cd "$P4_DIR" || exit
-idf.py reconfigure build
+idf.py -DIDF_TARGET=esp32p4 reconfigure build
if [ $? -ne 0 ]; then
echo -e "${RED}Error: Failed to build P4 firmware.${NC}"
diff --git a/tools/build_and_flash.sh b/tools/build_and_flash.sh
index 035efc34..4029a200 100755
--- a/tools/build_and_flash.sh
+++ b/tools/build_and_flash.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
+
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
"$SCRIPT_DIR/build.sh" && "$SCRIPT_DIR/flash.sh"
diff --git a/tools/flash.sh b/tools/flash.sh
index 16f5bb02..a825e038 100755
--- a/tools/flash.sh
+++ b/tools/flash.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
+
PROJECT_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." &> /dev/null && pwd)
P4_DIR="$PROJECT_ROOT/firmware_p4"
diff --git a/tools/format.sh b/tools/format.sh
index 883a42ee..30e59788 100755
--- a/tools/format.sh
+++ b/tools/format.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
+
REPO_ROOT="$(git rev-parse --show-toplevel)"
TARGETS=(
@@ -14,24 +30,24 @@ EXCLUDE_DIRS=(
"build"
)
-EXCLUDE_ARGS=""
+EXCLUDE_ARGS=()
for dir in "${EXCLUDE_DIRS[@]}"; do
- EXCLUDE_ARGS="$EXCLUDE_ARGS -not -path */$dir/*"
+ EXCLUDE_ARGS+=(-not -path "*/$dir/*")
done
-EXISTING_TARGETS=""
+EXISTING_TARGETS=()
for target in "${TARGETS[@]}"; do
if [ -d "$target" ]; then
- EXISTING_TARGETS="$EXISTING_TARGETS $target"
+ EXISTING_TARGETS+=("$target")
fi
done
-if [ -z "$EXISTING_TARGETS" ]; then
+if [ ${#EXISTING_TARGETS[@]} -eq 0 ]; then
echo "No target directories found."
exit 0
fi
-FILES=$(find $EXISTING_TARGETS \( -name "*.c" -o -name "*.h" \) $EXCLUDE_ARGS)
+FILES=$(find "${EXISTING_TARGETS[@]}" \( -name "*.c" -o -name "*.h" \) "${EXCLUDE_ARGS[@]}")
if [ -z "$FILES" ]; then
echo "No files to format."
@@ -44,7 +60,7 @@ if [ "$1" = "--check" ]; then
echo "Checking $COUNT files..."
echo "$FILES" | xargs clang-format --dry-run --Werror 2>&1
if [ $? -ne 0 ]; then
- echo "Formatting errors found. Run ./scripts/format.sh to fix."
+ echo "Formatting errors found. Run ./tools/format.sh to fix."
exit 1
fi
echo "All files formatted correctly."
diff --git a/tools/png_to_bin/generate_rotated_frames.py b/tools/png_to_bin/generate_rotated_frames.py
index 6146f4c8..888ea3a8 100644
--- a/tools/png_to_bin/generate_rotated_frames.py
+++ b/tools/png_to_bin/generate_rotated_frames.py
@@ -1,3 +1,18 @@
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
import os
import sys
import glob
diff --git a/tools/png_to_bin/png_conversor_to_bin.ps1 b/tools/png_to_bin/png_conversor_to_bin.ps1
index 509105bd..9d2f67a9 100644
--- a/tools/png_to_bin/png_conversor_to_bin.ps1
+++ b/tools/png_to_bin/png_conversor_to_bin.ps1
@@ -1,3 +1,18 @@
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
# ==============================================================================
# LVGL Image Conversion Automation Script (Windows Version)
# ==============================================================================
diff --git a/tools/png_to_bin/png_conversor_to_bin.sh b/tools/png_to_bin/png_conversor_to_bin.sh
index 4fe49a88..9002ff06 100755
--- a/tools/png_to_bin/png_conversor_to_bin.sh
+++ b/tools/png_to_bin/png_conversor_to_bin.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
+
# ==============================================================================
# LVGL Image Conversion Automation Script (Linux/macOS Version)
# ==============================================================================
diff --git a/tools/setup.sh b/tools/setup.sh
index 0e5b3bd1..c74c5284 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+# Copyright (c) 2025 HIGH CODE LLC
+#
+# TentacleOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TentacleOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TentacleOS. If not, see .
+
+
# ==============================================================================
# TentacleOS Developer Environment Setup
# ==============================================================================
diff --git a/update_license.py b/update_license.py
new file mode 100644
index 00000000..84ea1054
--- /dev/null
+++ b/update_license.py
@@ -0,0 +1,157 @@
+#!/usr/bin/env python3
+import os
+
+ROOT = os.path.dirname(os.path.abspath(__file__))
+
+SKIP = {"build", "managed_components", "lvgl-env"}
+
+# --- Replacement pairs (old Apache block → new GPL v3 block) -----------------
+
+SLASH_OLD = (
+ "// Licensed under the Apache License, Version 2.0 (the \"License\");\n"
+ "// you may not use this file except in compliance with the License.\n"
+ "// You may obtain a copy of the License at\n"
+ "//\n"
+ "// http://www.apache.org/licenses/LICENSE-2.0\n"
+ "//\n"
+ "// Unless required by applicable law or agreed to in writing, software\n"
+ "// distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+ "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+ "// See the License for the specific language governing permissions and\n"
+ "// limitations under the License."
+)
+
+SLASH_NEW = (
+ "// TentacleOS is free software: you can redistribute it and/or modify\n"
+ "// it under the terms of the GNU General Public License as published by\n"
+ "// the Free Software Foundation, either version 3 of the License, or\n"
+ "// (at your option) any later version.\n"
+ "//\n"
+ "// TentacleOS is distributed in the hope that it will be useful,\n"
+ "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "// GNU General Public License for more details.\n"
+ "//\n"
+ "// You should have received a copy of the GNU General Public License\n"
+ "// along with TentacleOS. If not, see ."
+)
+
+HASH_OLD = (
+ "# Licensed under the Apache License, Version 2.0 (the \"License\");\n"
+ "# you may not use this file except in compliance with the License.\n"
+ "# You may obtain a copy of the License at\n"
+ "#\n"
+ "# http://www.apache.org/licenses/LICENSE-2.0\n"
+ "#\n"
+ "# Unless required by applicable law or agreed to in writing, software\n"
+ "# distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+ "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+ "# See the License for the specific language governing permissions and\n"
+ "# limitations under the License."
+)
+
+HASH_NEW = (
+ "# TentacleOS is free software: you can redistribute it and/or modify\n"
+ "# it under the terms of the GNU General Public License as published by\n"
+ "# the Free Software Foundation, either version 3 of the License, or\n"
+ "# (at your option) any later version.\n"
+ "#\n"
+ "# TentacleOS is distributed in the hope that it will be useful,\n"
+ "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "# GNU General Public License for more details.\n"
+ "#\n"
+ "# You should have received a copy of the GNU General Public License\n"
+ "# along with TentacleOS. If not, see ."
+)
+
+REPLACEMENTS = [(SLASH_OLD, SLASH_NEW), (HASH_OLD, HASH_NEW)]
+
+# --- Header to insert in tools/ scripts (no existing copyright) --------------
+
+HASH_HEADER = (
+ "# Copyright (c) 2025 HIGH CODE LLC\n"
+ "#\n"
+ "# TentacleOS is free software: you can redistribute it and/or modify\n"
+ "# it under the terms of the GNU General Public License as published by\n"
+ "# the Free Software Foundation, either version 3 of the License, or\n"
+ "# (at your option) any later version.\n"
+ "#\n"
+ "# TentacleOS is distributed in the hope that it will be useful,\n"
+ "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "# GNU General Public License for more details.\n"
+ "#\n"
+ "# You should have received a copy of the GNU General Public License\n"
+ "# along with TentacleOS. If not, see ."
+)
+
+TOOLS_SKIP = {"LVGLImage.py"} # third-party
+TOOLS_EXTS = {".sh", ".py", ".ps1"}
+
+# -----------------------------------------------------------------------------
+
+def replace_in_file(fpath):
+ with open(fpath, "r", encoding="utf-8", errors="ignore") as f:
+ content = f.read()
+ if "Copyright (c) 2025 HIGH CODE LLC" not in content:
+ return False
+ new_content = content
+ for old, new in REPLACEMENTS:
+ new_content = new_content.replace(old, new)
+ if new_content == content:
+ return False
+ with open(fpath, "w", encoding="utf-8") as f:
+ f.write(new_content)
+ return True
+
+
+def insert_header_in_file(fpath):
+ with open(fpath, "r", encoding="utf-8", errors="ignore") as f:
+ content = f.read()
+ if "Copyright" in content:
+ return False
+ lines = content.splitlines(keepends=True)
+ if lines and lines[0].startswith("#!"):
+ new_content = lines[0] + "\n" + HASH_HEADER + "\n\n" + "".join(lines[1:])
+ else:
+ new_content = HASH_HEADER + "\n\n" + content
+ with open(fpath, "w", encoding="utf-8") as f:
+ f.write(new_content)
+ return True
+
+
+updated = 0
+skipped = 0
+
+# Pass 1 — replace Apache → GPL v3 in firmware sources
+for subdir in ["firmware_c5/main", "firmware_c5/components", "firmware_p4/main", "firmware_p4/components"]:
+ for dirpath, dirnames, filenames in os.walk(os.path.join(ROOT, subdir)):
+ dirnames[:] = [d for d in dirnames if d not in SKIP]
+ for fname in filenames:
+ ext = os.path.splitext(fname)[1]
+ if ext not in {".c", ".h"} and fname != "CMakeLists.txt":
+ continue
+ fpath = os.path.join(dirpath, fname)
+ if replace_in_file(fpath):
+ print(f" replaced: {os.path.relpath(fpath, ROOT)}")
+ updated += 1
+ else:
+ skipped += 1
+
+# Pass 2 — insert GPL v3 header in tools/ scripts
+for dirpath, dirnames, filenames in os.walk(os.path.join(ROOT, "tools")):
+ dirnames[:] = [d for d in dirnames if d not in SKIP]
+ for fname in filenames:
+ if fname in TOOLS_SKIP:
+ continue
+ if os.path.splitext(fname)[1] not in TOOLS_EXTS:
+ continue
+ fpath = os.path.join(dirpath, fname)
+ if insert_header_in_file(fpath):
+ print(f" inserted: {os.path.relpath(fpath, ROOT)}")
+ updated += 1
+ else:
+ skipped += 1
+
+print(f"\n{updated} files updated, {skipped} skipped.")