runCommand(EnumCommands command, int agentId, object[] data = null) { FingerPrintAgent agent = agents.Where(x => x.deviceModel?.id == agentId) .FirstOrDefault(); if (null == agent) { return; } agent.runCommand(command, data); }
prepareAgents() { List <Model.FingerPrintDevice> fingerPrintDevices = Model.FingerPrintDevice.all(); foreach (Model.FingerPrintDevice fingerPrint in fingerPrintDevices) { FingerPrintAgent agent = new FingerPrintAgent(fingerPrint); UF_RET_CODE result = agent.connect(agent.deviceModel.ip, agent.deviceModel.port); // Add to agents agents.Add(agent); } }