blob: aa012a11af5bb364e12732a70b363e430260e5ea [file] [log] [blame]
/////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2019 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
/////////////////////////////////////////////////////////////////////////////////////
// Contributors:
// Akos Makovics
//
// File: OpcUa_Functions_JSON.ttcn
// Rev: <RnXnn>
// Prodnr: CNL113861
/////////////////////////////////////////////////////////////////////////////////////
module OpcUa_Functions_JSON_Non_Reversible {
import from OpcUa_Types_JSON_Non_Reversible all;
function f_CalculateSize(in MessageTypes pl_in) return integer {
var octetstring encoded := enc_MessageTypes(pl_in);
return lengthof(encoded);
}
function f_ObjectAttributes_PreProcess (inout ObjectAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.eventNotifier != omit) {
mask := mask + 4;
if (pl_in.eventNotifier == 0) {
pl_in.eventNotifier := omit;
}
}
if (pl_in.writeMask != omit) {
mask := mask + 8;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 16;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
}
function f_ObjectAttributes_PostProcess (inout ObjectAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 8);
if (mask[3] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[4] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
if (mask[5] == '1'B and pl_in.eventNotifier == omit) {
pl_in.eventNotifier := 0;
}
}
function f_VariableAttributes_PreProcess (inout VariableAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.Value != omit) {
mask := mask + 4;
if (pl_in.Value == 0) {
pl_in.Value := omit;
}
}
if (pl_in.dataType != omit) {
mask := mask + 8;
}
if (pl_in.valueRank != omit) {
mask := mask + 16;
if (pl_in.valueRank == 0) {
pl_in.valueRank := omit;
}
}
if (pl_in.arrayDimensions != omit) {
mask := 32;
}
if (pl_in.accessLevel != omit){
mask := mask + 64;
if (pl_in.accessLevel == 0) {
pl_in.accessLevel := omit;
}
}
if (pl_in.userAccessLevel != omit) {
mask := mask + 128;
if (pl_in.userAccessLevel == 0) {
pl_in.userAccessLevel := omit;
}
}
if (pl_in.minimumSamplingInterval != omit) {
mask := mask + 256;
}
if (pl_in.historizing != omit) {
mask := mask + 512;
}
if (pl_in.writeMask != omit) {
mask := mask + 1024;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 2048;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_VariableAttributes_PostProcess (inout VariableAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 12);
log (mask);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
if (mask[4] == '1'B and pl_in.userAccessLevel == omit) {
pl_in.userAccessLevel := 0;
}
if (mask[5] == '1'B and pl_in.accessLevel == omit) {
pl_in.accessLevel := 0;
}
if (mask[7] == '1'B and pl_in.valueRank == omit) {
pl_in.valueRank := 0;
}
if (mask[9] == '1'B and pl_in.Value == omit) {
pl_in.Value := 0;
}
log (pl_in);
}
function f_MethodAttributes_PreProcess (inout MethodAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.executable != omit) {
mask := mask + 4;
}
if (pl_in.userExecutable != omit) {
mask := mask + 8;
}
if (pl_in.writeMask != omit) {
mask := mask + 16;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 32;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_MethodAttributes_PostProcess (inout MethodAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 6);
log (mask);
log (mask[0]);
log (mask[1]);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
log (pl_in);
}
function f_ObjectTypeAttributes_PreProcess (inout ObjectTypeAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.isAbstract != omit) {
mask := mask + 4;
}
if (pl_in.writeMask != omit) {
mask := mask + 8;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 16;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_ObjectTypeAttributes_PostProcess (inout ObjectTypeAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 5);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
log (pl_in);
}
function f_VariableTypeAttributes_PreProcess (inout VariableTypeAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.Value != omit) {
mask := mask + 4;
if (pl_in.Value == 0) {
pl_in.Value := omit;
}
}
if (pl_in.dataType != omit) {
mask := mask + 8;
}
if (pl_in.valueRank != omit) {
mask := mask + 16;
if (pl_in.valueRank == 0) {
pl_in.valueRank := omit;
}
}
if (pl_in.arrayDimensions != omit) {
mask := 32;
}
if (pl_in.isAbstract != omit){
mask := mask + 64;
}
if (pl_in.writeMask != omit) {
mask := mask + 128;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 256;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_VariableTypeAttributes_PostProcess (inout VariableTypeAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 9);
log (mask);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
if (mask[4] == '1'B and pl_in.valueRank == omit) {
pl_in.valueRank := 0;
}
if (mask[6] == '1'B and pl_in.Value == omit) {
pl_in.Value := 0;
}
log (pl_in);
}
function f_ReferenceTypeAttributes_PreProcess (inout ReferenceTypeAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.isAbstract != omit) {
mask := mask + 4;
}
if (pl_in.symmetric != omit) {
mask := mask + 8;
}
if (pl_in.inverseName != omit) {
mask := mask + 16;
}
if (pl_in.writeMask != omit) {
mask := mask + 32;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 64;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_ReferenceTypeAttributes_PostProcess (inout ReferenceTypeAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 7);
log (mask);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
log (pl_in);
}
function f_DataTypeAttributes_PreProcess (inout DataTypeAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.isAbstract != omit) {
mask := mask + 4;
}
if (pl_in.writeMask != omit) {
mask := mask + 8;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 16;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_DataTypeAttributes_PostProcess (inout DataTypeAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 5);
log (mask);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
log (pl_in);
}
function f_ViewAttributes_PreProcess (inout ViewAttributes pl_in) {
var integer mask := 0;
if (pl_in.displayName != omit) {
mask := 1;
}
if (pl_in.description != omit){
mask := mask + 2;
}
if (pl_in.containsNoLoops != omit) {
mask := mask + 4;
}
if (pl_in.eventNotifier != omit) {
mask := mask + 8;
if (pl_in.eventNotifier == 0) {
pl_in.eventNotifier := omit;
}
}
if (pl_in.writeMask != omit) {
mask := mask + 16;
if (pl_in.writeMask == 0) {
pl_in.writeMask := omit;
}
}
if (pl_in.userWriteMask != omit) {
mask := mask + 32;
if (pl_in.userWriteMask == 0) {
pl_in.userWriteMask := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_ViewAttributes_PostProcess (inout ViewAttributes pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 6);
log (mask);
if (mask[0] == '1'B and pl_in.userWriteMask == omit) {
pl_in.userWriteMask := 0;
}
if (mask[1] == '1'B and pl_in.writeMask == omit) {
pl_in.writeMask := 0;
}
if (mask[2] == '1'B and pl_in.eventNotifier == omit) {
pl_in.eventNotifier := 0;
}
log (pl_in);
}
function f_DataValue_PreProcess (inout DataValue pl_in) {
var integer mask := 0;
if (pl_in.Value != omit) {
mask := 1;
}
if (pl_in.Status != omit){
mask := mask + 2;
}
if (pl_in.SourceTimeStamp != omit) {
mask := mask + 4;
}
if (pl_in.SourcePicoSecond != omit) {
mask := mask + 8;
if (pl_in.SourcePicoSecond == 0) {
pl_in.SourcePicoSecond := omit;
}
}
if (pl_in.ServerTimestamp != omit) {
mask := mask + 16;
}
if (pl_in.ServerPicoSeconds != omit) {
mask := mask + 32;
if (pl_in.ServerPicoSeconds == 0) {
pl_in.ServerPicoSeconds := omit;
}
}
pl_in.EncodingMask := mask;
log (pl_in);
}
function f_DataValue_PostProcess (inout DataValue pl_in) {
var bitstring mask := int2bit(pl_in.EncodingMask, 6);
log (mask);
if (mask[0] == '1'B and pl_in.ServerPicoSeconds == omit) {
pl_in.ServerPicoSeconds := 0;
}
if (mask[2] == '1'B and pl_in.SourcePicoSecond == omit) {
pl_in.SourcePicoSecond := 0;
}
log (pl_in);
}
}