cmiot_sys.h 源码
2026/7/20大约 1 分钟附录源码附录OTA
cmiot_sys.h — OTA 系统接口头文件
路径: components/ota/cmiot/port/cmiot_sys.h
功能: OTA 远程升级组件的系统服务接口声明,提供延时、时间获取、日志输出和设备重启等基本系统功能映射。
引用章节: 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_sys.h
*
* @brief Interface related to OS.
*
* @revision
* Date Author Notes
* 2021-04-09 OneOS Team First version.
***********************************************************************************************************************/
#ifndef __CMIOT_SYS_H__
#define __CMIOT_SYS_H__
#include "cmiot_type.h"
#if defined(__cplusplus)
extern "C" {
#endif
void cmiot_msleep(cmiot_uint32 time);
cmiot_uint32 cmiot_get_now_time(void);
void cmiot_printf(cmiot_char *data, cmiot_uint32 len);
void cmiot_reboot_device(void);
#if defined(__cplusplus)
}
#endif
#endif /* __CMIOT_SYS_H__ */关键说明
| 模块 | 说明 |
|---|---|
| cmiot_msleep | 毫秒延时,映射到 os_task_msleep,OTA 下载过程中等待网络响应 |
| cmiot_get_now_time | 获取当前相对时间(毫秒),用于超时判断和日志时间戳 |
| cmiot_printf | 日志输出,映射到 os_kprintf,用于 OTA 过程日志 |
| cmiot_reboot_device |