135 lines
3.6 KiB
C
Raw Normal View History

/*************************************************************
*
* Copyright (C) POKA
* All rights reserved.
*
*************************************************************/
#ifndef __APPLICATION_H__
#define __APPLICATION_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
//小智AI OTA URL地址
char activation_code[32];
char websocket_url[128];
uint32_t led_brightness;
uint32_t led_timeout;
uint32_t sleep_timeout;
}app_config_t;
2025-07-12 02:11:33 +08:00
typedef enum AecMode {
kAecOff,
kAecOnDeviceSide,
kAecOnServerSide,
2025-07-12 02:11:33 +08:00
}AecMode;
2025-07-12 02:11:33 +08:00
typedef enum DeviceState {
kDeviceStateUnknown,
kDeviceStateStarting,
kDeviceStateWifiConfiguring,
kDeviceStateIdle,
kDeviceStateConnecting,
kDeviceStateListening,
kDeviceStateSpeaking,
kDeviceStateUpgrading,
kDeviceStateActivating,
kDeviceStateAudioTesting,
kDeviceStateFatalError
2025-07-12 02:11:33 +08:00
}DeviceState;
2025-07-12 02:11:33 +08:00
typedef enum AbortReason {
kAbortReasonNone,
kAbortReasonWakeWordDetected
2025-07-12 02:11:33 +08:00
}AbortReason;
2025-07-12 02:11:33 +08:00
typedef enum ListeningMode {
kListeningModeAutoStop,
kListeningModeManualStop,
kListeningModeRealtime // 需要 AEC 支持
2025-07-12 02:11:33 +08:00
}ListeningMode;
#include "cJSON.h"
/**
* 1.1.1
* OTA升级电量限制 25%
*
* OTA时关闭语音
*
*
* 1.1.3
* 1.
* 2.PWM 100%
* 3.
* 4.IOT上报相关的消息
* 5 .
*
* 1.1.4
* 10
*
* 1.1.5
*
*
* 1.1.6
*
* BLE设置灯光常亮时异常问题
*
* 1.2.0
* MCP控制协议
*
*
*
*/
#define APPLICATION_VERSION "1.2.0"
#define APPLICATION_DEFULT_OTA_URL "https://xiaozhi.xa-poka.com/xiaozhi/ota/"
#define APPLICATION_CONFIG_KEY_AI_URL "ai_url"
#define APPLICATION_DEFULT_OTA_ADD_DEV_URL "https://xiaozhi.xa-poka.com/xiaozhi/device/manual-add"
#define APPLICATION_DEFULT_TOKEN "test-token"
#define APPLICATION_DEFULT_PROTOCOL_VERSION 2
/**
* https://xiaozhi.xa-poka.com/xiaozhi/device/bind/20fea9573bf54b69b685395f6b67ae72
* AI Agent ID使ID
*/
#define APPLICATION_DEFULT_AI_AGENT_ID "20fea9573bf54b69b685395f6b67ae72"
/**
* 10 - 10
*/
#define APPLICATION_DEFULT_LIGHT_TIMEOUT 10
/**
*
*/
#define APPLICATION_DEFULT_LIGHT_BRIGHTNESS 100
/**
* 10 - 10
*/
#define APPLICATION_DEFULT_SLEEP_TIMEOUT 10
/**
* 使MCP协议
*/
#define APPLICATION_IOT_PROTOCOL_MCP 1
#define APPLICATION_DEVICE_BOARD_NAME "bread-compact-wifi-ir58"
#define APPLICATION_DEVICE_BOARD_TYPE "bread-compact-wifi"
app_config_t* app_get_config();
void app_set_websocket_url(const char* url);
void app_ai_agent_start();
void app_start();
2025-07-12 02:11:33 +08:00
void app_set_device_state(DeviceState state);
DeviceState app_get_device_state();
#ifdef __cplusplus
}
#endif
#endif