Refresh both AGENTS guides and clarify module purpose, usage, ownership, threading, return values and wire formats in headers. Remove the unused timeout_heap freed_count field and unimplemented getter.
27 lines
1.3 KiB
C
27 lines
1.3 KiB
C
/* Каркас TCP-управления Android headless: init → регулярный poll → destroy в одном потоке.
|
|
* ua сейчас не используется; основной рабочий API чата — src/chat/chat_headless_control.h.
|
|
* JSON line: {"id":N,"cmd":"..."} → {"id":N,"ok":true,"data":...} либо error.
|
|
* ping/status/connections/debug_level возвращают заглушки; subscribe/quit управляют клиентом.
|
|
* join/chat_setting обращаются к запущенному instance_lite; прочие команды дают not implemented.
|
|
* event/broadcast_log отправляют JSON подписанным клиентам. Этот модуль сам ядро не запускает. */
|
|
#ifndef HEADLESS_CONTROL_H
|
|
#define HEADLESS_CONTROL_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
struct UASYNC;
|
|
|
|
/* ── Lifecycle ── */
|
|
|
|
int headless_control_init(struct UASYNC* ua, const char* bind_ip, int port);
|
|
void headless_control_poll(void);
|
|
void headless_control_destroy(void);
|
|
|
|
/* ── Send event to all subscribed clients ── */
|
|
|
|
void headless_control_event(const char* json_event);
|
|
void headless_control_broadcast_log(const char* level, const char* category, const char* msg);
|
|
|
|
#endif /* HEADLESS_CONTROL_H */
|