use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice in project open-smart-grid-platform by OSGP.
the class AddDeviceSteps method configureForCommunicationWithDeviceSimulator.
private void configureForCommunicationWithDeviceSimulator(final Device device) {
/*
* This call also sets the device to be IN_USE and activated.
*/
device.updateRegistrationData(PlatformSmartmeteringDefaults.NETWORK_ADDRESS, device.getDeviceType());
final DlmsDevice dlmsDevice = this.dlmsDeviceRepository.findByDeviceIdentification(device.getDeviceIdentification());
assertThat(dlmsDevice).as("Device should be in the DLMS protocol database for identification " + device.getDeviceIdentification()).isNotNull();
dlmsDevice.setIpAddressIsStatic(true);
dlmsDevice.setPort(PlatformSmartmeteringDefaults.PORT);
this.dlmsDeviceRepository.save(dlmsDevice);
}
use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice in project open-smart-grid-platform by OSGP.
the class EnableAndDisableDebugging method theDeviceDebugInformationShouldBeEnabled.
@Then("^the device debug information should be enabled$")
public void theDeviceDebugInformationShouldBeEnabled() throws Throwable {
final DlmsDevice device = this.dlmsDeviceRepository.findByDeviceIdentification(ScenarioContext.current().get(PlatformKeys.KEY_DEVICE_IDENTIFICATION).toString());
assertThat(device.isInDebugMode()).as("Debug mode").isTrue();
}
use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice in project open-smart-grid-platform by OSGP.
the class EnableAndDisableDebugging method theDeviceDebugInformationShouldBeDisabled.
@Then("^the device debug information should be disabled$")
public void theDeviceDebugInformationShouldBeDisabled() throws Throwable {
final DlmsDevice device = this.dlmsDeviceRepository.findByDeviceIdentification(ScenarioContext.current().get(PlatformKeys.KEY_DEVICE_IDENTIFICATION).toString());
assertThat(device.isInDebugMode()).as("Debug mode").isFalse();
}
use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice in project open-smart-grid-platform by OSGP.
the class ConfigurationService method getMbusKeyExchangeData.
public GMeterInfoDto getMbusKeyExchangeData(final DlmsConnectionManager conn, final DlmsDevice device, final SetMbusUserKeyByChannelRequestDataDto setMbusUserKeyByChannelRequestData, final MessageMetadata messageMetadata) throws OsgpException {
final GetMBusDeviceOnChannelRequestDataDto mbusDeviceOnChannelRequest = new GetMBusDeviceOnChannelRequestDataDto(device.getDeviceIdentification(), setMbusUserKeyByChannelRequestData.getChannel());
final ChannelElementValuesDto channelElementValues = this.getMBusDeviceOnChannelCommandExecutor.execute(conn, device, mbusDeviceOnChannelRequest, messageMetadata);
final DlmsDevice mbusDevice = this.domainHelperService.findMbusDevice(channelElementValues.getIdentificationNumber(), channelElementValues.getManufacturerIdentification());
return new GMeterInfoDto(setMbusUserKeyByChannelRequestData.getChannel(), mbusDevice.getDeviceIdentification());
}
use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice in project open-smart-grid-platform by OSGP.
the class BundleServiceTest method shouldHandleActionsWithResultContainingFaultResponseWithRetryableException.
@Test
public void shouldHandleActionsWithResultContainingFaultResponseWithRetryableException() {
final ActionResponseDto faultResponse = this.createFaultResponse(true);
final BundleMessagesRequestDto bundleMessagesRequest = new BundleMessagesRequestDto(Arrays.asList(this.createAction(this.builder.makePeriodicMeterReadsRequestDataDto(), faultResponse)));
final BundleMessagesRequestDto result = this.bundleService.callExecutors(null, new DlmsDevice(), bundleMessagesRequest, this.messageMetadata);
verify(this.bundleCommandExecutorMap).getCommandExecutor(PeriodicMeterReadsRequestDataDto.class);
assertThat(result.getAllResponses().size()).isOne();
assertThat(result.getAllResponses().get(0)).isNotNull();
}
Aggregations