11bd4fe43Sopenharmony_ci/** 21bd4fe43Sopenharmony_ci* @file hi_diag.h 31bd4fe43Sopenharmony_ci* 41bd4fe43Sopenharmony_ci* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 51bd4fe43Sopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License"); 61bd4fe43Sopenharmony_ci* you may not use this file except in compliance with the License. 71bd4fe43Sopenharmony_ci* You may obtain a copy of the License at 81bd4fe43Sopenharmony_ci* 91bd4fe43Sopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0 101bd4fe43Sopenharmony_ci* 111bd4fe43Sopenharmony_ci* Unless required by applicable law or agreed to in writing, software 121bd4fe43Sopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS, 131bd4fe43Sopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 141bd4fe43Sopenharmony_ci* See the License for the specific language governing permissions and 151bd4fe43Sopenharmony_ci* limitations under the License. 161bd4fe43Sopenharmony_ci*/ 171bd4fe43Sopenharmony_ci 181bd4fe43Sopenharmony_ci/** @defgroup iot_diag Diagnostic 191bd4fe43Sopenharmony_ci * @ingroup dfx 201bd4fe43Sopenharmony_ci */ 211bd4fe43Sopenharmony_ci 221bd4fe43Sopenharmony_ci#ifndef __HI_DIAG_H__ 231bd4fe43Sopenharmony_ci#define __HI_DIAG_H__ 241bd4fe43Sopenharmony_ci 251bd4fe43Sopenharmony_ci#include <hi_types.h> 261bd4fe43Sopenharmony_ci#include <hi_uart.h> 271bd4fe43Sopenharmony_ci 281bd4fe43Sopenharmony_ci/** 291bd4fe43Sopenharmony_ci* @ingroup iot_diag 301bd4fe43Sopenharmony_ci* @brief Registers the callback function for DIAG channel status changes. 311bd4fe43Sopenharmony_ciCNcomment:注册DIAG通道状态变更回调函数。CNend 321bd4fe43Sopenharmony_ci* 331bd4fe43Sopenharmony_ci* @par 描述: 341bd4fe43Sopenharmony_ci* Registers the callback function for DIAG channel status changes. That is, when the DIAG channel is 351bd4fe43Sopenharmony_ci* connected or disconnected, the function registered by this API is called back. 361bd4fe43Sopenharmony_ciCNcomment:注册DIAG通道变更回调函数(即:当DIAG通道连接或断开时,会回调本接口注册的函数)。CNend 371bd4fe43Sopenharmony_ci* 381bd4fe43Sopenharmony_ci* @attention None 391bd4fe43Sopenharmony_ci* @param connect_notify_func [IN] type #hi_diag_connect_f,User function. CNcomment:用户函数。CNend 401bd4fe43Sopenharmony_ci* 411bd4fe43Sopenharmony_ci* @retval #0 Success. 421bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 431bd4fe43Sopenharmony_ci* @par 依赖: 441bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 451bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 461bd4fe43Sopenharmony_ci* @see None 471bd4fe43Sopenharmony_ci*/ 481bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_register_connect_notify(hi_diag_connect_f connect_notify_func); 491bd4fe43Sopenharmony_ci 501bd4fe43Sopenharmony_ci/** 511bd4fe43Sopenharmony_ci* @ingroup iot_diag 521bd4fe43Sopenharmony_ci* @brief Checks the connection status of the DIAG channel. CNcomment:检测DIAG通道连接状态的函数。CNend 531bd4fe43Sopenharmony_ci* 541bd4fe43Sopenharmony_ci* @par 描述: 551bd4fe43Sopenharmony_ci* Checks the connection status of the DIAG channel. CNcomment:检测DIAG通道是否处于连接状态的函数 。CNend 561bd4fe43Sopenharmony_ci* 571bd4fe43Sopenharmony_ci* @attention None 581bd4fe43Sopenharmony_ci* @param None 591bd4fe43Sopenharmony_ci* 601bd4fe43Sopenharmony_ci* @retval HI_FALSE disconnected. CNcomment:处于非连接状态。CNend 611bd4fe43Sopenharmony_ci* @retval HI_TRUE connected. CNcomment:处于连接状态。CNend 621bd4fe43Sopenharmony_ci* @par 依赖: 631bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 641bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 651bd4fe43Sopenharmony_ci* @see None 661bd4fe43Sopenharmony_ci*/ 671bd4fe43Sopenharmony_ciHI_EXTERN hi_bool hi_diag_is_connect(hi_void); 681bd4fe43Sopenharmony_ci 691bd4fe43Sopenharmony_ci/** 701bd4fe43Sopenharmony_ci* @ingroup iot_diag 711bd4fe43Sopenharmony_ci* @brief Registers the command handling function. CNcomment:注册命令处理函数。CNend 721bd4fe43Sopenharmony_ci* 731bd4fe43Sopenharmony_ci* @par 描述: 741bd4fe43Sopenharmony_ci* @li Called at initialize stage, does NOT support multiable task calls. 751bd4fe43Sopenharmony_ciCNcomment:在初始化阶段调用, 不支持多任务调用。CNend 761bd4fe43Sopenharmony_ci* @li The DIAG subsystem supports a maximum of 10 different command tables. 771bd4fe43Sopenharmony_ciCNcomment:最多能注册10个不同的命令表。CNend 781bd4fe43Sopenharmony_ci* 791bd4fe43Sopenharmony_ci* @attention None 801bd4fe43Sopenharmony_ci* @param p_cmd_tbl [IN] type #const hi_diag_cmd_reg_obj*,Command table, which must be declared as a constant array 811bd4fe43Sopenharmony_ci* and transmitted to this parameter. 821bd4fe43Sopenharmony_ciCNcomment:命令表,必须申明为常量数组传给该参数。CNend 831bd4fe43Sopenharmony_ci* @param cmd_num [IN] type #hi_u16,Number of commands. The value cannot be 0. CNcomment:命令个数, 841bd4fe43Sopenharmony_ci如果usCmdNum为0而pstCmdTbl不为0,则取消注册。CNend 851bd4fe43Sopenharmony_ci* 861bd4fe43Sopenharmony_ci* @retval #0 Success. 871bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 881bd4fe43Sopenharmony_ci* @par 依赖: 891bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 901bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 911bd4fe43Sopenharmony_ci* @see None 921bd4fe43Sopenharmony_ci*/ 931bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_register_cmd(const hi_diag_cmd_reg_obj* cmd_tbl, hi_u16 cmd_num); 941bd4fe43Sopenharmony_ci 951bd4fe43Sopenharmony_ci/** 961bd4fe43Sopenharmony_ci* @ingroup iot_diag 971bd4fe43Sopenharmony_ci* @brief Reports DIAG packets. CNcomment:DIAG包上报。CNend 981bd4fe43Sopenharmony_ci* 991bd4fe43Sopenharmony_ci* @par 描述: 1001bd4fe43Sopenharmony_ci* Reports DIAG channel packets to the DIAG client. 1011bd4fe43Sopenharmony_ciCNcomment:该函数用于将DIAG通道报文上报给DIAG客户端。CNend 1021bd4fe43Sopenharmony_ci* 1031bd4fe43Sopenharmony_ci* @attention 1041bd4fe43Sopenharmony_ci* This API can not be used in interrupt when report data synchronously. 1051bd4fe43Sopenharmony_ciCNcomment:当同步上报数据时,该接口不支持在中断中调用。CNend 1061bd4fe43Sopenharmony_ci* @param cmd_id [IN] type #hi_u16,DIAG data packet ID. CNcomment:DIAG应答包ID。CNend 1071bd4fe43Sopenharmony_ci* @param instance_id [IN] type #hi_u8,Command type.This parameter is used to obtain the command type in the 1081bd4fe43Sopenharmony_ci* option parameter of the command callback function hi_diag_cmd_f.currently only support 1091bd4fe43Sopenharmony_ci* HI_DIAG_CMD_INSTANCE_LOCAL. 1101bd4fe43Sopenharmony_ciCNcomment:命令类型。在命令回调函数hi_diag_cmd_f的option参数中获取命令类型,在函数中使用 1111bd4fe43Sopenharmony_ci此接口回复报文时,通过本参数传递。当前仅支持HI_DIAG_CMD_INSTANCE_LOCAL。CNend 1121bd4fe43Sopenharmony_ci* @param buffer [IN] type #hi_pbyte,Buffer address of the data packet. This function does not release the 1131bd4fe43Sopenharmony_ci* pointer. CNcomment:数据包的buffer地址,该函数不会释放该指针。CNend 1141bd4fe43Sopenharmony_ci* @param buffer_size [IN] type #hi_u16,Data packet size (unit: byte), range[0, 65507] 1151bd4fe43Sopenharmony_ciCNcomment:数据包大小(单位:byte),取值范围[0, 65507]。CNend 1161bd4fe43Sopenharmony_ci* @param sync [IN] type #hi_bool,Synchronous or asynchronous DIAG packet pushing. TRUE indicates that the 1171bd4fe43Sopenharmony_ci* packets are pushed synchronously and the operation is blocked. FALSE indicates the packets 1181bd4fe43Sopenharmony_ci* are pushed asynchronously (with the memory allocated, the packet is cashed by the OS queue 1191bd4fe43Sopenharmony_ci* before being pushed), and the operation is not blocked. 1201bd4fe43Sopenharmony_ciCNcomment:DIAG包同步/异步上报设置。TRUE表示同步上报, 阻塞操作; FALSE表示异步 1211bd4fe43Sopenharmony_ci(通过分配内存后, 由OS队列缓存再上报), 非阻塞操作。CNend 1221bd4fe43Sopenharmony_ci* 1231bd4fe43Sopenharmony_ci* 1241bd4fe43Sopenharmony_ci* @retval #0 Success. 1251bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 1261bd4fe43Sopenharmony_ci* @par 依赖: 1271bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 1281bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 1291bd4fe43Sopenharmony_ci* @see None 1301bd4fe43Sopenharmony_ci*/ 1311bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_report_packet(hi_u16 cmd_id, hi_u8 instance_id, hi_pbyte buffer, 1321bd4fe43Sopenharmony_ci hi_u16 buffer_size, hi_bool sync); 1331bd4fe43Sopenharmony_ci 1341bd4fe43Sopenharmony_ci/** 1351bd4fe43Sopenharmony_ci* @ingroup iot_diag 1361bd4fe43Sopenharmony_ci* @brief Sends ACK packets to the DIAG client. CNcomment:应答回复。CNend 1371bd4fe43Sopenharmony_ci* 1381bd4fe43Sopenharmony_ci* @par 描述: 1391bd4fe43Sopenharmony_ci* Sends ACK packets to the DIAG client. CNcomment:该函数用于回复报文或ACK给DIAG客户端。CNend 1401bd4fe43Sopenharmony_ci* 1411bd4fe43Sopenharmony_ci* @attention 1421bd4fe43Sopenharmony_ci* This API can not be used in interrupt.CNcomment:该接口不支持在中断中调用。CNend 1431bd4fe43Sopenharmony_ci* @param cmd_id [IN] type #hi_u16,DIAG ACK packet ID. CNcomment:DIAG包ID。CNend 1441bd4fe43Sopenharmony_ci* @param instance_id [IN] type #hi_u8,Command type.This parameter is used to obtain the command type in the 1451bd4fe43Sopenharmony_ci* option parameter of the command callback function hi_diag_cmd_f.currently only support 1461bd4fe43Sopenharmony_ci* HI_DIAG_CMD_INSTANCE_LOCAL. 1471bd4fe43Sopenharmony_ciCNcoment:在命令回调函数HI_DIAG_CMD_F的option参数中获取命令类型,在函数中使用此接口回复 1481bd4fe43Sopenharmony_ci报文时,通过本参数传递。当前仅支持HI_DIAG_CMD_INSTANCE_LOCAL。CNend 1491bd4fe43Sopenharmony_ci* @param buffer [IN] type #hi_pbyte,Buffer address of the data packet. This function does not release the 1501bd4fe43Sopenharmony_ci* pointer. CNcomment:数据包的buffer地址,该函数不会释放该指针。CNend 1511bd4fe43Sopenharmony_ci* @param buffer_size [IN] type #hi_u16,Data packet size(unit: byte), range[0, 1024] 1521bd4fe43Sopenharmony_ciCNcomment:数据包大小(单位:byte),取值范围[0, 1024]。CNend 1531bd4fe43Sopenharmony_ci* 1541bd4fe43Sopenharmony_ci* @retval #HI_ERR_CONSUMED Success. 1551bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 1561bd4fe43Sopenharmony_ci* @par 依赖: 1571bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 1581bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 1591bd4fe43Sopenharmony_ci* @see None 1601bd4fe43Sopenharmony_ci*/ 1611bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_send_ack_packet(hi_u16 cmd_id, hi_u8 instance_id, hi_pvoid buffer, hi_u16 buffer_size); 1621bd4fe43Sopenharmony_ci 1631bd4fe43Sopenharmony_ci/** 1641bd4fe43Sopenharmony_ci* @ingroup iot_diag 1651bd4fe43Sopenharmony_ci* @brief Registers the callback function for notifying DIAG operations. 1661bd4fe43Sopenharmony_ciCNcomment:注册DIAG操作通知回调函数。CNend 1671bd4fe43Sopenharmony_ci* 1681bd4fe43Sopenharmony_ci* @par 描述: 1691bd4fe43Sopenharmony_ci* Carbon copies data to the app layer by using a callback function in the case of data interaction between 1701bd4fe43Sopenharmony_ci* the host and the board.CNcommand:该函数用于当上位机与单板有数据交互发生时, 1711bd4fe43Sopenharmony_ci将数据通过回调函数抄送给应用层。CNend 1721bd4fe43Sopenharmony_ci* 1731bd4fe43Sopenharmony_ci* @attention None 1741bd4fe43Sopenharmony_ci* @param cmd_notify_func [IN] type #hi_diag_cmd_notify_f*,When data interaction occurs between the HSO and the board, 1751bd4fe43Sopenharmony_ci* this API is used to notify the app layer. 1761bd4fe43Sopenharmony_ciCNcomment:当HSO与单板有数据交互发生时,通过该接口通知应用层。CNend 1771bd4fe43Sopenharmony_ci* 1781bd4fe43Sopenharmony_ci* 1791bd4fe43Sopenharmony_ci* @retval #0 Success. 1801bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 1811bd4fe43Sopenharmony_ci* @par 依赖: 1821bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 1831bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 1841bd4fe43Sopenharmony_ci* @see None 1851bd4fe43Sopenharmony_ci*/ 1861bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_register_cmd_notify(hi_diag_cmd_notify_f cmd_notify_func); 1871bd4fe43Sopenharmony_ci 1881bd4fe43Sopenharmony_ci/** 1891bd4fe43Sopenharmony_ci* @ingroup iot_diag 1901bd4fe43Sopenharmony_ci* @brief Sets the UART parameters of the DIAG channel. CNcomment:设置诊断通道UART参数。CNend 1911bd4fe43Sopenharmony_ci* 1921bd4fe43Sopenharmony_ci* @par 描述: 1931bd4fe43Sopenharmony_ci* Sets the UART parameters of the used by the DIAG subsystem before the DIAG subsystem is initialized. 1941bd4fe43Sopenharmony_ciCNcomment:该函数用于在诊断子系统初始化之前,设置诊断子系统使用的UART的相关参数。CNend 1951bd4fe43Sopenharmony_ci* 1961bd4fe43Sopenharmony_ci* @attention The parameters must be set before the initialization of the DIAG subsystem. 1971bd4fe43Sopenharmony_ciCNcomment:必须在诊断子系统初始化之前设置才可生效。CNend 1981bd4fe43Sopenharmony_ci* @param uart_port [IN] type #hi_uart_idx,UART port number used by the DIAG subsystem. 1991bd4fe43Sopenharmony_ciCNcomment:诊断子系统使用的UART端口号。CNend 2001bd4fe43Sopenharmony_ci* @param uart_cfg [IN] type #hi_uart_attribute,UART configuration used by the DIAG subsystem. 2011bd4fe43Sopenharmony_ciCNcomment:诊断子系统使用的UART配置。CNend 2021bd4fe43Sopenharmony_ci* 2031bd4fe43Sopenharmony_ci* @retval #0 Success. 2041bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 2051bd4fe43Sopenharmony_ci* @par 依赖: 2061bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 2071bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 2081bd4fe43Sopenharmony_ci* @see None 2091bd4fe43Sopenharmony_ci*/ 2101bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_set_uart_param(hi_uart_idx uart_port, hi_uart_attribute uart_cfg); 2111bd4fe43Sopenharmony_ci 2121bd4fe43Sopenharmony_ci/** 2131bd4fe43Sopenharmony_ci* @ingroup iot_diag 2141bd4fe43Sopenharmony_ci* @brief Initializes the DIAG subsystem. CNcomment:诊断子系统初始化。CNend 2151bd4fe43Sopenharmony_ci* 2161bd4fe43Sopenharmony_ci* @par 描述: 2171bd4fe43Sopenharmony_ci* Initializes the DIAG subsystem. CNcomment:该函数用于初始化诊断子系统。CNend 2181bd4fe43Sopenharmony_ci* 2191bd4fe43Sopenharmony_ci* @attention The initialization of the DIAG subsystem needs to be performed only once. Repeated initialization is 2201bd4fe43Sopenharmony_ci* invalid. CNcomment:诊断子系统初始化只需执行一次,多次初始化无效。CNend 2211bd4fe43Sopenharmony_ci* @param None 2221bd4fe43Sopenharmony_ci* 2231bd4fe43Sopenharmony_ci* @retval #0 Success. 2241bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 2251bd4fe43Sopenharmony_ci* @par 依赖: 2261bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 2271bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 2281bd4fe43Sopenharmony_ci* @see None 2291bd4fe43Sopenharmony_ci*/ 2301bd4fe43Sopenharmony_ciHI_EXTERN hi_u32 hi_diag_init(hi_void); 2311bd4fe43Sopenharmony_ci 2321bd4fe43Sopenharmony_ci/** 2331bd4fe43Sopenharmony_ci* @ingroup iot_diag 2341bd4fe43Sopenharmony_ci* 2351bd4fe43Sopenharmony_ci* Structure for querying the number of command tables and statistic object tables. 2361bd4fe43Sopenharmony_ciCNcomment:命令注册列表和统计量对象注册列表个数查询结构体。CNend 2371bd4fe43Sopenharmony_ci*/ 2381bd4fe43Sopenharmony_citypedef struct { 2391bd4fe43Sopenharmony_ci hi_u8 cmd_list_total_cnt; /**< Number of command registration tables can be registered. 2401bd4fe43Sopenharmony_ci CNcomment:总共支持注册的命令列表个数 CNend */ 2411bd4fe43Sopenharmony_ci hi_u8 cmd_list_used_cnt; /**< Number of registered command tables. 2421bd4fe43Sopenharmony_ci CNcomment:已经注册的命令列表个数 CNend */ 2431bd4fe43Sopenharmony_ci hi_u8 stat_list_total_cnt; /**< Number of statistic object tables can be registered. Currently not support. 2441bd4fe43Sopenharmony_ci CNcomment:总共支持注册的统计量对象列表个数。当前暂不支持。 CNend */ 2451bd4fe43Sopenharmony_ci hi_u8 stat_list_used_cnt; /**< Number of registered statistic object tables. Currently not support. 2461bd4fe43Sopenharmony_ci CNcomment:已经注册的统计量对象列表个数。当前暂不支持。 CNend */ 2471bd4fe43Sopenharmony_ci} hi_diag_cmd_stat_reg_info; 2481bd4fe43Sopenharmony_ci 2491bd4fe43Sopenharmony_ci/** 2501bd4fe43Sopenharmony_ci* @ingroup iot_diag 2511bd4fe43Sopenharmony_ci* @brief Queries the registration status of the command tables and statistic tables of the DIAG subsystem. 2521bd4fe43Sopenharmony_ciCNcomment:查询诊断子系统命令列表和统计量列表注册情况。CNend 2531bd4fe43Sopenharmony_ci* 2541bd4fe43Sopenharmony_ci* @par 描述: 2551bd4fe43Sopenharmony_ci* Queries the registration status of the command tables and statistic tables of the DIAG subsystem. 2561bd4fe43Sopenharmony_ci* Number of registered command tables and number of command tables can be registered/ Number of registered 2571bd4fe43Sopenharmony_ci* statistic object tables 2581bd4fe43Sopenharmony_ciCNcomment:查询总共支持注册/已经注册的命令列表个数、总共支持注册/已经注册的统计量对象列表个数。CNend 2591bd4fe43Sopenharmony_ci* 2601bd4fe43Sopenharmony_ci* @attention None 2611bd4fe43Sopenharmony_ci* @param None 2621bd4fe43Sopenharmony_ci* 2631bd4fe43Sopenharmony_ci* @retval #hi_diag_cmd_stat_reg_info Structure of the number of registered command tables and statistic tables. 2641bd4fe43Sopenharmony_ciCNcomment:命令列表和统计量列表注册个数信息结构体。CNend 2651bd4fe43Sopenharmony_ci* @par 依赖: 2661bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 2671bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 2681bd4fe43Sopenharmony_ci* @see None 2691bd4fe43Sopenharmony_ci*/ 2701bd4fe43Sopenharmony_ciHI_EXTERN hi_diag_cmd_stat_reg_info hi_diag_get_cmd_stat_reg_info(hi_void); 2711bd4fe43Sopenharmony_ci 2721bd4fe43Sopenharmony_citypedef struct { 2731bd4fe43Sopenharmony_ci hi_u32 data0; 2741bd4fe43Sopenharmony_ci hi_u32 data1; 2751bd4fe43Sopenharmony_ci hi_u32 data2; 2761bd4fe43Sopenharmony_ci hi_u32 data3; 2771bd4fe43Sopenharmony_ci}diag_log_msg; 2781bd4fe43Sopenharmony_ci 2791bd4fe43Sopenharmony_ci/** 2801bd4fe43Sopenharmony_ci* @ingroup iot_diag 2811bd4fe43Sopenharmony_ci* @brief Reports usr packets. CNcomment:上报用户日志。CNend 2821bd4fe43Sopenharmony_ci* 2831bd4fe43Sopenharmony_ci* @par 描述: 2841bd4fe43Sopenharmony_ci* Reports usr packets. CNcomment:上报用户日志消息。CNend 2851bd4fe43Sopenharmony_ci* 2861bd4fe43Sopenharmony_ci* @attention None 2871bd4fe43Sopenharmony_ci* @param diag_usr_msg [IN] type #hi_diag_layer_msg,log message. CNcomment:日志消息。CNend 2881bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,level of log message, [HI_MSG_USR_L0, HI_MSG_USR_L4]. 2891bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_USR_L0- HI_MSG_USR_L4。CNend 2901bd4fe43Sopenharmony_ci* 2911bd4fe43Sopenharmony_ci* @retval #0 Success. 2921bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 2931bd4fe43Sopenharmony_ci* @par 依赖: 2941bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 2951bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 2961bd4fe43Sopenharmony_ci* @see None 2971bd4fe43Sopenharmony_ci*/ 2981bd4fe43Sopenharmony_cihi_u32 hi_diag_report_usr_msg(const hi_diag_layer_msg* diag_usr_msg, hi_u16 msg_level); 2991bd4fe43Sopenharmony_ci 3001bd4fe43Sopenharmony_ci/** 3011bd4fe43Sopenharmony_ci* @ingroup iot_diag 3021bd4fe43Sopenharmony_ci* @brief Reports simple packet that without data. CNcomment:上报简单日志,不携带数据内容。CNend 3031bd4fe43Sopenharmony_ci* 3041bd4fe43Sopenharmony_ci* @par 描述: 3051bd4fe43Sopenharmony_ci* Reports simple packets, fixed module ID. CNcomment:上报简单日志消息,固定模块ID。 3061bd4fe43Sopenharmony_ci* 3071bd4fe43Sopenharmony_ci* @attention None 3081bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 3091bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,log message level, [HI_MSG_SYS_L0, HI_MSG_SYS_L2] 3101bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_SYS_L0- HI_MSG_SYS_L2。CNend 3111bd4fe43Sopenharmony_ci* 3121bd4fe43Sopenharmony_ci* @retval #0 Success. 3131bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 3141bd4fe43Sopenharmony_ci* @par 依赖: 3151bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 3161bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 3171bd4fe43Sopenharmony_ci* @see None 3181bd4fe43Sopenharmony_ci*/ 3191bd4fe43Sopenharmony_cihi_u32 hi_diag_log_msg0(hi_u32 msg_id, hi_u16 msg_level); 3201bd4fe43Sopenharmony_ci 3211bd4fe43Sopenharmony_ci/** 3221bd4fe43Sopenharmony_ci* @ingroup iot_diag 3231bd4fe43Sopenharmony_ci* @brief Reports simple packet that with one word data. CNcomment:上报简单日志,携带1个数据。CNend 3241bd4fe43Sopenharmony_ci* 3251bd4fe43Sopenharmony_ci* @par 描述: 3261bd4fe43Sopenharmony_ci* Reports simple packets, fixed module ID. CNcomment:上报简单日志消息,固定模块ID。CNend 3271bd4fe43Sopenharmony_ci* 3281bd4fe43Sopenharmony_ci* @attention None 3291bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 3301bd4fe43Sopenharmony_ci* @param d0 [IN] type #hi_u32,first data. CNcomment:携带的第1个数据。Cnend 3311bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,log message level, [HI_MSG_SYS_L0, HI_MSG_SYS_L2] 3321bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_SYS_L0- HI_MSG_SYS_L2。CNend 3331bd4fe43Sopenharmony_ci* 3341bd4fe43Sopenharmony_ci* @retval #0 Success. 3351bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 3361bd4fe43Sopenharmony_ci* @par 依赖: 3371bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 3381bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 3391bd4fe43Sopenharmony_ci* @see None 3401bd4fe43Sopenharmony_ci*/ 3411bd4fe43Sopenharmony_cihi_u32 hi_diag_log_msg1(hi_u32 msg_id, hi_u32 d0, hi_u16 msg_level); 3421bd4fe43Sopenharmony_ci 3431bd4fe43Sopenharmony_ci/** 3441bd4fe43Sopenharmony_ci* @ingroup iot_diag 3451bd4fe43Sopenharmony_ci* @brief Reports simple packet that with 2 words data. CNcomment:上报简单日志,携带2个数据。CNend 3461bd4fe43Sopenharmony_ci* 3471bd4fe43Sopenharmony_ci* @par 描述: 3481bd4fe43Sopenharmony_ci* Reports simple packets, fixed module ID. CNcomment:上报简单日志消息,固定模块ID。CNend 3491bd4fe43Sopenharmony_ci* 3501bd4fe43Sopenharmony_ci* @attention None 3511bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 3521bd4fe43Sopenharmony_ci* @param d0 [IN] type #hi_u32,first data. CNcomment:携带的第1个数据。CNend 3531bd4fe43Sopenharmony_ci* @param d1 [IN] type #hi_u32,second data. CNcomment:携带的第2个数据。CNend 3541bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,log message level, [HI_MSG_SYS_L0, HI_MSG_SYS_L2] 3551bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_SYS_L0- HI_MSG_SYS_L2。CNend 3561bd4fe43Sopenharmony_ci* 3571bd4fe43Sopenharmony_ci* @retval #0 Success. 3581bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 3591bd4fe43Sopenharmony_ci* @par 依赖: 3601bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 3611bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 3621bd4fe43Sopenharmony_ci* @see None 3631bd4fe43Sopenharmony_ci*/ 3641bd4fe43Sopenharmony_cihi_u32 hi_diag_log_msg2(hi_u32 msg_id, hi_u32 d0, hi_u32 d1, hi_u16 msg_level); 3651bd4fe43Sopenharmony_ci 3661bd4fe43Sopenharmony_ci/** 3671bd4fe43Sopenharmony_ci* @ingroup iot_diag 3681bd4fe43Sopenharmony_ci* @brief Reports simple packet that with three words data. CNcomment:上报简单日志,携带3个数据。CNend 3691bd4fe43Sopenharmony_ci* 3701bd4fe43Sopenharmony_ci* @par 描述: 3711bd4fe43Sopenharmony_ci* Reports simple packets, fixed module ID. CNcomment:上报简单日志消息,固定模块ID。CNend 3721bd4fe43Sopenharmony_ci* 3731bd4fe43Sopenharmony_ci* @attention None 3741bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 3751bd4fe43Sopenharmony_ci* @param d0 [IN] type #hi_u32,first data. CNcomment:携带的第1个数据。Cnend 3761bd4fe43Sopenharmony_ci* @param d1 [IN] type #hi_u32,second data. CNcomment:携带的第2个数据。CNend 3771bd4fe43Sopenharmony_ci* @param d2 [IN] type #hi_u32,third data. CNcomment:携带的第3个数据。CNend 3781bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,log message level, [HI_MSG_SYS_L0, HI_MSG_SYS_L2] 3791bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_SYS_L0- HI_MSG_SYS_L2。CNend 3801bd4fe43Sopenharmony_ci* 3811bd4fe43Sopenharmony_ci* @retval #0 Success. 3821bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 3831bd4fe43Sopenharmony_ci* @par 依赖: 3841bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 3851bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 3861bd4fe43Sopenharmony_ci* @see None 3871bd4fe43Sopenharmony_ci*/ 3881bd4fe43Sopenharmony_cihi_u32 hi_diag_log_msg3(hi_u32 msg_id, hi_u32 d0, hi_u32 d1, hi_u32 d2, hi_u16 msg_level); 3891bd4fe43Sopenharmony_ci 3901bd4fe43Sopenharmony_ci/** 3911bd4fe43Sopenharmony_ci* @ingroup iot_diag 3921bd4fe43Sopenharmony_ci* @brief Reports simple packet that with four words data. CNcomment:上报简单日志,携带4个数据。CNend 3931bd4fe43Sopenharmony_ci* 3941bd4fe43Sopenharmony_ci* @par 描述: 3951bd4fe43Sopenharmony_ci* Reports simple packets, fixed module ID. CNcomment:上报简单日志消息,固定模块ID。CNend 3961bd4fe43Sopenharmony_ci* 3971bd4fe43Sopenharmony_ci* @attention None 3981bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 3991bd4fe43Sopenharmony_ci* @param log_msg [IN] type #diag_log_msg,four words. CNcomment:携带4个数据。CNend 4001bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,log message level, [HI_MSG_SYS_L0, HI_MSG_SYS_L2] 4011bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_SYS_L0- HI_MSG_SYS_L2。CNend 4021bd4fe43Sopenharmony_ci* 4031bd4fe43Sopenharmony_ci* @retval #0 Success. 4041bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 4051bd4fe43Sopenharmony_ci* @par 依赖: 4061bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 4071bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 4081bd4fe43Sopenharmony_ci* @see None 4091bd4fe43Sopenharmony_ci*/ 4101bd4fe43Sopenharmony_cihi_u32 hi_diag_log_msg4(hi_u32 msg_id, diag_log_msg log_msg, hi_u16 msg_level); 4111bd4fe43Sopenharmony_ci 4121bd4fe43Sopenharmony_ci/** 4131bd4fe43Sopenharmony_ci* @ingroup iot_diag 4141bd4fe43Sopenharmony_ci* @brief Reports simple packet that with one buffer data. CNcomment:上报简单日志,携带数据buffer。CNend 4151bd4fe43Sopenharmony_ci* 4161bd4fe43Sopenharmony_ci* @par 描述: 4171bd4fe43Sopenharmony_ci* Reports simple packets, fixed module ID. CNcomment:上报简单日志消息,固定模块ID。CNend 4181bd4fe43Sopenharmony_ci* 4191bd4fe43Sopenharmony_ci* @attention A maximum of 99 bytes can be send in one diag packet, so param size cannot be greater than 99. 4201bd4fe43Sopenharmony_ciCNcomment:diag单包最多能发99字节数据,参数size不能大于99。CNend 4211bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 4221bd4fe43Sopenharmony_ci* @param buffer [IN] type #hi_pvoid,address of the data. CNcomment:携带的数据buffer首地址。CNend 4231bd4fe43Sopenharmony_ci* @param size [IN] type #hi_16,buffer size (unit byte). 4241bd4fe43Sopenharmony_ciCNcomment:携带的数据buffer长度(单位byte)。CNend 4251bd4fe43Sopenharmony_ci* @param msg_level [IN] type #hi_u16,log message level, [HI_MSG_SYS_L0, HI_MSG_SYS_L2] 4261bd4fe43Sopenharmony_ciCNcomment:日志消息级别,取值从:HI_MSG_SYS_L0- HI_MSG_SYS_L2。CNend 4271bd4fe43Sopenharmony_ci* 4281bd4fe43Sopenharmony_ci* @retval #0 Success. 4291bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 4301bd4fe43Sopenharmony_ci* @par 依赖: 4311bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 4321bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 4331bd4fe43Sopenharmony_ci* @see None 4341bd4fe43Sopenharmony_ci*/ 4351bd4fe43Sopenharmony_cihi_u32 hi_diag_log_msg_buffer(hi_u32 msg_id, hi_pvoid buffer, hi_u16 size, hi_u16 msg_level); 4361bd4fe43Sopenharmony_ci 4371bd4fe43Sopenharmony_ci/** 4381bd4fe43Sopenharmony_ci* @ingroup iot_diag 4391bd4fe43Sopenharmony_ci* @brief Reports layer log that without data. CNcomment:上报层间简单日志,不携带数据内容。CNend 4401bd4fe43Sopenharmony_ci* 4411bd4fe43Sopenharmony_ci* @par 描述: 4421bd4fe43Sopenharmony_ci* Reports layer log that without data. CNcomment:上报层间简单日志,不携带数据内容。CNend 4431bd4fe43Sopenharmony_ci* 4441bd4fe43Sopenharmony_ci* @attention None 4451bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 4461bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 4471bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 4481bd4fe43Sopenharmony_ci* 4491bd4fe43Sopenharmony_ci* @retval #0 Success. 4501bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 4511bd4fe43Sopenharmony_ci* @par 依赖: 4521bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 4531bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 4541bd4fe43Sopenharmony_ci* @see None 4551bd4fe43Sopenharmony_ci*/ 4561bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_msg0(hi_u32 msg_id, hi_u16 module_id); 4571bd4fe43Sopenharmony_ci 4581bd4fe43Sopenharmony_ci/** 4591bd4fe43Sopenharmony_ci* @ingroup iot_diag 4601bd4fe43Sopenharmony_ci* @brief Reports layer log that with one word data. CNcoment:上报层间简单日志,携带1个数据。CNend 4611bd4fe43Sopenharmony_ci* 4621bd4fe43Sopenharmony_ci* @par 描述: 4631bd4fe43Sopenharmony_ci* Reports layer log that with one word data. CNcoment:上报层间简单日志,携带1个数据。CNend 4641bd4fe43Sopenharmony_ci* 4651bd4fe43Sopenharmony_ci* @attention None 4661bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 4671bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 4681bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 4691bd4fe43Sopenharmony_ci* @param d0 [IN] type #hi_u32,first data. CNcomment:携带的第1个数据。CNend 4701bd4fe43Sopenharmony_ci* 4711bd4fe43Sopenharmony_ci* @retval #0 Success. 4721bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 4731bd4fe43Sopenharmony_ci* @par 依赖: 4741bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 4751bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 4761bd4fe43Sopenharmony_ci* @see None 4771bd4fe43Sopenharmony_ci*/ 4781bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_msg1(hi_u32 msg_id, hi_u16 module_id, hi_u32 d0); 4791bd4fe43Sopenharmony_ci 4801bd4fe43Sopenharmony_ci/** 4811bd4fe43Sopenharmony_ci* @ingroup iot_diag 4821bd4fe43Sopenharmony_ci* @brief Reports layer log that with two words data. CNcoment:上报层间简单日志,携带2个数据。CNend 4831bd4fe43Sopenharmony_ci* 4841bd4fe43Sopenharmony_ci* @par 描述: 4851bd4fe43Sopenharmony_ci* Reports layer log that with two words data. CNcoment:上报层间简单日志,携带2个数据。CNend 4861bd4fe43Sopenharmony_ci* 4871bd4fe43Sopenharmony_ci* @attention None 4881bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 4891bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 4901bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 4911bd4fe43Sopenharmony_ci* @param d0 [IN] type #hi_u32,first data. CNcomment:携带的第1个数据。CNend 4921bd4fe43Sopenharmony_ci* @param d1 [IN] type #hi_u32,second data. CNcomment:携带的第2个数据。CNend 4931bd4fe43Sopenharmony_ci* 4941bd4fe43Sopenharmony_ci* @retval #0 Success. 4951bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 4961bd4fe43Sopenharmony_ci* @par 依赖: 4971bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 4981bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 4991bd4fe43Sopenharmony_ci* @see None 5001bd4fe43Sopenharmony_ci*/ 5011bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_msg2(hi_u32 msg_id, hi_u16 module_id, hi_u32 d0, hi_u32 d1); 5021bd4fe43Sopenharmony_ci 5031bd4fe43Sopenharmony_ci/** 5041bd4fe43Sopenharmony_ci* @ingroup iot_diag 5051bd4fe43Sopenharmony_ci* @brief Reports layer log that with 3 words data. CNcoment:上报层间简单日志,携带3个数据。CNend 5061bd4fe43Sopenharmony_ci* 5071bd4fe43Sopenharmony_ci* @par 描述: 5081bd4fe43Sopenharmony_ci* Reports layer log that with 3 words data. CNcoment:上报层间简单日志,携带3个数据。CNend 5091bd4fe43Sopenharmony_ci* 5101bd4fe43Sopenharmony_ci* @attention None 5111bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 5121bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 5131bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 5141bd4fe43Sopenharmony_ci* @param d0 [IN] type #hi_u32,first data. CNcomment:携带的第1个数据。CNend 5151bd4fe43Sopenharmony_ci* @param d1 [IN] type #hi_u32,second data. CNcomment:携带的第2个数据。CNend 5161bd4fe43Sopenharmony_ci* @param d2 [IN] type #hi_u32,third data. CNcomment:携带的第3个数据。CNend 5171bd4fe43Sopenharmony_ci* 5181bd4fe43Sopenharmony_ci* @retval #0 Success. 5191bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 5201bd4fe43Sopenharmony_ci* @par 依赖: 5211bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 5221bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 5231bd4fe43Sopenharmony_ci* @see None 5241bd4fe43Sopenharmony_ci*/ 5251bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_msg3(hi_u32 msg_id, hi_u16 module_id, hi_u32 d0, hi_u32 d1, hi_u32 d2); 5261bd4fe43Sopenharmony_ci 5271bd4fe43Sopenharmony_ci/** 5281bd4fe43Sopenharmony_ci* @ingroup iot_diag 5291bd4fe43Sopenharmony_ci* @brief Reports layer log that with 4 words data. CNcoment:上报层间简单日志,携带4个数据。CNend 5301bd4fe43Sopenharmony_ci* 5311bd4fe43Sopenharmony_ci* @par 描述: 5321bd4fe43Sopenharmony_ci* Reports layer log that with 4 words data. CNcoment:上报层间简单日志,携带4个数据。CNend 5331bd4fe43Sopenharmony_ci* 5341bd4fe43Sopenharmony_ci* @attention None 5351bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 5361bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 5371bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 5381bd4fe43Sopenharmony_ci* @param log_msg [IN] type #diag_log_msg,four data to report. CNcomment:携带4个数据。CNend 5391bd4fe43Sopenharmony_ci* 5401bd4fe43Sopenharmony_ci* @retval #0 Success. 5411bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 5421bd4fe43Sopenharmony_ci* @par 依赖: 5431bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 5441bd4fe43Sopenharmony_ci*/ 5451bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_msg4(hi_u32 msg_id, hi_u16 module_id, diag_log_msg log_msg); 5461bd4fe43Sopenharmony_ci 5471bd4fe43Sopenharmony_ci/** 5481bd4fe43Sopenharmony_ci* @ingroup iot_diag 5491bd4fe43Sopenharmony_ci* @brief Reports layer log that with one buffer data. CNcomment:上报层间简单日志,携带数据buffer。CNend 5501bd4fe43Sopenharmony_ci* 5511bd4fe43Sopenharmony_ci* @par 描述: 5521bd4fe43Sopenharmony_ci* Reports layer log that with one buffer data. CNcomment:上报层间简单日志,携带数据buffer。CNend 5531bd4fe43Sopenharmony_ci* 5541bd4fe43Sopenharmony_ci* @attention A maximum of 99 bytes can be send in one diag packet, so param size cannot be greater than 99. 5551bd4fe43Sopenharmony_ciCNcomment:diag单包最多能发99字节数据,参数size不能大于99。CNend 5561bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 5571bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 5581bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 5591bd4fe43Sopenharmony_ci* @param buffer [IN] type #const hi_pvoid,address of the data. CNcomment:携带的数据buffer首地址。CNend 5601bd4fe43Sopenharmony_ci* @param size [IN] type #hi_16,buffer size (unit byte). 5611bd4fe43Sopenharmony_ciCNcomment:携带的数据buffer长度(单位byte)。CNend 5621bd4fe43Sopenharmony_ci* 5631bd4fe43Sopenharmony_ci* @retval #0 Success. 5641bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 5651bd4fe43Sopenharmony_ci* @par 依赖: 5661bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 5671bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 5681bd4fe43Sopenharmony_ci* @see None 5691bd4fe43Sopenharmony_ci*/ 5701bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_msg_buffer(hi_u32 msg_id, hi_u16 module_id, const hi_void *buffer, hi_u16 size); 5711bd4fe43Sopenharmony_ci 5721bd4fe43Sopenharmony_citypedef struct { 5731bd4fe43Sopenharmony_ci hi_u16 size1; 5741bd4fe43Sopenharmony_ci hi_u16 size2; 5751bd4fe43Sopenharmony_ci} diag_buffer_size; 5761bd4fe43Sopenharmony_ci 5771bd4fe43Sopenharmony_ci/** 5781bd4fe43Sopenharmony_ci* @ingroup iot_diag 5791bd4fe43Sopenharmony_ci* @brief Reports layer log that with two buffer data. CNcomment:上报层间简单日志,支持携带两个数据buffer。CNend 5801bd4fe43Sopenharmony_ci* 5811bd4fe43Sopenharmony_ci* @par 描述: 5821bd4fe43Sopenharmony_ci* Reports layer log that with two buffer data. CNcomment:上报层间简单日志,支持携带两个数据buffer。CNend 5831bd4fe43Sopenharmony_ci* 5841bd4fe43Sopenharmony_ci* @attention A maximum of 99 bytes can be send in one diag packet.A space is reserved between two buffers. 5851bd4fe43Sopenharmony_ci Therefore, the sum of buffer_size.size1 and buffer_size.size2 cannot be greater than 98. 5861bd4fe43Sopenharmony_ciCNcomment:diag单包最多能发99字节数据,两个buffer之间会预留一个空格,所以参数buffer_size.size1与buffer_size.size2的和不能大于98。CNend 5871bd4fe43Sopenharmony_ci* @param msg_id [IN] type #hi_u32,log message ID. CNcomment:日志消息ID。CNend 5881bd4fe43Sopenharmony_ci* @param module_id [IN] type #hi_u16,message module ID,describe which module the log belongs to. 5891bd4fe43Sopenharmony_ciCNcomment:消息模块ID,描述日志属于哪个模块。CNend 5901bd4fe43Sopenharmony_ci* @param buf1 [IN] type #const hi_void *,address of the first buffer. 5911bd4fe43Sopenharmony_ciCNcomment:携带的数据buffer1首地址。CNend 5921bd4fe43Sopenharmony_ci* @param buf1 [IN] type #const hi_void *,address of the second buffer. 5931bd4fe43Sopenharmony_ciCNcomment:携带的数据buffer2首地址。CNend 5941bd4fe43Sopenharmony_ci* @param buffer_size [IN] type #diag_buffer_size,two buffer size (unit byte). 5951bd4fe43Sopenharmony_ciCNcomment:携带的数据buffer长度(单位byte)。CNend 5961bd4fe43Sopenharmony_ci* 5971bd4fe43Sopenharmony_ci* @retval #0 Success. 5981bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 5991bd4fe43Sopenharmony_ci* @par 依赖: 6001bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 6011bd4fe43Sopenharmony_ci*/ 6021bd4fe43Sopenharmony_cihi_u32 hi_diag_layer_two_buffer(hi_u32 msg_id, hi_u16 module_id, const hi_void *buf1, 6031bd4fe43Sopenharmony_ci const hi_void *buf2, diag_buffer_size buffer_size); 6041bd4fe43Sopenharmony_ci 6051bd4fe43Sopenharmony_ci/** 6061bd4fe43Sopenharmony_ci* @ingroup iot_diag 6071bd4fe43Sopenharmony_ci* @brief Set whether to check the UART busy status when low power vote. 6081bd4fe43Sopenharmony_ciCNcomment:设置低功耗投票时是否检查UART busy状态。CNend 6091bd4fe43Sopenharmony_ci* 6101bd4fe43Sopenharmony_ci* @par 描述: 6111bd4fe43Sopenharmony_ci* Set whether to check the UART busy status when low power vote. 6121bd4fe43Sopenharmony_ciCNcomment:设置低功耗投票时是否检查UART busy状态。CNend 6131bd4fe43Sopenharmony_ci* 6141bd4fe43Sopenharmony_ci* @attention UART busy status is not checked by default. 6151bd4fe43Sopenharmony_ciCNcomment:默认低功耗睡眠投票时不检查UART busy状态。CNend 6161bd4fe43Sopenharmony_ci* @param enable [IN] type #hi_bool,enable status. CNcomment:设置是否检查UART busy状态。CNend 6171bd4fe43Sopenharmony_ci* 6181bd4fe43Sopenharmony_ci* @retval None 6191bd4fe43Sopenharmony_ci* @par 依赖: 6201bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 6211bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 6221bd4fe43Sopenharmony_ci*/ 6231bd4fe43Sopenharmony_cihi_void hi_diag_set_check_uart_busy(hi_bool enable); 6241bd4fe43Sopenharmony_ci 6251bd4fe43Sopenharmony_citypedef hi_s32 (*hi_diag_input_func)(hi_u8 *data, hi_u32 data_len); 6261bd4fe43Sopenharmony_citypedef hi_s32 (*hi_diag_output_func)(const hi_u8 *data, hi_u32 data_len); 6271bd4fe43Sopenharmony_ci 6281bd4fe43Sopenharmony_ci/** 6291bd4fe43Sopenharmony_ci* @ingroup iot_diag 6301bd4fe43Sopenharmony_ci* @brief Register diag input function to replace uart input. 6311bd4fe43Sopenharmony_ciCNcomment:注册DIAG输入函数,代替默认从UART读取DIAG输入数据。CNend 6321bd4fe43Sopenharmony_ci* 6331bd4fe43Sopenharmony_ci* @par 描述: 6341bd4fe43Sopenharmony_ci* Register diag input function to replace uart input. 6351bd4fe43Sopenharmony_ciCNcomment:注册DIAG输入函数,代替默认从UART读取DIAG输入数据。CNend 6361bd4fe43Sopenharmony_ci* 6371bd4fe43Sopenharmony_ci* @attention Should set suitable task size; input func should not continuous read data without break. otherwise, 6381bd4fe43Sopenharmony_cia watchdog may happen.not support register HI_NULL when diag channel is already uart. 6391bd4fe43Sopenharmony_ciCNcomment:根据输入函数实现,设置合适的栈大小;输入函数不能持续 6401bd4fe43Sopenharmony_ci返回有效数据避免触发看门狗。当DIAG 通道已经是UART时,不支持注 6411bd4fe43Sopenharmony_ci册DIAG 输入函数为HI_NULL。CNend 6421bd4fe43Sopenharmony_ci* @param diag_input_func [IN] type #hi_diag_input_func,diag input function. 6431bd4fe43Sopenharmony_ciCNcomment:DIAG输入函数。CNend 6441bd4fe43Sopenharmony_ci* 6451bd4fe43Sopenharmony_ci* @retval #0 Success. 6461bd4fe43Sopenharmony_ci* @retval #Other Failure. For details, see hi_errno.h. 6471bd4fe43Sopenharmony_ci* @par 依赖: 6481bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 6491bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 6501bd4fe43Sopenharmony_ci*/ 6511bd4fe43Sopenharmony_cihi_u32 hi_diag_register_input_func(hi_diag_input_func diag_input_func); 6521bd4fe43Sopenharmony_ci 6531bd4fe43Sopenharmony_ci/** 6541bd4fe43Sopenharmony_ci* @ingroup iot_diag 6551bd4fe43Sopenharmony_ci* @brief Register diag output function to replace uart output. 6561bd4fe43Sopenharmony_ciCNcomment:注册DIAG输出函数,代替默认从UART输出DIAG相关数据。CNend 6571bd4fe43Sopenharmony_ci* 6581bd4fe43Sopenharmony_ci* @par 描述: 6591bd4fe43Sopenharmony_ci* Register diag output function to replace uart output. 6601bd4fe43Sopenharmony_ciCNcomment:注册DIAG输出函数,代替默认从UART输出DIAG相关数据。CNend 6611bd4fe43Sopenharmony_ci* 6621bd4fe43Sopenharmony_ci* @attention Should set suitable task size according to implementation of output func. 6631bd4fe43Sopenharmony_ciCNcomment:根据输出函数实现,设置合适的栈大小。CNend 6641bd4fe43Sopenharmony_ci* @param diag_output_func [IN] type #hi_diag_output_func,diag output function. 6651bd4fe43Sopenharmony_ciCNcomment:DIAG输出函数。CNend 6661bd4fe43Sopenharmony_ci* 6671bd4fe43Sopenharmony_ci* @retval None 6681bd4fe43Sopenharmony_ci* @par 依赖: 6691bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 6701bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 6711bd4fe43Sopenharmony_ci*/ 6721bd4fe43Sopenharmony_cihi_void hi_diag_register_output_func(hi_diag_output_func diag_output_func); 6731bd4fe43Sopenharmony_ci 6741bd4fe43Sopenharmony_ci/** 6751bd4fe43Sopenharmony_ci* @ingroup iot_diag 6761bd4fe43Sopenharmony_ci* @brief Set taks size of DIAG. CNcomment:设置DIAG相关任务栈大小。CNend 6771bd4fe43Sopenharmony_ci* 6781bd4fe43Sopenharmony_ci* @par 描述: 6791bd4fe43Sopenharmony_ci* Set taks size of DIAG. CNcomment:设置DIAG相关任务栈大小。CNend 6801bd4fe43Sopenharmony_ci* 6811bd4fe43Sopenharmony_ci* @attention diag task stack size needs to be set before diag initialization. 6821bd4fe43Sopenharmony_ciCNcomment:diag任务栈大小需要在diag初始化之前设置。CNend 6831bd4fe43Sopenharmony_ci* @param channel_task_size [IN] type #hi_u16 channel task size,task size should not smaller than 0x600. 6841bd4fe43Sopenharmony_ciCNcomment:通道任务栈大小,任务栈大小不低于0x600。CNend 6851bd4fe43Sopenharmony_ci* @param process_task_size [IN] type #hi_u16 process task size,task size should not smaller than 0x800. 6861bd4fe43Sopenharmony_ciCNcomment:处理任务栈大小,任务栈大小不低于0x800。CNend 6871bd4fe43Sopenharmony_ci* 6881bd4fe43Sopenharmony_ci* @retval None 6891bd4fe43Sopenharmony_ci* @par 依赖: 6901bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 6911bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 6921bd4fe43Sopenharmony_ci*/ 6931bd4fe43Sopenharmony_cihi_void hi_diag_set_task_size(hi_u16 channel_task_size, hi_u16 process_task_size); 6941bd4fe43Sopenharmony_ci 6951bd4fe43Sopenharmony_ci 6961bd4fe43Sopenharmony_citypedef hi_u32 (*hi_diag_sys_msg_forward_func)(const hi_diag_layer_msg *diag_sys_msg, hi_u16 msg_level); 6971bd4fe43Sopenharmony_citypedef hi_u32 (*hi_diag_layer_msg_forward_func)(hi_u32 msg_id, hi_u16 src_module_id, hi_u16 dst_module_id, 6981bd4fe43Sopenharmony_ci const hi_void *packet, hi_u16 packet_size); 6991bd4fe43Sopenharmony_citypedef hi_u32 (*hi_diag_usr_msg_forward_func)(const hi_diag_layer_msg* diag_usr_msg, hi_u16 msg_level); 7001bd4fe43Sopenharmony_ci 7011bd4fe43Sopenharmony_ci/** 7021bd4fe43Sopenharmony_ci* @ingroup iot_diag 7031bd4fe43Sopenharmony_ci* @brief Register msg forward func. CNcomment:设置消息转发函数,替代默认从HSO输出。CNend 7041bd4fe43Sopenharmony_ci* 7051bd4fe43Sopenharmony_ci* @par 描述: 7061bd4fe43Sopenharmony_ci* Register msg forward func. CNcomment:设置消息转发函数,替代默认从HSO输出。CNend 7071bd4fe43Sopenharmony_ci* 7081bd4fe43Sopenharmony_ci* @attention None. 7091bd4fe43Sopenharmony_ci* @param diag_sys_msg_func [IN] type #hi_diag_sys_msg_forward_func forward function of sys_msg. 7101bd4fe43Sopenharmony_ciCNcomment:sys_msg的转发函数。CNend 7111bd4fe43Sopenharmony_ci* @param diag_layer_msg_func [IN] type #hi_diag_layer_msg_forward_func forward function of layer_msg. 7121bd4fe43Sopenharmony_ciCNcomment:layder_msg的转发函数。CNend 7131bd4fe43Sopenharmony_ci* @param diag_usr_msg_func [IN] type #hi_diag_usr_msg_forward_func forward function of usr_msg. 7141bd4fe43Sopenharmony_ciCNcomment:usr_msg的转发函数。CNend 7151bd4fe43Sopenharmony_ci* 7161bd4fe43Sopenharmony_ci* @retval None 7171bd4fe43Sopenharmony_ci* @par 依赖: 7181bd4fe43Sopenharmony_ci* @li hi_diag.h:Describes DIAG APIs. 7191bd4fe43Sopenharmony_ciCNcomment:文件用于描述DIAG相关接口。CNend 7201bd4fe43Sopenharmony_ci*/ 7211bd4fe43Sopenharmony_cihi_void hi_diag_register_msg_forward_func(hi_diag_sys_msg_forward_func diag_sys_msg_func, 7221bd4fe43Sopenharmony_ci hi_diag_layer_msg_forward_func diag_layer_msg_func, hi_diag_usr_msg_forward_func diag_usr_msg_func); 7231bd4fe43Sopenharmony_ci 7241bd4fe43Sopenharmony_ci 7251bd4fe43Sopenharmony_ci#endif 726