use of org.openmuc.jdlms.MethodParameter in project open-smart-grid-platform by OSGP.
the class ClearMBusStatusOnAllChannelsCommandExecutor method resetAlarm.
private MethodResult resetAlarm(final DlmsConnectionManager conn, final int channel, final ObisCode obisCode) throws IOException {
final MBusClientMethod method = MBusClientMethod.RESET_ALARM;
final MethodParameter methodParameter = new MethodParameter(method.getInterfaceClass().id(), obisCode, method.getMethodId(), DataObject.newInteger8Data((byte) 0));
conn.getDlmsMessageListener().setDescription("ClearMBusStatusOnAllChannels-resetAlarm for channel" + channel + " - calling client setup: " + JdlmsObjectToStringUtil.describeMethod(methodParameter));
log.info("Calling method RESET_ALARM for channel {} with methodParam: {}.", channel, methodParameter);
return conn.getConnection().action(methodParameter);
}
use of org.openmuc.jdlms.MethodParameter in project open-smart-grid-platform by OSGP.
the class SetEncryptionKeyExchangeOnGMeterCommandExecutor method setEncryptionKey.
private MethodResult setEncryptionKey(final DlmsConnectionManager conn, final int channel, final byte[] encryptionKey) throws IOException {
final MethodParameter methodSetEncryptionKey = this.getSetEncryptionKeyMethodParameter(OBIS_HASHMAP.get(channel), encryptionKey);
conn.getDlmsMessageListener().setDescription("SetEncryptionKeyExchangeOnGMeter for channel " + channel + ", call M-Bus Setup set_encryption_key method: " + JdlmsObjectToStringUtil.describeMethod(methodSetEncryptionKey));
return conn.getConnection().action(methodSetEncryptionKey);
}
use of org.openmuc.jdlms.MethodParameter in project open-smart-grid-platform by OSGP.
the class SetEncryptionKeyExchangeOnGMeterCommandExecutor method getSetEncryptionKeyMethodParameter.
private MethodParameter getSetEncryptionKeyMethodParameter(final ObisCode obisCode, final byte[] encryptionKey) {
final DataObject methodParameter = DataObject.newOctetStringData(encryptionKey);
final MBusClientMethod method = MBusClientMethod.SET_ENCRYPTION_KEY;
return new MethodParameter(method.getInterfaceClass().id(), obisCode, method.getMethodId(), methodParameter);
}
Aggregations