use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850EnableReportingCommand in project Protocol-Adapter-IEC61850 by OSGP.
the class DeviceRegistrationService method enableReporting.
protected void enableReporting(final DeviceConnection deviceConnection) {
try {
new Iec61850EnableReportingCommand().enableReportingOnDeviceWithoutUsingSequenceNumber(DeviceRegistrationService.this.iec61850DeviceConnectionService.getIec61850Client(), deviceConnection);
// Don't disconnect now! The device should be able to send
// reports.
this.waitClearReportAndDisconnect(deviceConnection);
} catch (final NodeWriteException e) {
LOGGER.error("Unable to enabele reporting for device: " + deviceConnection.getDeviceIdentification(), e);
DeviceRegistrationService.this.iec61850DeviceConnectionService.disconnect(deviceConnection, null);
}
}
use of com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850EnableReportingCommand in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850SsldDeviceService method enableReporting.
private void enableReporting(final DeviceConnection deviceConnection, final DeviceRequest deviceRequest) throws NodeWriteException {
// Enabling device reporting.
new Iec61850EnableReportingCommand().enableReportingOnDeviceWithoutUsingSequenceNumber(this.iec61850Client, deviceConnection);
// Don't disconnect now! The device should be able to send reports.
new Timer().schedule(new TimerTask() {
@Override
public void run() {
try {
new Iec61850ClearReportCommand().clearReportOnDevice(deviceConnection);
} catch (final ProtocolAdapterException e) {
LOGGER.error("Unable to clear report for device: " + deviceRequest.getDeviceIdentification(), e);
}
Iec61850SsldDeviceService.this.iec61850DeviceConnectionService.disconnect(deviceConnection, deviceRequest);
}
}, this.disconnectDelay);
}
Aggregations