Search in sources :

Example 1 with ConfigurationObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.ConfigurationObject in project open-smart-grid-platform by OSGP.

the class Smr5Profile method configurationObject.

@Bean
public ConfigurationObject configurationObject() {
    final Byte[] bytes = new Byte[this.configurationObjectFlags.size()];
    this.configurationObjectFlags.toArray(bytes);
    this.dynamicValues().setDefaultAttributeValue(InterfaceClass.DATA.id(), new ObisCode(0, 1, 94, 31, 3, 255), ConfigurationObject.ATTRIBUTE_ID_VALUE, DataObject.newBitStringData(new BitString(ArrayUtils.toPrimitive(bytes), 16)));
    return new ConfigurationObject();
}
Also used : BitString(org.openmuc.jdlms.datatypes.BitString) ConfigurationObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.ConfigurationObject) ObisCode(org.openmuc.jdlms.ObisCode) Bean(org.springframework.context.annotation.Bean)

Example 2 with ConfigurationObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.ConfigurationObject in project open-smart-grid-platform by OSGP.

the class DefaultDeviceProfile method configurationObject.

@Bean
public ConfigurationObject configurationObject() {
    final Byte[] bytes = new Byte[this.configurationObjectFlags.size()];
    this.configurationObjectFlags.toArray(bytes);
    this.dynamicValues().setDefaultAttributeValue(InterfaceClass.DATA.id(), new ObisCode(0, 1, 94, 31, 3, 255), ConfigurationObject.ATTRIBUTE_ID_VALUE, DataObject.newStructureData(DataObject.newEnumerateData(this.gprsOperationMode), DataObject.newBitStringData(new BitString(ArrayUtils.toPrimitive(bytes), 16))));
    return new ConfigurationObject();
}
Also used : BitString(org.openmuc.jdlms.datatypes.BitString) ConfigurationObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.ConfigurationObject) ObisCode(org.openmuc.jdlms.ObisCode) Bean(org.springframework.context.annotation.Bean)

Aggregations

ObisCode (org.openmuc.jdlms.ObisCode)2 BitString (org.openmuc.jdlms.datatypes.BitString)2 ConfigurationObject (org.opensmartgridplatform.simulator.protocol.dlms.cosem.ConfigurationObject)2 Bean (org.springframework.context.annotation.Bean)2