Files
story/firmware/echoear-platform-agent/main/platform_client.h
T
Codex Local bf1233d5df
ci / verify (push) Canceled after 0s
feat: expand companion platform, device controls, and memoir workflows
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
2026-10-08 10:06:44 +08:00

66 lines
2.3 KiB
C

#pragma once
#include <stdbool.h>
#include <stddef.h>
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PLATFORM_DEVICE_ID_MAX 37
#define PLATFORM_DEVICE_SECRET_MAX 129
#define PLATFORM_HARDWARE_ID_MAX 65
typedef struct {
char instance_id[201];
char product_key[201];
char device_name[129];
char device_secret[257];
char hardware_id[PLATFORM_HARDWARE_ID_MAX];
} platform_volc_credential_t;
typedef struct {
char conversation_id[37];
char bot_id[201];
char provider_session_ref[201];
char session_nonce[257];
char config_digest[65];
char *session_update_json;
bool native_subtitle_primary;
} platform_agent_session_t;
esp_err_t platform_identity_save(const char *device_id, const char *device_secret);
bool platform_identity_is_configured(void);
const char *platform_last_error_code(void);
esp_err_t platform_client_init(void);
const char *platform_hardware_id(void);
const platform_volc_credential_t *platform_volc_credential(void);
esp_err_t platform_provision_volc_credential(void);
esp_err_t platform_recover_pending_conversation(void);
esp_err_t platform_create_agent_session(platform_agent_session_t *session);
esp_err_t platform_report_session_started(const platform_agent_session_t *session,
const char *provider_connection_ref);
esp_err_t platform_report_session_event(const platform_agent_session_t *session,
const char *event_type,
const char *error_code);
void platform_agent_session_free(platform_agent_session_t *session);
/* Link-safe hooks used by the vendor application component. */
const char *platform_runtime_instance_id(void);
const char *platform_runtime_product_key(void);
const char *platform_runtime_device_name(void);
const char *platform_runtime_device_secret(void);
esp_err_t platform_conversation_begin(void);
const char *platform_conversation_bot_id(void);
const char *platform_conversation_update_json(void);
esp_err_t platform_conversation_started(const char *provider_connection_ref);
int platform_conversation_poll(void);
bool platform_conversation_audio_authorized(void);
esp_err_t platform_conversation_turn(const char *speaker, const char *source_id, const char *text);
void platform_conversation_finish(bool failed, const char *error_code);
#ifdef __cplusplus
}
#endif