cmiot_cmd.h 源码
2026/7/20大约 1 分钟附录源码附录OTA
cmiot_cmd.h — OTA 升级命令接口头文件
路径: components/ota/cmiot/port/cmiot_cmd.h
功能: OTA 远程升级组件的 Shell 命令接口声明,提供 cmiot_cv(开始升级)和 cmiot_ru(上报升级结果)命令。
引用章节: 7.8 OTA 远程升级组件
完整源码
/**
***********************************************************************************************************************
* Copyright (c) 2021, China Mobile Communications Group Co.,Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* @file cmiot_cmd.h
*
* @brief Interface related to OS.
*
* @revision
* Date Author Notes
* 2021-04-09 OneOS Team First version.
***********************************************************************************************************************/
#ifndef __CMIOT_CMD_H__
#define __CMIOT_CMD_H__
#include "cmiot_type.h"
#include <os_util.h>
#ifdef __cplusplus
extern "C" {
#endif
os_err_t cmiot_cv(int argc, char **argv);
os_err_t cmiot_ru(int argc, char **argv);
#ifdef CMIOT_USING_MULTI_MASTER
os_err_t cmiot_cv_slave(int argc, char **argv);
os_err_t cmiot_ru_slave(int argc, char **argv);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __CMIOT_CMD_H__ */关键说明
| 模块 | 说明 |
|---|---|
| cmiot_cv | 启动 OTA 升级流程,调用 cmiot_upgrade() 开始下载和升级 |
| cmiot_ru | 上报升级结果,调用 cmiot_report_upgrade() 向云端报告升级状态 |
| 多主模式 | CMIOT_USING_MULTI_MASTER 启用时,额外提供 cmiot_cv_slave / cmiot_ru_slave 用于从设备升级 |