connector = new OpenEnergyMonitorSerialConnector(serialPort);
else
connector = new OpenEnergyMonitorUDPConnector(udpPort);
try {
connector.connect();
} catch (OpenEnergyMonitorException e) {
logger.error(
"Error occured when connecting to Open Energy Monitor device",
e);