Search in sources :

Example 36 with DataObject

use of org.openmuc.jdlms.datatypes.DataObject in project open-smart-grid-platform by OSGP.

the class GetGsmDiagnosticCommandExecutorIntegrationTest method setResponseForAdjacentCells.

private void setResponseForAdjacentCells(final AttributeAddress address) {
    final DataObject cellId1 = DataObject.newUInteger32Data(85);
    final DataObject signalQuality1 = DataObject.newUInteger8Data((short) 24);
    final DataObject adjacentCells1 = DataObject.newStructureData(cellId1, signalQuality1);
    final DataObject cellId2 = DataObject.newUInteger32Data(0);
    final DataObject signalQuality2 = DataObject.newUInteger8Data((short) 0);
    final DataObject adjacentCells2 = DataObject.newStructureData(cellId2, signalQuality2);
    final DataObject cellId3 = DataObject.newUInteger32Data(303);
    final DataObject signalQuality3 = DataObject.newUInteger8Data((short) 31);
    final DataObject adjacentCells3 = DataObject.newStructureData(cellId3, signalQuality3);
    final DataObject responseDataObject = DataObject.newArrayData(Arrays.asList(adjacentCells1, adjacentCells2, adjacentCells3));
    this.connectionStub.addReturnValue(address, responseDataObject);
}
Also used : DataObject(org.openmuc.jdlms.datatypes.DataObject)

Example 37 with DataObject

use of org.openmuc.jdlms.datatypes.DataObject in project open-smart-grid-platform by OSGP.

the class GetGsmDiagnosticCommandExecutorIntegrationTest method setResponseForCellInfo.

private void setResponseForCellInfo(final AttributeAddress address) {
    final DataObject cellId = DataObject.newUInteger32Data(93);
    final DataObject locationId = DataObject.newUInteger16Data(2232);
    final DataObject signalQuality = DataObject.newUInteger8Data((short) 13);
    final DataObject ber = DataObject.newUInteger8Data((short) 6);
    final DataObject mcc = DataObject.newUInteger16Data(204);
    final DataObject mnc = DataObject.newUInteger16Data(66);
    final DataObject channelNumber = DataObject.newUInteger32Data(107);
    final DataObject responseDataObject = DataObject.newStructureData(cellId, locationId, signalQuality, ber, mcc, mnc, channelNumber);
    this.connectionStub.addReturnValue(address, responseDataObject);
}
Also used : DataObject(org.openmuc.jdlms.datatypes.DataObject)

Example 38 with DataObject

use of org.openmuc.jdlms.datatypes.DataObject in project open-smart-grid-platform by OSGP.

the class GetGsmDiagnosticCommandExecutorIntegrationTest method setResponseForRegistrationStatus.

private void setResponseForRegistrationStatus(final AttributeAddress address) {
    final DataObject responseDataObject = DataObject.newEnumerateData(5);
    this.connectionStub.addReturnValue(address, responseDataObject);
}
Also used : DataObject(org.openmuc.jdlms.datatypes.DataObject)

Example 39 with DataObject

use of org.openmuc.jdlms.datatypes.DataObject in project open-smart-grid-platform by OSGP.

the class GetGsmDiagnosticCommandExecutorIntegrationTest method setResponseForCaptureTime.

private void setResponseForCaptureTime(final AttributeAddress address) {
    final DataObject responseDataObject = DataObject.newDateTimeData(new CosemDateTime(2021, 4, 1, 9, 28, 0, 0));
    this.connectionStub.addReturnValue(address, responseDataObject);
}
Also used : DataObject(org.openmuc.jdlms.datatypes.DataObject) CosemDateTime(org.openmuc.jdlms.datatypes.CosemDateTime)

Example 40 with DataObject

use of org.openmuc.jdlms.datatypes.DataObject in project open-smart-grid-platform by OSGP.

the class GetGsmDiagnosticCommandExecutorIntegrationTest method setResponseForOperator.

private void setResponseForOperator(final AttributeAddress address) {
    final DataObject responseDataObject = DataObject.newVisibleStringData("Operator".getBytes(StandardCharsets.US_ASCII));
    this.connectionStub.addReturnValue(address, responseDataObject);
}
Also used : DataObject(org.openmuc.jdlms.datatypes.DataObject)

Aggregations

DataObject (org.openmuc.jdlms.datatypes.DataObject)176 ArrayList (java.util.ArrayList)46 AttributeAddress (org.openmuc.jdlms.AttributeAddress)36 ProtocolAdapterException (org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ProtocolAdapterException)34 Test (org.junit.jupiter.api.Test)31 GetResult (org.openmuc.jdlms.GetResult)23 SelectiveAccessDescription (org.openmuc.jdlms.SelectiveAccessDescription)16 DateTime (org.joda.time.DateTime)15 CosemDateTime (org.openmuc.jdlms.datatypes.CosemDateTime)14 SetParameter (org.openmuc.jdlms.SetParameter)12 DlmsObject (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.model.DlmsObject)11 BitString (org.openmuc.jdlms.datatypes.BitString)10 ObisCode (org.openmuc.jdlms.ObisCode)9 IOException (java.io.IOException)8 ConnectionException (org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ConnectionException)7 GetResultImpl (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.testutil.GetResultImpl)6 List (java.util.List)5 MethodResultCode (org.openmuc.jdlms.MethodResultCode)5 AttributeAddressForProfile (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.AttributeAddressForProfile)5 DlmsProfile (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.model.DlmsProfile)5