75178652e2
lvgl-module/symbols.c:
- canvas: full LVGL9 docs API (get_buf, get_image, get_px, get_draw_buf,
set_palette, copy_buf, init_layer, finish_layer, buf_size) – was only 5 symbols
- draw_buf: create/destroy/init/dup/copy/goto/clear/width_to_stride/align/palette/from_image/to_image
- cache: lv_draw_buf_invalidate_cache, flush_cache, lv_image_cache_drop – critical bugfix for
GameBoy (and any direct framebuffer) where raw buf mutated but image cache stale -> FPS but no image.
- draw layer helpers, image scale/rotation/pivot/offset, transform scales for GB 2x/3x integer scaling
Reason blank screen: lv_canvas in LVGL9 is lv_image backed by draw_buf. Mutating raw pointer
without lv_image_cache_drop + invalidate_cache leaves stale texture. Timer was calling
lv_obj_invalidate only. Now exports needed symbols and app fixed to drop cache each frame.
mDNS (preserve from local WIP, sits on top of 60764979 'kidsOS-XXXX' mdns init):
- Tactility/network/Mdns.h/cpp: C++ browse + resolveHostname wrappers around esp-idf mdns 1.3.2
(PTR query, txt records, address extraction, POSIX stub)
- TactilityC/tt_mdns.h/cpp: C copy-based API for ELF apps (TT_MDNS_MAX_RESULTS 32,
capped addresses/txt, hostname->IP resolve)
- TactilityC/tt_init.cpp: export tt_mdns_is_available / browse / resolve_hostname symbols
Test plan:
- firmware build for es3c28p --dev
- release-sdk-current.py
- GameBoy app build against new SDK (0 missing symbols expected)
- push both branches to personal gitea
95 lines
3.1 KiB
C
95 lines
3.1 KiB
C
#pragma once
|
|
|
|
/**
|
|
* TactilityC mDNS bindings — usable from external ELF apps.
|
|
*
|
|
* Provides synchronous mDNS browsing (PTR queries) and hostname resolution
|
|
* on top of the ESP-IDF mdns component. The API is intentionally C-only,
|
|
* string-copy based, to avoid complex lifetime issues across ELF boundaries.
|
|
*
|
|
* Implementation lives in Tactility (tt::network::mdns) and is exported via
|
|
* module symbols. TactilityC provides thin wrappers + symbol export.
|
|
*
|
|
* WiFi must be connected for mDNS queries to return results.
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define TT_MDNS_MAX_RESULTS 32
|
|
#define TT_MDNS_MAX_ADDRESSES 4
|
|
#define TT_MDNS_MAX_TXT_RECORDS 8
|
|
|
|
#define TT_MDNS_HOSTNAME_LEN 64
|
|
#define TT_MDNS_INSTANCE_LEN 64
|
|
#define TT_MDNS_SERVICE_TYPE_LEN 32
|
|
#define TT_MDNS_PROTO_LEN 16
|
|
#define TT_MDNS_IP_LEN 64
|
|
#define TT_MDNS_TXT_KEY_LEN 32
|
|
#define TT_MDNS_TXT_VALUE_LEN 64
|
|
|
|
/** One TXT key-value pair */
|
|
typedef struct {
|
|
char key[TT_MDNS_TXT_KEY_LEN];
|
|
char value[TT_MDNS_TXT_VALUE_LEN];
|
|
} TtMdnsTxtRecord;
|
|
|
|
/** One discovered service (copy-based, no pointers into mdns_result_t). */
|
|
typedef struct {
|
|
char instanceName[TT_MDNS_INSTANCE_LEN]; ///< e.g. "kidsOS-AB12"
|
|
char serviceType[TT_MDNS_SERVICE_TYPE_LEN];///< e.g. "_http"
|
|
char proto[TT_MDNS_PROTO_LEN]; ///< e.g. "_tcp"
|
|
char hostname[TT_MDNS_HOSTNAME_LEN]; ///< without .local
|
|
uint16_t port; ///< service port
|
|
char addresses[TT_MDNS_MAX_ADDRESSES][TT_MDNS_IP_LEN]; ///< resolved IPs
|
|
uint8_t addressCount;
|
|
char primaryAddress[TT_MDNS_IP_LEN]; ///< first IPv4 or first address
|
|
uint32_t ttl;
|
|
TtMdnsTxtRecord txtRecords[TT_MDNS_MAX_TXT_RECORDS];
|
|
uint8_t txtCount;
|
|
} TtMdnsService;
|
|
|
|
/** Result set returned by browse. */
|
|
typedef struct {
|
|
TtMdnsService services[TT_MDNS_MAX_RESULTS];
|
|
uint8_t count;
|
|
} TtMdnsBrowseResult;
|
|
|
|
/**
|
|
* @return true if mDNS is initialized and running.
|
|
*/
|
|
bool tt_mdns_is_available();
|
|
|
|
/**
|
|
* Browse for mDNS service instances.
|
|
*
|
|
* Blocks for up to timeoutMs.
|
|
*
|
|
* @param serviceType e.g. "_http", "_tactility" (with or without leading underscore both accepted, but conventional is with)
|
|
* @param proto e.g. "_tcp", "_udp"
|
|
* @param timeoutMs how long to wait (e.g. 3000ms). 0 = use default 3000ms.
|
|
* @param maxResults clamp to TT_MDNS_MAX_RESULTS. 0 = default 20.
|
|
* @param outResult filled with 0..maxResults services. Caller provides storage.
|
|
* @return true on successful query (even 0 results is success). false if mDNS not running.
|
|
*/
|
|
bool tt_mdns_browse(const char* serviceType, const char* proto, uint32_t timeoutMs, size_t maxResults, TtMdnsBrowseResult* outResult);
|
|
|
|
/**
|
|
* Resolve a hostname like "kidsOS-AB12" or "kidsOS-AB12.local" to an IPv4 address string.
|
|
*
|
|
* @param hostname hostname (".local" suffix optional)
|
|
* @param timeoutMs wait time, 0 = 2000ms default
|
|
* @param outIp buffer of at least TT_MDNS_IP_LEN, filled with IP string e.g. "192.168.1.42"
|
|
* @return true if resolved.
|
|
*/
|
|
bool tt_mdns_resolve_hostname(const char* hostname, uint32_t timeoutMs, char* outIp);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|