/*****************************************************************************
Copyright: 2013-2018, ZhiWan Tech. Co., Ltd.
File name:ps_mcp_detect.c
Description: 监控对象实时采集模块
Author: 周涛
Version: 0.0.01
Date: 2022-4-24
History:
*****************************************************************************/
#include "includes.h"

// 定义全局变量保存设置参数
SAVE_DETECT_T g_stSaveDetectParam;

// 模块初始化
void wmm_detect_init()
{
    SYS_MEMSET(&g_stSaveDetectParam, 0, sizeof(SAVE_DETECT_T));
    return;
}

// 网管实时采集数据信息
// wCommand:  查询命令，pstLtv：当前监控对象
uint8 wmm_query_detect(uint16 wCommand, uint8 abyLtv[])
{
    LTV_T *pstLtv = (LTV_T *)abyLtv;
    uint16 wLen = pstLtv->wLen - 4; // 净荷长度

    switch (wCommand)
    {
    case ORDER_DETECT_HEALTH: // 健康状态
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byHealth, wLen);
        break;
    case ORDER_DETECT_POWER1: // 通道1功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower1, wLen);
        break;
    case ORDER_DETECT_POWER2: // 通道2功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower2, wLen);
        break;
    case ORDER_DETECT_POWER3: // 通道3功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower3, wLen);
        break;
    case ORDER_DETECT_POWER4: // 通道4功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower4, wLen);
        break;
    case ORDER_DETECT_POWER5: // 通道5功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower5, wLen);
        break;
    case ORDER_DETECT_POWER6: // 通道6功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower6, wLen);
        break;
    case ORDER_DETECT_POWER7: // 通道7功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower7, wLen);
        break;
    case ORDER_DETECT_POWER8: // 通道8功率
        SYS_MEMCPY(pstLtv->abyData, &g_stSaveDetectParam.byPower8, wLen);
        break;
    default:
        break;
    }
    return 0;
}
