#ifndef _INCLUDE_EXTERN_INTERFACE_H_ #define _INCLUDE_EXTERN_INTERFACE_H_ #include #include #include #define ET_TYPE_NONE 0 #define ET_TYPE_TEXT 1 #define ET_TYPE_AUDIO 2 #define ET_TYPE_COMMAND 3 #define ET_TYPE_ALARM 4 #define ET_TYPE_TELEMETRY_REQUEST 5 #define ET_SYS_STATUS_WAKE 1 #if defined(_MSC_VER) #define EXTERN_INTERFACE_PUBLIC __declspec(dllexport) #elif defined(__GNUC__) #define EXTERN_INTERFACE_PUBLIC __attribute__ ((dllexport)) #endif #ifdef __cplusplus extern "C" { #endif struct TelemetryRequestData { bool keep_sys_running; bool close_asr; int sys_state; bool volume_key_pressed; bool wakeup_key_pressed; int volume_grade; // 0, 1, 2 int sys_ver_high; int sys_ver_low; int app_ver_high; int app_ver_low; }; union PacketData { int64_t pd_integer; double pd_float; const char* pd_text; void* pd_pointer; }; typedef void (*et_callback_t)(uint32_t, size_t, union PacketData); EXTERN_INTERFACE_PUBLIC int extern_interface_init(const char* config_path, et_callback_t cb); EXTERN_INTERFACE_PUBLIC void extern_interface_send(uint32_t type, size_t len, union PacketData data); #ifdef __cplusplus } #endif #endif