use of org.opensmartgridplatform.dto.valueobjects.smartmetering.TransportServiceTypeDto in project open-smart-grid-platform by OSGP.
the class DlmsHelper method readSendDestinationAndMethod.
public SendDestinationAndMethodDto readSendDestinationAndMethod(final DataObject resultData, final String description) throws ProtocolAdapterException {
final List<DataObject> sendDestinationAndMethodElements = this.readList(resultData, description);
if (sendDestinationAndMethodElements == null) {
return null;
}
final TransportServiceTypeDto transportService = this.readTransportServiceType(sendDestinationAndMethodElements.get(0), "Transport Service from " + description);
final String destination = this.readString(sendDestinationAndMethodElements.get(1), "Destination from " + description);
final MessageTypeDto message = this.readMessageType(sendDestinationAndMethodElements.get(2), "Message from " + description);
return new SendDestinationAndMethodDto(transportService, destination, message);
}
use of org.opensmartgridplatform.dto.valueobjects.smartmetering.TransportServiceTypeDto in project open-smart-grid-platform by OSGP.
the class DlmsHelper method readTransportServiceType.
public TransportServiceTypeDto readTransportServiceType(final DataObject resultData, final String description) throws ProtocolAdapterException {
final Number number = this.readNumber(resultData, description, "Enum");
if (number == null) {
return null;
}
final int enumValue = number.intValue();
final TransportServiceTypeDto transportService = this.getTransportServiceTypeForEnumValue(enumValue);
if (transportService == null) {
LOGGER.error("Unexpected Enum value for TransportServiceType: {}", enumValue);
throw new ProtocolAdapterException("Unknown Enum value for TransportServiceType: " + enumValue);
}
return transportService;
}
Aggregations