/*****************************************************************************
Copyright: 2013-2018, MIAO XUN TECH. Co., Ltd.
File name:wmm.c
Description: 网管对象主控模块
Author: 周涛
Version: 0.0.01
Date: 2023-7-17
History:
*****************************************************************************/
#include "includes.h"

// 定义一个全局变量，保存所有待保存的网管参数
SAVE_ALL_OAM_PARAM_T g_stSaveAllOamParam;

// 模块初始化
void wmm_init()
{
    SYS_MEMSET(&g_stSaveAllOamParam, 0, sizeof(SAVE_ALL_OAM_PARAM_T));

    // 初始化5个网管参数模块
    wmm_device_init();
    wmm_network_init();
    wmm_config_init();
    oam_report_init();
    wmm_detect_init();
    wmm_install_init();
    wmm_sync_init();
    wmm_bts_init();

    // 初始化待保存的网管参数结构
    g_stSaveAllOamParam.pstDeviceParam = wmm_query_device_param();
    g_stSaveAllOamParam.pstNetworkParam = wmm_network_query_param();
    g_stSaveAllOamParam.pstConfigParam = wmm_config_query_param();
    g_stSaveAllOamParam.pstInstallParam = wmm_install_query_param();
    g_stSaveAllOamParam.pstSyncParam = wmm_sync_query_param();
    g_stSaveAllOamParam.pstBtsParam = wmm_bts_query_param();

    return;
}

// 向外暴露所有待保存的网管参数，方便其他模块使用
SAVE_ALL_OAM_PARAM_T *wmm_query_all_oam_param()
{
    return (SAVE_ALL_OAM_PARAM_T *)(&g_stSaveAllOamParam);
}

// 重置设备参数
void wmm_reset_param()
{
    wmm_bts_set_param_with_default_data();
    wmm_config_set_param_with_default_data();
    wmm_device_set_param_with_default_data();
    wmm_install_set_param_with_default_data();
    wmm_network_set_param_with_default_data();
    wmm_sync_set_param_with_default_data();
}