use of org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.firmware.ImageTransfer.ImageTransferProperties in project open-smart-grid-platform by OSGP.
the class UpdateFirmwareConfig method imageTransferProperties.
@Bean
public ImageTransferProperties imageTransferProperties() {
final ImageTransferProperties imageTransferProperties = new ImageTransfer.ImageTransferProperties();
imageTransferProperties.setVerificationStatusCheckInterval(this.verificationStatusCheckInterval);
imageTransferProperties.setVerificationStatusCheckTimeout(this.verificationStatusCheckTimeout);
imageTransferProperties.setInitiationStatusCheckInterval(this.initiationStatusCheckInterval);
imageTransferProperties.setInitiationStatusCheckTimeout(this.initiationStatusCheckTimeout);
return imageTransferProperties;
}
use of org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.firmware.ImageTransfer.ImageTransferProperties in project open-smart-grid-platform by OSGP.
the class UpdateFirmwareCommandExecutorIntegrationTest method setUp.
@BeforeEach
void setUp() {
this.connectionStub = new DlmsConnectionStub();
this.connectionManagerStub = new DlmsConnectionManagerStub(this.connectionStub);
this.connectionStub.setDefaultReturnValue(DataObject.newArrayData(Collections.emptyList()));
this.connectionStub.addReturnValue(this.createAttributeAddressForImageTransfer(ImageTransferAttribute.IMAGE_TRANSFER_ENABLED), DataObject.newBoolData(true));
this.connectionStub.addReturnValue(this.createAttributeAddressForImageTransfer(ImageTransferAttribute.IMAGE_TRANSFER_STATUS), DataObject.newInteger32Data(1), 5);
this.connectionStub.addReturnValue(this.createAttributeAddressForImageTransfer(ImageTransferAttribute.IMAGE_TRANSFER_STATUS), DataObject.newInteger32Data(6));
this.connectionStub.addReturnValue(this.createAttributeAddressForImageTransfer(ImageTransferAttribute.IMAGE_BLOCK_SIZE), DataObject.newUInteger32Data(100));
this.connectionStub.addReturnValue(this.createAttributeAddressForImageTransfer(ImageTransferAttribute.IMAGE_FIRST_NOT_TRANSFERRED_BLOCK_NUMBER), DataObject.newUInteger32Data(100));
this.messageMetadata = MessageMetadata.newBuilder().withCorrelationUid("123456").build();
final MethodResult methodResult = mock(MethodResult.class);
when(methodResult.getResultCode()).thenReturn(MethodResultCode.SUCCESS);
final ImageTransferProperties imageTransferProperties = new ImageTransfer.ImageTransferProperties();
imageTransferProperties.setVerificationStatusCheckInterval(this.verificationStatusCheckInterval);
imageTransferProperties.setVerificationStatusCheckTimeout(this.verificationStatusCheckTimeout);
imageTransferProperties.setInitiationStatusCheckInterval(this.initiationStatusCheckInterval);
imageTransferProperties.setInitiationStatusCheckTimeout(this.initiationStatusCheckTimeout);
this.connectionStub.setDefaultMethodResult(methodResult);
this.commandExecutor = new UpdateFirmwareCommandExecutor(this.dlmsDeviceRepository, this.firmwareFileCachingRepository, this.firmwareImageIdentifierCachingRepository, this.macGenerationService, imageTransferProperties);
}
Aggregations