246 lines
7.8 KiB
C++
246 lines
7.8 KiB
C++
/**
|
|
* @file XNMonitorInterface.h
|
|
* @brief 监控服务器接口定义
|
|
*/
|
|
#pragma once
|
|
|
|
#include "TypeDefine.h"
|
|
#include "XNMonitorServer_global.h"
|
|
#include <cstdint>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
/**
|
|
* @brief 初始化DDS监控服务器
|
|
* @param domainId 域ID
|
|
* @param domainIdLen 域ID长度
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_Initialize(const char *domainId, int domainIdLen, char *errorMsg,
|
|
int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 清理DDS监控服务器
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_Cleanup();
|
|
|
|
//******************** 系统信息监控 *********************
|
|
|
|
/**
|
|
* @brief 启动监控系统信息
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_StartMonitorSystemInfo(char *errorMsg, int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 获取系统信息
|
|
* @param infoMsg 系统信息
|
|
* @param infoMsgSize 系统信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_GetSystemInfo(char *infoMsg, int infoMsgSize);
|
|
|
|
/**
|
|
* @brief 停止监控系统信息
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_StopMonitorSystemInfo();
|
|
|
|
//******************** 线程信息监控 *********************
|
|
|
|
/**
|
|
* @brief 获取所有线程信息
|
|
* @param infoMsg 线程信息
|
|
* @param infoMsgSize 线程信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_GetAllThreadInfo(char *infoMsg, int infoMsgSize);
|
|
|
|
//******************** 模型信息监控 *********************
|
|
|
|
/**
|
|
* @brief 启动监控模型信息
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_StartMonitorModelInfo(char *errorMsg, int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 获取模型信息
|
|
* @param infoMsg 模型信息
|
|
* @param infoMsgSize 模型信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_GetModelInfo(char *infoMsg, int infoMsgSize);
|
|
|
|
/**
|
|
* @brief 停止监控模型信息
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_StopMonitorModelInfo();
|
|
|
|
//******************** 引擎控制 *********************
|
|
|
|
/**
|
|
* @brief 初始化引擎控制
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_InitializeEngineControl(char *errorMsg, int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 暂停引擎
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_PauseEngine(char *errorMsg, int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 恢复引擎
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_ResumeEngine(char *errorMsg, int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 停止引擎
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_StopEngine(char *errorMsg, int errorMsgSize);
|
|
|
|
//******************** 数据监控 *********************
|
|
|
|
/**
|
|
* @brief 启动数据监控
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_StartDataMonitor(const char *structName, const int structNameLen,
|
|
char *errorMsg, int errorMsgSize);
|
|
|
|
/**
|
|
* @brief 停止数据监控
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param errorMsg 错误信息
|
|
* @param errorMsgSize 错误信息大小
|
|
*/
|
|
void XNMONITORSERVER_EXPORT XN_StopDataMonitor(const char *structName, const int structNameLen,
|
|
char *errorMsg, int errorMsgSize);
|
|
|
|
//******************** 数据注入 *********************
|
|
|
|
/**
|
|
* @brief 获取数据监控信息
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param interfaceName 接口名称JSON数组字符串
|
|
* @param interfaceNameLen 接口名称JSON数组字符串长度
|
|
* @param data 数据JSON字符串
|
|
* @param dataLen 数据JSON字符串长度
|
|
* @param infoMsg 错误信息
|
|
* @param infoMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_GetDataMonitorInfo(const char *structName,
|
|
const int structNameLen,
|
|
const char *interfaceName,
|
|
const int interfaceNameLen, char *data,
|
|
int dataLen, char *infoMsg, int infoMsgSize);
|
|
|
|
/**
|
|
* @brief 注入数据接口
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param interfaceNameAndData 接口名称和数据JSON字符串
|
|
* @param interfaceNameAndDataLen 接口名称和数据JSON字符串长度
|
|
* @param infoMsg 错误信息
|
|
* @param infoMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_InjectDataInterface(const char *structName,
|
|
const int structNameLen,
|
|
const char *interfaceNameAndData,
|
|
const int interfaceNameAndDataLen,
|
|
char *infoMsg, int infoMsgSize);
|
|
|
|
/**
|
|
* @brief 持续注入数据接口
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param interfaceNameAndData 接口名称和数据JSON字符串
|
|
* @param interfaceNameAndDataLen 接口名称和数据JSON字符串长度
|
|
* @param frequency 注入频率
|
|
* @param infoMsg 错误信息
|
|
* @param infoMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_StartInjectContinuous(
|
|
const char *structName, const int structNameLen, const char *interfaceNameAndData,
|
|
const int interfaceNameAndDataLen, double frequency, char *infoMsg, int infoMsgSize);
|
|
|
|
/**
|
|
* @brief 停止持续注入数据接口
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param infoMsg 错误信息
|
|
* @param infoMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_StopInjectContinuous(const char *structName,
|
|
const int structNameLen, char *infoMsg,
|
|
int infoMsgSize);
|
|
|
|
//******************** csv数据注入 *********************
|
|
|
|
/**
|
|
* @brief 从csv文件中注入数据接口
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param csvFilePath csv文件路径
|
|
* @param csvFilePathLen csv文件路径长度
|
|
* @param injectTimes 注入次数
|
|
* @param infoMsg 错误信息
|
|
* @param infoMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_InjectDataInterfaceFromCsv(
|
|
const char *structName, const int structNameLen, const char *csvFilePath,
|
|
const int csvFilePathLen, int injectTimes, char *infoMsg, int infoMsgSize);
|
|
|
|
//******************** csv数据采集 *********************
|
|
|
|
/**
|
|
* @brief 持续采集数据并保存到csv文件接口
|
|
* @param structName 结构体名称
|
|
* @param structNameLen 结构体名称长度
|
|
* @param interfaceName 接口名称JSON数组字符串
|
|
* @param interfaceNameLen 接口名称JSON数组字符串长度
|
|
* @param csvFilePath csv文件路径
|
|
* @param csvFilePathLen csv文件路径长度
|
|
* @param frequency 采集频率
|
|
* @param infoMsg 错误信息
|
|
* @param infoMsgSize 错误信息大小
|
|
* @return 0: 成功, -1: 失败
|
|
*/
|
|
int XNMONITORSERVER_EXPORT XN_StartCollectData(const char *structName, const int structNameLen,
|
|
const char *interfaceName,
|
|
const int interfaceNameLen,
|
|
const char *csvFilePath,
|
|
const int csvFilePathLen, char *infoMsg,
|
|
int infoMsgSize);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |