void TConfigParser::LoadConfig() { if (!Root.isObject()) throw TConfigParserException("malformed config"); if (!Root.isMember("ports")) throw TConfigParserException("no ports specified"); if (Root.isMember("debug")) HandlerConfig->Debug = HandlerConfig->Debug || Root["debug"].asBool(); if (Root.isMember("max_unchanged_interval")) HandlerConfig->MaxUnchangedInterval = Root["max_unchanged_interval"].asInt(); const Json::Value array = Root["ports"]; for(unsigned int index = 0; index < array.size(); ++index) LoadPort(array[index], "wb-modbus-" + std::to_string(index) + "-"); // XXX old default prefix for compat // check are there any devices defined for (const auto& port_config : HandlerConfig->PortConfigs) { if (!port_config->DeviceConfigs.empty()) { // found one return; } } throw TConfigParserException("no devices defined in config. Nothing to do"); }
int i8080_hal_io_input(int port) { if (use_io_space) return LoadPort(port); else return LoadByte((port & 0xff)<<8 | (port & 0xff)); }
void init(){ object ding; ::init(); if(!present("telnet_room_client",this_player())){ ding=new("/secure/obj/tc"); ding->eventMove(this_player()); ding->SetConnection(LoadIP()+" "+LoadPort()); }