Search in sources :

Example 1 with InformationElement

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

the class LightMeasurementDeviceAsduFactory method createInformationElementWithTimetag.

private InformationElement[][] createInformationElementWithTimetag(final boolean value, final long timestamp) {
    final TimeZone timeZone = TimeZone.getTimeZone(this.timeZoneString);
    final boolean invalid = false;
    return new InformationElement[][] { { new IeSinglePointWithQuality(value, false, false, false, false), new IeTime56(timestamp, timeZone, invalid) } };
}
Also used : IeSinglePointWithQuality(org.openmuc.j60870.ie.IeSinglePointWithQuality) TimeZone(java.util.TimeZone) IeTime56(org.openmuc.j60870.ie.IeTime56) InformationElement(org.openmuc.j60870.ie.InformationElement)

Example 2 with InformationElement

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

the class Iec60870Server method addTimestamp.

private static InformationElement[][] addTimestamp(final InformationElement[][] informationElements) {
    final InformationElement[][] result = Arrays.copyOf(informationElements, 2);
    result[1] = new InformationElement[] { new IeTime56(System.currentTimeMillis()) };
    return result;
}
Also used : IeTime56(org.openmuc.j60870.ie.IeTime56)

Example 3 with InformationElement

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

the class Iec60870ServerEventListener method sendInformationUpdateEvent.

public void sendInformationUpdateEvent(final int informationObjectAddress, final InformationElement[][] informationElements) {
    final ASdu event = new ASdu(ASduType.M_SP_TB_1, false, CauseOfTransmission.SPONTANEOUS, false, false, 0, 0, new InformationObject(informationObjectAddress, informationElements));
    this.iec60870ConnectionRegistry.getAllConnections().forEach(connection -> this.sendEvent(connection, event));
}
Also used : ASdu(org.openmuc.j60870.ASdu) InformationObject(org.openmuc.j60870.ie.InformationObject)

Aggregations

IeTime56 (org.openmuc.j60870.ie.IeTime56)2 TimeZone (java.util.TimeZone)1 ASdu (org.openmuc.j60870.ASdu)1 IeSinglePointWithQuality (org.openmuc.j60870.ie.IeSinglePointWithQuality)1 InformationElement (org.openmuc.j60870.ie.InformationElement)1 InformationObject (org.openmuc.j60870.ie.InformationObject)1