@iot9x.com/ipc-utils
Version:
九星云、九星小程序、九星配置工具所共用的库方法
102 lines (101 loc) • 4.99 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JL800_ErrorType = exports.JL800_UART_BAUDRATE = exports.JL800_CMD_CODE = exports.PAYLOAD_END_CODE = exports.PAYLOAD_START_CODE = void 0;
/** 起始标记 */
exports.PAYLOAD_START_CODE = 0x7e;
/** 结束标记 */
exports.PAYLOAD_END_CODE = 0xef;
/** 命令编码 */
var JL800_CMD_CODE;
(function (JL800_CMD_CODE) {
//#region 控制指令部分
/** 下一曲 */
JL800_CMD_CODE[JL800_CMD_CODE["Next"] = 17] = "Next";
/** 上一曲 */
JL800_CMD_CODE[JL800_CMD_CODE["Prev"] = 18] = "Prev";
/** 播放指定曲目 */
JL800_CMD_CODE[JL800_CMD_CODE["PlayByNumber"] = 19] = "PlayByNumber";
/** 音量+ */
JL800_CMD_CODE[JL800_CMD_CODE["VolUp"] = 20] = "VolUp";
/** 音量- */
JL800_CMD_CODE[JL800_CMD_CODE["VolDown"] = 21] = "VolDown";
/** 指定音量,取值范围:0-30 */
JL800_CMD_CODE[JL800_CMD_CODE["VolSet"] = 22] = "VolSet";
/** 播放指定曲目(单曲循环模式) */
JL800_CMD_CODE[JL800_CMD_CODE["PlayByNumberRepeat"] = 24] = "PlayByNumberRepeat";
/** 设置串口波特率 */
JL800_CMD_CODE[JL800_CMD_CODE["SetBaudrate"] = 27] = "SetBaudrate";
/** 芯片复位(重启) */
JL800_CMD_CODE[JL800_CMD_CODE["Reboot"] = 28] = "Reboot";
/** 播放 */
JL800_CMD_CODE[JL800_CMD_CODE["Play"] = 29] = "Play";
/** 暂停 */
JL800_CMD_CODE[JL800_CMD_CODE["Pause"] = 30] = "Pause";
/** 全部循环播放 */
JL800_CMD_CODE[JL800_CMD_CODE["RepeatAll"] = 33] = "RepeatAll";
/** 停止播放 */
JL800_CMD_CODE[JL800_CMD_CODE["Stop"] = 38] = "Stop";
/** 全部随机播放 */
JL800_CMD_CODE[JL800_CMD_CODE["RandomAll"] = 40] = "RandomAll";
/** 当前播放的曲目设置为循环播放,要在播放时发送才有效! */
JL800_CMD_CODE[JL800_CMD_CODE["RepeatCurrent"] = 41] = "RepeatCurrent";
/** 组合播放 */
JL800_CMD_CODE[JL800_CMD_CODE["PlayCombine"] = 49] = "PlayCombine";
/** 恢复出厂设置 */
JL800_CMD_CODE[JL800_CMD_CODE["DefaultFactory"] = 209] = "DefaultFactory";
//#endregion
//#region 查询指令部分
/** 查询当前状态 */
JL800_CMD_CODE[JL800_CMD_CODE["GetStatus"] = 66] = "GetStatus";
/** 查询当前音量 */
JL800_CMD_CODE[JL800_CMD_CODE["GetVol"] = 67] = "GetVol";
/** 查询软件版本 */
JL800_CMD_CODE[JL800_CMD_CODE["GetVersion"] = 67] = "GetVersion";
/** 查询内置的 spi flash 总文件数 */
JL800_CMD_CODE[JL800_CMD_CODE["GetSpiFlashFileCount"] = 74] = "GetSpiFlashFileCount";
/** 查询当前设备的文件总数 */
JL800_CMD_CODE[JL800_CMD_CODE["GetFileCount"] = 98] = "GetFileCount";
//#endregion
//#region 应答部分
/** 曲目播放完毕 */
JL800_CMD_CODE[JL800_CMD_CODE["ResPlayEnd"] = 61] = "ResPlayEnd";
/** 内部存储空间读取结果 */
JL800_CMD_CODE[JL800_CMD_CODE["ResReadFlash"] = 63] = "ResReadFlash";
/** 错误信息 */
JL800_CMD_CODE[JL800_CMD_CODE["ResErr"] = 64] = "ResErr";
/** 握手回复 */
JL800_CMD_CODE[JL800_CMD_CODE["ResShakeHand"] = 65] = "ResShakeHand";
//#endregion
})(JL800_CMD_CODE || (exports.JL800_CMD_CODE = JL800_CMD_CODE = {}));
/** 支持的串口波特率枚举 */
var JL800_UART_BAUDRATE;
(function (JL800_UART_BAUDRATE) {
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B600"] = 0] = "B600";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B1200"] = 1] = "B1200";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B2400"] = 2] = "B2400";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B4800"] = 3] = "B4800";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B9600"] = 4] = "B9600";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B19200"] = 5] = "B19200";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B38400"] = 6] = "B38400";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B57600"] = 7] = "B57600";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B115200"] = 8] = "B115200";
JL800_UART_BAUDRATE[JL800_UART_BAUDRATE["B256000"] = 9] = "B256000";
})(JL800_UART_BAUDRATE || (exports.JL800_UART_BAUDRATE = JL800_UART_BAUDRATE = {}));
/** 错误类型枚举 */
var JL800_ErrorType;
(function (JL800_ErrorType) {
/** 返回忙 */
JL800_ErrorType[JL800_ErrorType["Busy"] = 1] = "Busy";
/** 当前是休眠模式 */
JL800_ErrorType[JL800_ErrorType["IsSleep"] = 2] = "IsSleep";
/** 串口接收错误 */
JL800_ErrorType[JL800_ErrorType["UartReceiveError"] = 3] = "UartReceiveError";
/** 校验出错 */
JL800_ErrorType[JL800_ErrorType["ValidateError"] = 4] = "ValidateError";
/** 指定文件超范围 */
JL800_ErrorType[JL800_ErrorType["InvalidFileError"] = 5] = "InvalidFileError";
/** 未找到指定文件 */
JL800_ErrorType[JL800_ErrorType["FileNotFoundError"] = 6] = "FileNotFoundError";
/** 进入睡眠 */
JL800_ErrorType[JL800_ErrorType["GoToSleep"] = 7] = "GoToSleep";
})(JL800_ErrorType || (exports.JL800_ErrorType = JL800_ErrorType = {}));