示例#1
0
void CEspConfig::initDali(const char *servers)
{
    if (servers!=NULL && *servers!=0 && !daliClientActive())
    {
        DBGLOG("Initializing DALI client [servers = %s]", servers);

        useDali=true;

        // Create server group
        Owned<IGroup> serverGroup = createIGroup(servers, DALI_SERVER_PORT);

        if (!serverGroup)
            throw MakeStringException(0, "Could not instantiate dali IGroup");

        // Initialize client process
        if (!initClientProcess(serverGroup, DCR_EspServer))
            throw MakeStringException(0, "Could not initialize dali client");
        setPasswordsFromSDS();

        serverstatus = new CSDSServerStatus("ESPserver");
    }
}
示例#2
0
void CWsDfuXRefEx::init(IPropertyTree *cfg, const char *process, const char *service)
{
    
    StringBuffer xpath;
    
    DBGLOG("Initializing %s service [process = %s]", service, process);
    
    xpath.clear().appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/User", process, service);
    cfg->getProp(xpath.str(), user_);

    xpath.clear().appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/Password", process, service);
    cfg->getProp(xpath.str(), password_);

    if (!daliClientActive())
    {
        ERRLOG("No Dali Connection Active.");
        throw MakeStringException(-1, "No Dali Connection Active. Please Specify a Dali to connect to in you configuration file");
    }
    XRefNodeManager.setown(CreateXRefNodeFactory());    

    //Start out builder thread......
    m_XRefbuilder.setown(new CXRefExBuilderThread());
    m_XRefbuilder->start();
}