113 lines
2.6 KiB
C
Executable File
113 lines
2.6 KiB
C
Executable File
/*************************************************************
|
||
*
|
||
* Copyright (C) POKA
|
||
* All rights reserved.
|
||
*
|
||
*************************************************************/
|
||
#ifndef __APPLICATION_H__
|
||
#define __APPLICATION_H__
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
|
||
typedef struct
|
||
{
|
||
//小智AI OTA URL地址
|
||
uint8_t ota_url[128];
|
||
uint32_t led_brightness;
|
||
uint32_t led_timeout;
|
||
uint32_t sleep_timeout;
|
||
}app_config_t;
|
||
|
||
enum AecMode {
|
||
kAecOff,
|
||
kAecOnDeviceSide,
|
||
kAecOnServerSide,
|
||
};
|
||
|
||
enum DeviceState {
|
||
kDeviceStateUnknown,
|
||
kDeviceStateStarting,
|
||
kDeviceStateWifiConfiguring,
|
||
kDeviceStateIdle,
|
||
kDeviceStateConnecting,
|
||
kDeviceStateListening,
|
||
kDeviceStateSpeaking,
|
||
kDeviceStateUpgrading,
|
||
kDeviceStateActivating,
|
||
kDeviceStateAudioTesting,
|
||
kDeviceStateFatalError
|
||
};
|
||
|
||
enum AbortReason {
|
||
kAbortReasonNone,
|
||
kAbortReasonWakeWordDetected
|
||
};
|
||
|
||
enum ListeningMode {
|
||
kListeningModeAutoStop,
|
||
kListeningModeManualStop,
|
||
kListeningModeRealtime // 需要 AEC 支持
|
||
};
|
||
|
||
|
||
#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设置灯光常亮时异常问题
|
||
*/
|
||
|
||
#define APPLICATION_VERSION "1.1.6"
|
||
#define APPLICATION_DEFULT_OTA_URL "https://xiaozhi.xa-poka.com/xiaozhi/ota/"
|
||
#define APPLICATION_CONFIG_KEY_AI_URL "ai_url"
|
||
/**
|
||
*开灯超时关闭 单位分钟 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 "Poka"
|
||
void app_set_ota_url(char * ota_url);
|
||
char* app_get_ota_url();
|
||
|
||
void app_start();
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
#endif
|