当前位置: 首页>>代码示例>>C++>>正文


C++ CIniParser::SetVar方法代码示例

本文整理汇总了C++中CIniParser::SetVar方法的典型用法代码示例。如果您正苦于以下问题:C++ CIniParser::SetVar方法的具体用法?C++ CIniParser::SetVar怎么用?C++ CIniParser::SetVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIniParser的用法示例。


在下文中一共展示了CIniParser::SetVar方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WriteCmdFinalAssemblyNumber

// write Command Final Assembly Number to config_universal.ini file
bool GatewayConfig::WriteCmdFinalAssemblyNumber(uint32_t finalAssemblyNumber)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("------- NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    else
    {
        int finAssemblyNumber;
        finAssemblyNumber = (int) finalAssemblyNumber;
        if (!gwVarConfig.SetVar("WH_GATEWAY", "FINAL_ASSEMBLY_NUMBER", finAssemblyNumber))
            return 0;

    }
    return 1;

}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:26,代码来源:GatewayConfig.cpp

示例2: WriteCmdMasterDate

bool GatewayConfig::WriteCmdMasterDate(WHartDate masterDate)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("-------NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    else
    {
        int date_day;
        int date_month;
        int date_year;

        date_day = (int) masterDate.day;
        date_month = (int) masterDate.month;
        date_year = (int) masterDate.year;

        if (!gwVarConfig.SetVar("WH_GATEWAY", "MASTER_DATE_DAY", date_day))
            return 0;

        if (!gwVarConfig.SetVar("WH_GATEWAY", "MASTER_DATE_MONTH", date_month))
            return 0;

        if (!gwVarConfig.SetVar("WH_GATEWAY", "MASTER_DATE_YEAR", date_year))
            return 0;
    }
    return 1;

}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:36,代码来源:GatewayConfig.cpp

示例3: WriteDeviceStatus

// write Device Status to config_universal.ini file
// TODO: Beni - save Device Status on C038_ResetConfigurationChangedFlag
bool GatewayConfig::WriteDeviceStatus(uint8_t deviceStatus)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("------- NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.SetVar("WH_GATEWAY", "DEVICE_STATUS", deviceStatus))
        return 0;

    m_u8DeviceStatus = deviceStatus;

    return 1;
}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:18,代码来源:GatewayConfig.cpp

示例4: WriteGwReqMaxRetryNo

bool GatewayConfig::WriteGwReqMaxRetryNo(uint8_t p_u8RetryNo)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_CONFIGINI, "r+"))
    {
        LOG("------- NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    if (!gwVarConfig.SetVar("WH_GATEWAY", "GW_REQ_MAX_RETRY_NO", p_u8RetryNo, 0, true))
    {
        return 0;
    }
    return 1;
}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:20,代码来源:GatewayConfig.cpp

示例5: WriteCmdUniversalMessage

bool GatewayConfig::WriteCmdUniversalMessage(char * universalmessage)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("------- NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    if (!gwVarConfig.SetVar("WH_GATEWAY", "CMD_UNIVERSAL_MESSAGE", universalmessage))
    {
        return 0;
    }

    return 1;
}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:21,代码来源:GatewayConfig.cpp

示例6: WriteMinRespPreamblesNo

bool GatewayConfig::WriteMinRespPreamblesNo(uint8_t p_u8MinRespPreamblesNo)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("------- NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    int minRespPreamblesNo = p_u8MinRespPreamblesNo;

    if (!gwVarConfig.SetVar("WH_GATEWAY", "MIN_RESP_PREAMBLES_NO", minRespPreamblesNo))
    {
        return 0;
    }

    return 1;
}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:23,代码来源:GatewayConfig.cpp

示例7: WriteCmdMasterDescriptor

bool GatewayConfig::WriteCmdMasterDescriptor(char * masterDescriptor)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("------- NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    else
    {
        if (!gwVarConfig.SetVar("WH_GATEWAY", "MASTER_DESCRIPTOR", masterDescriptor))
            return 0;

    }
    return 1;

}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:23,代码来源:GatewayConfig.cpp

示例8: WriteCmdTag

bool GatewayConfig::WriteCmdTag(char * tag)
{
    CIniParser gwVarConfig;
    if (!gwVarConfig.Load(FILE_PATH_GW_INFO_UNIV, "r+"))
    {
        LOG("-------NO CONFIG.INI FILE -------");
        return 0;
    }

    if (!gwVarConfig.FindGroup("WH_GATEWAY", true))
    {
        return 0;
    }

    else
    {
        if (!gwVarConfig.SetVar("WH_GATEWAY", "TAG", tag))
            return 0;

    }
    return 1;

}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:23,代码来源:GatewayConfig.cpp


注:本文中的CIniParser::SetVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。