Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ Desktop.ini

# Debug
*.dSYM/
core
# Core dumps. A bare "core" rule silently ignored the entire core/ source
# tree, which is why core/common/include/eapps_core.h - included by all 44
# app targets - was never committed and every app failed to build.
core.[0-9]*
vgcore.*
vgcore.*

# Test artifacts
Expand Down
95 changes: 95 additions & 0 deletions apps/ebot/ebot.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,100 @@
#pragma once
#include "lvgl.h"
#include "eapps_core.h"

/* ------------------------------------------------------------------------
* eBot client API
*
* ebot.c uses this type layer, but the header only ever declared the two
* eapps_* lifecycle symbols, so the app has never compiled: 17 identifiers were
* undefined. Same failure mode as the missing core/common/include/eapps_core.h.
*
* Every struct field and its width below is RECOVERED from ebot.c, not invented:
*
* host[256] strncpy(state->host, ..., 255) :132
* port uint16_t ebot_state_init(..., uint16_t port) :129
* timeout_ms state->timeout_ms = 30000 :134
* connected bool state->connected = false :135
* total_requests/_tokens (uint32_t)atoi(val) :224,226
* models[].name[64] strncpy(..., 63); name[63] = 0 :246
* models[].tier[16] strncpy(..., 15); tier[15] = 0 :251
* models[].params[16] strncpy(..., 15); params[15] = 0 :257
* models[].active bool models[i].active ? "* " : " " :369,474
* tools[].name[64] strncpy(..., 63) :284
* tools[].description[256] strncpy(..., 255) :289
* tools[].permission[64] strncpy(..., 63) :295
* message.type/text/timestamp :119-122
*
* The five CAPACITIES are the exception - they are choices, because nothing in
* ebot.c pins them. They are marked below. Adjust freely; only EBOT_MAX_MESSAGES
* has structural meaning, as the message ring shifts by one at :113-117.
* ------------------------------------------------------------------------ */

#include <stdbool.h>
#include <stdint.h>

#define EBOT_VERSION "2.0.0" /* matches ebot_info.version */
#define EBOT_DEFAULT_HOST "127.0.0.1" /* local eAI Ebot Server */
#define EBOT_DEFAULT_PORT 8080

/* Capacities - chosen, not recovered from ebot.c. */
#define EBOT_MAX_MESSAGES 64
#define EBOT_MAX_MSG_LEN 2048
#define EBOT_MAX_MODELS 32
#define EBOT_MAX_TOOLS 32
#define EBOT_RESPONSE_BUF 8192

typedef enum {
EBOT_MSG_USER = 0,
EBOT_MSG_BOT,
EBOT_MSG_SYSTEM,
EBOT_MSG_TOOL_CALL,
EBOT_MSG_ERROR,
} ebot_msg_type_t;

typedef struct {
ebot_msg_type_t type;
char text[EBOT_MAX_MSG_LEN];
uint32_t timestamp; /**< Unix seconds. */
} ebot_message_t;

typedef struct {
char name[64];
char tier[16];
char params[16];
bool active; /**< Marked "* " in the model list at :369, :474. */
} ebot_model_t;

typedef struct {
char name[64];
char description[256];
char permission[64];
} ebot_tool_t;

typedef struct {
char host[256];
uint16_t port;
uint32_t timeout_ms;
bool connected;
uint32_t total_requests;
uint32_t total_tokens;

ebot_message_t messages[EBOT_MAX_MESSAGES];
int msg_count;
ebot_model_t models[EBOT_MAX_MODELS];
int model_count;
ebot_tool_t tools[EBOT_MAX_TOOLS];
int tool_count;
} ebot_state_t;

int ebot_state_init(ebot_state_t *state, const char *host, uint16_t port);
int ebot_send_message(ebot_state_t *state, const char *message);
int ebot_complete(ebot_state_t *state, const char *prompt);
int ebot_fetch_status(ebot_state_t *state);
int ebot_fetch_models(ebot_state_t *state);
int ebot_fetch_tools(ebot_state_t *state);
int ebot_reset_session(ebot_state_t *state);
int ebot_cli_main(int argc, char **argv);

extern const eapps_app_info_t ebot_info;
extern const eapps_app_lifecycle_t ebot_lifecycle;
35 changes: 13 additions & 22 deletions apps/eremote/eremote.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static void refresh_labels(void)
}
if (s_temp_lbl) {
char buf[16];
snprintf(buf, sizeof(buf), "%d" LV_SYMBOL_DEGREE_SIGN "C", dev->temperature);
snprintf(buf, sizeof(buf), "%d C", dev->temperature);
lv_label_set_text(s_temp_lbl, buf);
}
if (s_power_btn) {
Expand Down Expand Up @@ -557,7 +557,7 @@ static void build_ac_controls(lv_obj_t *parent, uint32_t btn_bg, uint32_t btn_fg
make_icon_btn(row, "-", 48, 44, btn_bg, btn_fg, temp_down_cb, NULL);

s_temp_lbl = lv_label_create(row);
lv_label_set_text(s_temp_lbl, "24" LV_SYMBOL_DEGREE_SIGN "C");
lv_label_set_text(s_temp_lbl, "24 C");
lv_obj_set_style_text_color(s_temp_lbl, hc(p->on_surface), 0);
lv_obj_set_style_text_font(s_temp_lbl, &lv_font_montserrat_16, 0);
lv_obj_set_style_min_width(s_temp_lbl, 72, 0);
Expand Down Expand Up @@ -742,33 +742,24 @@ static bool eremote_init(lv_obj_t *parent)
/* Bottom navigation */
build_nav_bar(body);

typedef struct {
lv_obj_t *lbl_title;
lv_obj_t *lbl_status;
lv_timer_t *timer;
} eremote_ctx_t;
static eremote_ctx_t ctx;
static bool eremote_init(lv_obj_t *parent) {
ctx.lbl_title = lv_label_create(parent);
lv_obj_set_style_text_font(ctx.lbl_title, &lv_font_montserrat_24, 0);
lv_obj_align(ctx.lbl_title, LV_ALIGN_TOP_MID, 0, 16);
lv_label_set_text(ctx.lbl_title, "eRemote");
ctx.lbl_status = lv_label_create(parent);
lv_obj_align(ctx.lbl_status, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text(ctx.lbl_status, "Remote desktop client\nv2.0.0 — Ready");
lv_obj_t *btn = lv_btn_create(parent);
lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -16);
lv_obj_t *lbl = lv_label_create(btn);
lv_label_set_text(lbl, "Open");
ctx.timer = NULL;
return true;
}

/* The remainder of this file was a second, unrelated stub implementation
* pasted over the tail of eremote_init(): its own eremote_ctx_t, a
* placeholder init drawing three labels and a button, and a duplicate
* eremote_init symbol. The real init above had lost its `return true; }` to
* that paste. Restored here, and the duplicate init and ctx removed. The
* lifecycle block below is kept: the real implementation defined none of it.
*/

static void eremote_deinit(void) { }
static void eremote_on_show(void) { }
static void eremote_on_hide(void) { }
const eapps_app_info_t eremote_info = {
.id = "eremote", .name = "eRemote", .icon = "rmt",
.description = "Remote desktop client", .category = EAPPS_CAT_NETWORK, .version = "2.0.0",
.description = "IR/WiFi remote for TVs, soundbars, streamers and AC",
.category = EAPPS_CAT_CONNECTIVITY, .version = "2.0.0",
};
const eapps_app_lifecycle_t eremote_lifecycle = {
.init = eremote_init, .deinit = eremote_deinit,
Expand Down
8 changes: 8 additions & 0 deletions apps/eremote/eremote.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/* ---- Capacity limits ---------------------------------------------------- */

#define EREMOTE_IR_DB_SIZE 16 /**< Code-database rows; init() fills 6. */
#define MAX_DEVICES 16 /**< Configured devices; init() fills 2. */
#define MAX_LEARNED 16 /**< Learned codes retained per device. */
#define MAX_SCENES 8 /**< Scene slots; init() fills 3. */
#define MAX_SCHEDULES 8 /**< Schedule slots; init() fills 2. */
Expand Down Expand Up @@ -121,6 +122,13 @@ typedef struct {
bool two_way; /**< Transport reports device state. */
eremote_ir_code_t learned[MAX_LEARNED];
int learned_count;
/* Last known device state. Only meaningful when two_way is set; for
* send-only transports these track what we last commanded. */
bool power_on;
uint8_t volume; /**< 0-100. */
uint16_t channel; /**< 1-based; 0 means unknown. */
int8_t temperature; /**< Degrees C; AC devices only. */
uint8_t fan_speed; /**< 0 = auto; AC devices only. */
} eremote_device_t;

/** One row of the shipped code database. */
Expand Down
42 changes: 6 additions & 36 deletions apps/etrack/etrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static lv_obj_t*s_root=NULL;static lv_obj_t*s_vw=NULL;static item_t s_items[MAX_
static lv_obj_t*s_nta=NULL;static lv_obj_t*s_lta=NULL;static lv_obj_t*s_dlbl=NULL;

static const char*cn(car_t c){switch(c){case C_FEDEX:return "FedEx";case C_UPS:return "UPS";case C_DHL:return "DHL";case C_AMZ:return "Amazon";default:return "Other";}}
static const char*ci(car_t c){switch(c){case C_FEDEX:return LV_SYMBOL_TRASH;case C_UPS:return LV_SYMBOL_HOME;case C_DHL:return LV_SYMBOL_CHARGE;case C_AMZ:return LV_SYMBOL_SHOPPING_CART;default:return LV_SYMBOL_GPS;}}
static const char*ci(car_t c){switch(c){case C_FEDEX:return LV_SYMBOL_TRASH;case C_UPS:return LV_SYMBOL_HOME;case C_DHL:return LV_SYMBOL_CHARGE;case C_AMZ:return LV_SYMBOL_LIST; /* LVGL has no cart symbol */default:return LV_SYMBOL_GPS;}}
static const char*se(st_t s){switch(s){case S_PEND:return "Pending";case S_IN:return "In Transit";case S_OUT:return "Out for Delivery";case S_DELV:return "Delivered";default:return "Failed";}}
static const char*sl(st_t s){switch(s){case S_PEND:return "🕓";case S_IN:return "🚚";case S_OUT:return "🏠";case S_DELV:return "✅";default:return "❌";}}
static uint32_t sc(st_t s){switch(s){case S_PEND:return 0xFFB300;case S_IN:return 0x1E88E5;case S_OUT:return 0x8E24AA;case S_DELV:return 0x43A047;default:return 0xE53935;}}
Expand Down Expand Up @@ -83,38 +83,8 @@ static bool etrack_init(lv_obj_t*par){s_root=par;load();show_list();return true;
static void etrack_deinit(void){s_root=NULL;clr();}
const eapps_app_info_t etrack_info={.id="etrack",.name="eTrack",.icon=LV_SYMBOL_GPS,.category=EAPPS_CAT_CONNECTIVITY,.version="1.0.0"};
const eapps_app_lifecycle_t etrack_lifecycle={.init=etrack_init,.deinit=etrack_deinit};
// eTrack — EoS LVGL Application
#include "etrack.h"
#include <stdbool.h>
typedef struct {
lv_obj_t *lbl_title;
lv_obj_t *lbl_status;
lv_timer_t *timer;
} etrack_ctx_t;
static etrack_ctx_t ctx;
static bool etrack_init(lv_obj_t *parent) {
ctx.lbl_title = lv_label_create(parent);
lv_obj_set_style_text_font(ctx.lbl_title, &lv_font_montserrat_24, 0);
lv_obj_align(ctx.lbl_title, LV_ALIGN_TOP_MID, 0, 16);
lv_label_set_text(ctx.lbl_title, "eTrack");
ctx.lbl_status = lv_label_create(parent);
lv_obj_align(ctx.lbl_status, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text(ctx.lbl_status, "Task and time tracker\nv2.0.0 — Ready");
lv_obj_t *btn = lv_btn_create(parent);
lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -16);
lv_obj_t *lbl = lv_label_create(btn);
lv_label_set_text(lbl, "Open");
ctx.timer = NULL;
return true;
}
static void etrack_deinit(void) { }
static void etrack_on_show(void) { }
static void etrack_on_hide(void) { }
const eapps_app_info_t etrack_info = {
.id = "etrack", .name = "eTrack", .icon = "trk",
.description = "Task and time tracker", .category = EAPPS_CAT_PRODUCTIVITY, .version = "2.0.0",
};
const eapps_app_lifecycle_t etrack_lifecycle = {
.init = etrack_init, .deinit = etrack_deinit,
.on_show = etrack_on_show, .on_hide = etrack_on_hide,
};

/* A second, unrelated stub implementation was appended below this point -
* its own #include, etrack_ctx_t, and duplicate etrack_init/deinit/info/
* lifecycle symbols. The implementation above is complete, so the stub was
* removed rather than merged. */
29 changes: 25 additions & 4 deletions apps/ewifi/ewifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static uint32_t signal_color(int rssi) {
return 0xF44336;
}

static uint32_t risk_color(ewifi_risk_level_t r) {
static uint32_t risk_color(ewifi_risk_t r) {
switch (r) {
case EWIFI_RISK_SECURE: return 0x00E676;
case EWIFI_RISK_LOW: return 0x66BB6A;
Expand Down Expand Up @@ -534,10 +534,14 @@ static void build_passwords_tab(lv_obj_t *body) {
lv_obj_set_style_text_font(pass, &lv_font_montserrat_12, 0);

/* Security info */
if (strlen(creds[i].security) > 0) {
/* .security is an ewifi_security_t enum, not a string: strlen() and
* "%s" on it were a pointer-from-integer error. ewifi_security_str()
* is the accessor, used correctly at line 147. */
const char *sec_str = ewifi_security_str(creds[i].security);
if (sec_str && *sec_str) {
lv_obj_t *sec = lv_label_create(card);
char stxt[48];
snprintf(stxt, 48, "Cipher: %s", creds[i].security);
snprintf(stxt, 48, "Cipher: %s", sec_str);
lv_label_set_text(sec, stxt);
lv_obj_set_style_text_color(sec, hc(p->on_surface), 0);
lv_obj_set_style_text_opa(sec, LV_OPA_50, 0);
Expand Down Expand Up @@ -794,7 +798,24 @@ static void build_nav(lv_obj_t *parent) {
}
}

/* ---- Lifecycle ---- */
/* ---- Lifecycle ----
*
* NOTE: this block was appended as a placeholder and its ewifi_ctx_t / ctx
* definition was lost, leaving `ctx` undeclared. The struct is restored below
* from its uses so the app builds.
*
* It is still a PLACEHOLDER: it draws a title, a status line and a button, and
* never calls the real UI in this file - build_scan_tab(), build_channel_tab(),
* build_security_tab(), build_passwords_tab(), build_nav(). Wiring the lifecycle
* to those is a product decision about tab scaffolding, not a build fix, so it
* is left for the owner. */
typedef struct {
lv_obj_t *lbl_title;
lv_obj_t *lbl_status;
lv_timer_t *timer;
} ewifi_ctx_t;
static ewifi_ctx_t ctx;

static bool ewifi_init(lv_obj_t *parent) {
ctx.lbl_title = lv_label_create(parent);
lv_obj_set_style_text_font(ctx.lbl_title, &lv_font_montserrat_24, 0);
Expand Down
35 changes: 35 additions & 0 deletions core/common/include/eapps_core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* SPDX-License-Identifier: MIT
* Copyright (c) 2026 EoS Project
*
* eapps_core.h - umbrella header for eApps application modules.
*
* 46 files under apps/ include "eapps_core.h", but the header was never
* committed - it appears in no commit in this repository's history. Every app
* target added by the root CMakeLists.txt therefore failed to compile:
*
* apps/ecal/ecal.h:5:10: fatal error: eapps_core.h: No such file or directory
*
* Nothing here is invented. Each declaration the apps rely on already existed in
* a per-module header; this file only aggregates them, so the contract is
* whatever those headers say:
*
* eapps_app_info_t, eapps_app_lifecycle_t <- eapps/types.h
* eapps_registry_* <- eapps/registry.h
* eapps_scaffold_create, eapps_card_create,
* eapps_list_create, eapps_list_item_create <- eapps/widgets.h
* eapps_palette_t, eapps_theme_get_palette <- eapps/theme.h
*
* Apps that additionally use the canvas, game-engine, TV-layout, or the string,
* math, date, and expression utilities should include those headers directly
* rather than have this one pull in the whole tree.
*/

#ifndef EAPPS_CORE_H
#define EAPPS_CORE_H

#include "eapps/types.h"
#include "eapps/registry.h"
#include "eapps/theme.h"
#include "eapps/widgets.h"

#endif /* EAPPS_CORE_H */
2 changes: 2 additions & 0 deletions extern/lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extern uint32_t eapps_tick_get_ms(void);
#define LV_USE_ASSERT_MEM_INTEGRITY 0
#define LV_USE_ASSERT_OBJ 0

/* 12 is used by apps/etrack and apps/ewifi; without it they fail to build. */
#define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_20 1
Expand Down
Loading