26 lines
731 B
C++
26 lines
731 B
C++
#pragma once
|
|
|
|
#include <cstring>
|
|
|
|
#include "types.hpp"
|
|
|
|
constexpr int MAX_DEVICES = 8;
|
|
constexpr int DEVICE_XML_MAX = 2048;
|
|
|
|
constexpr char kDefaultLayoutXml[] =
|
|
"<screen>\n"
|
|
" <view width=\"100%\" height=\"100%\" layout=\"flex\" flex_flow=\"column\" style_flex_main_place=\"center\" style_flex_cross_place=\"center\" style_pad_row=\"10\">\n"
|
|
" <lv_label text=\"Hello World\" />\n"
|
|
" <lv_label bind_text=\"device_mac\" />\n"
|
|
" </view>\n"
|
|
"</screen>";
|
|
|
|
struct device_t
|
|
{
|
|
char mac[18]; // "AA:BB:CC:DD:EE:FF\0"
|
|
bool active; // Slot in use
|
|
char xml_layout[DEVICE_XML_MAX]; // LVGL XML string for the current screen
|
|
};
|
|
|
|
internal device_t g_Devices[MAX_DEVICES] = {};
|