Search in sources :

Example 1 with IeQualifierOfInterrogation

use of org.openmuc.j60870.ie.IeQualifierOfInterrogation in project open-smart-grid-platform by OSGP.

the class ControlledStationSteps method sendInterrogationResponse.

private Object sendInterrogationResponse(final int commonAddress, final IeQualifierOfInterrogation qualifier, final ProcessImage processImage) {
    final ConnectionEventListener listener = this.connectionSteps.getConnectionEventListener();
    listener.newASdu(this.interrogationActivationConfirmationAsdu(commonAddress, qualifier));
    for (final ASdu asdu : processImage.toInterrogationAsdus(commonAddress, qualifier)) {
        listener.newASdu(asdu);
    }
    listener.newASdu(this.interrogationActivationTerminationAsdu(commonAddress, qualifier));
    return null;
}
Also used : ASdu(org.openmuc.j60870.ASdu) ConnectionEventListener(org.openmuc.j60870.ConnectionEventListener)

Example 2 with IeQualifierOfInterrogation

use of org.openmuc.j60870.ie.IeQualifierOfInterrogation in project open-smart-grid-platform by OSGP.

the class GeneralInterrogationService method sendGeneralInterrogation.

public void sendGeneralInterrogation(final ClientConnection deviceConnection, final RequestMetadata requestMetadata) throws IOException {
    final String connectedDevice = deviceConnection.getConnectionParameters().getDeviceIdentification();
    final int commonAddress = deviceConnection.getConnectionParameters().getCommonAddress();
    deviceConnection.getConnection().interrogation(commonAddress, CauseOfTransmission.ACTIVATION, new IeQualifierOfInterrogation(QUALIFIER_OF_INTERROGATION_ID));
    // interrogation command creates this asdu internally, however we
    // need it here as well for logging...
    final ASdu asdu = new ASdu(ASduType.C_IC_NA_1, false, CauseOfTransmission.ACTIVATION, false, false, ORIGINATOR_ADDRESS, commonAddress, new InformationObject(0, new IeQualifierOfInterrogation(QUALIFIER_OF_INTERROGATION_ID)));
    final LogItem logItem = new LogItem(connectedDevice, requestMetadata.getOrganisationIdentification(), false, asdu.toString());
    this.loggingService.log(logItem);
}
Also used : LogItem(org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.LogItem) IeQualifierOfInterrogation(org.openmuc.j60870.ie.IeQualifierOfInterrogation) ASdu(org.openmuc.j60870.ASdu) InformationObject(org.openmuc.j60870.ie.InformationObject)

Aggregations

ASdu (org.openmuc.j60870.ASdu)2 ConnectionEventListener (org.openmuc.j60870.ConnectionEventListener)1 IeQualifierOfInterrogation (org.openmuc.j60870.ie.IeQualifierOfInterrogation)1 InformationObject (org.openmuc.j60870.ie.InformationObject)1 LogItem (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.LogItem)1