Commit fa98b04c authored by garciay's avatar garciay

Rebuild TA/Codec for TCT3

parent b0fdf61d
......@@ -12,9 +12,14 @@ public class DecodedBtpPayload extends Union {
setLengths();
}
private void setLengths() {
private void setLengths() { // See LibItsBtp_TypesAndValues TTCN-3 module
mainCodec.setHint("camPacket", "camPacket");
mainCodec.setHint("denmPacket", "denmPacket");
mainCodec.setHint("mapemPacket", "mapemPacket");
mainCodec.setHint("spatemPacket", "spatemPacket");
mainCodec.setHint("ivimPacket", "ivimPacket");
mainCodec.setHint("sremPacket", "sremPacket");
mainCodec.setHint("ssemSsemPacket", "ssemSsemPacket");
}
@Override
......
......@@ -37,12 +37,12 @@ public class BuiltInCodec implements TciCDProvided {
_encodingName = "DENM_PDU_Descriptions";
} else if (encodingName.equals("LibItsCam_asn1")) {
_encodingName = "CAM_PDU_Descriptions";
} else if (encodingName.equals("LibItsMapem_asn1")) {
_encodingName = "MAPEM_PDU_Descriptions";
} else if (encodingName.equals("LibItsSpatem_asn1")) {
_encodingName = "SPATEM_PDU_Descriptions";
} else if (encodingName.equals("LibItsMapemSpatem_asn1")) {
_encodingName = "MAPEM_SPATEM_ETSI";
} else if (encodingName.equals("LibItsIvim_asn1")) {
_encodingName = "IVIM_PDU_Descriptions";
} else if (encodingName.equals("LibItsSremSsem_asn1")) {
_encodingName = "SREM_SSEM_ETSI";
} else if (encodingName.equals("LibItsCALMmsap_asn1")) {
_encodingName = "CALMmsap";
} else if (encodingName.equals("LibItsCALMllsap_asn1")) {
......@@ -53,8 +53,6 @@ public class BuiltInCodec implements TciCDProvided {
_encodingName = "CALMfsap";
} else if (encodingName.equals("LibItsIicp_asn1")) {
_encodingName = "CALMiitsscu";
} else if (encodingName.equals("LibItsMapSpat_asn1")) {
_encodingName = "MAP_SPAT_ETSI";
} else {
_encodingName = "";
}
......
......@@ -52,7 +52,9 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT
} else if (debugLevel.equalsIgnoreCase("SEVERE")) {
level = Level.SEVERE;
} else if (!debugLevel.equalsIgnoreCase("OFF")) {
TERFactory.getInstance().logError("Unsupported logging level: " + debugLevel);
// FIXME
//TERFactory.getInstance().logError("Unsupported logging level: " + debugLevel);
level = Level.OFF;
}
_logger.addHandler(new ConsoleHandler());
_logger.setLevel(level);
......
package org.etsi.its.tool.elvior;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tri.TriMessage;
/**
*
* Note that "Enable Internal Codec" field shall be set to true
*
*/
public class LibItsIvim_asn1 extends LibIts_asn1 {
/**
* Constructor
*/
public LibItsIvim_asn1() {
_logger.entering("LibItsIvim_asn1", "LibItsIvim_asn1");
_encodingName = "IVIM_PDU_Descriptions";
}
@Override
public Value decode(final TriMessage message, final Type decodingHypothesis) {
_logger.entering("LibItsIvim_asn1", "decode", decodingHypothesis.getName());
if (decodingHypothesis.getName().endsWith("ivimPacket")) {
Type type = getTypeForName("IVIM_PDU_Descriptions.IVIM");
return super.decode(message, type);
}
return super.decode(message, decodingHypothesis);
}
} // End of class LibItsIvim_asn1
package org.etsi.its.tool.elvior;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tri.TriMessage;
/**
*
* Note that "Enable Internal Codec" field shall be set to true
*
*/
public class LibItsMapemSpatem_asn1 extends LibIts_asn1 {
/**
* Constructor
*/
public LibItsMapemSpatem_asn1() {
_logger.entering("LibItsMapemSpatem_asn1", "LibItsMapemSpatem_asn1");
_encodingName = "MAPEM_SPATEM_ETSI";
}
@Override
public Value decode(final TriMessage message, final Type decodingHypothesis) {
_logger.entering("LibItsMapemSpatem_asn1", "decode", decodingHypothesis.getName());
if (decodingHypothesis.getName().endsWith("mapemPacket")) {
Type type = getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
return super.decode(message, type);
} else if (decodingHypothesis.getName().endsWith("spatemPacket")) {
Type type = getTypeForName("SPATEM_PDU_Descriptions.SPATEM");
return super.decode(message, type);
}
return super.decode(message, decodingHypothesis);
}
} // End of class LibItsMapemSpatem_asn1
package org.etsi.its.tool.elvior;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tri.TriMessage;
/**
*
* Note that "Enable Internal Codec" field shall be set to true
*
*/
public class LibItsSremSsem_asn1 extends LibIts_asn1 {
/**
* Constructor
*/
public LibItsSremSsem_asn1() {
_logger.entering("LibItsSremSsem_asn1", "LibItsSremSsem_asn1");
_encodingName = "SREM_SSEM_ETSI";
}
@Override
public Value decode(final TriMessage message, final Type decodingHypothesis) {
_logger.entering("LibItsSremSsem_asn1", "decode", decodingHypothesis.getName());
if (decodingHypothesis.getName().endsWith("sremPacket")) {
Type type = getTypeForName("SREM_PDU_Descriptions.MAPEM");
return super.decode(message, type);
} else if (decodingHypothesis.getName().endsWith("ssemPacket")) {
Type type = getTypeForName("SSEM_PDU_Descriptions.SPATEM");
return super.decode(message, type);
}
return super.decode(message, decodingHypothesis);
}
} // End of class LibItsSremSsem_asn1
......@@ -584,8 +584,8 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
_logger.info(String.format("Setting parameter %s", parameterList.get(2).getParameterName()));
value = parameterList.get(2).getEncodedParameter();
IntegerValue distance = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
distance.setInteger(ByteHelper.byteArrayToInt(value));
FloatValue distance = (FloatValue)TciProvider.getInstance().getTciCDRequired().getFloat().newInstance();
distance.setFloat(ByteHelper.byteArrayToInt(value)); // FIXME Should be byteArrayToFloat???
_logger.info(String.format("Setting parameter %s", parameterList.get(3).getParameterName()));
value = parameterList.get(3).getEncodedParameter();
......@@ -1161,7 +1161,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
parameterList.get(1).setNumberOfBits(certificate.getLength() * Byte.SIZE);
byte[] value = new byte[certificate.getLength()];
for (int i = 0; i < value.length; i++) {
value[i] = (byte) certificate.getOctet(i);
value[i] = (byte) certificate.getOctet(i);
}// End of 'for'statement
parameterList.get(1).setEncodedParameter(value);
......@@ -1190,7 +1190,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
parameterList.get(1).setNumberOfBits(digest.getLength() * Byte.SIZE);
byte[] value = new byte[digest.getLength()];
for (int i = 0; i < value.length; i++) {
value[i] = (byte) digest.getOctet(i);
value[i] = (byte) digest.getOctet(i);
}// End of 'for'statement
parameterList.get(1).setEncodedParameter(value);
......@@ -1219,7 +1219,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE);
byte[] value = new byte[privateKey.getLength()];
for (int i = 0; i < value.length; i++) {
value[i] = (byte) privateKey.getOctet(i);
value[i] = (byte) privateKey.getOctet(i);
}// End of 'for'statement
parameterList.get(1).setEncodedParameter(value);
......@@ -1248,7 +1248,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE);
byte[] value = new byte[privateKey.getLength()];
for (int i = 0; i < value.length; i++) {
value[i] = (byte) privateKey.getOctet(i);
value[i] = (byte) privateKey.getOctet(i);
}// End of 'for'statement
parameterList.get(1).setEncodedParameter(value);
......
......@@ -8,6 +8,7 @@ import java.math.BigInteger;
import org.elvior.ttcn.tritci.IntegerValueEx;
import org.elvior.ttcn.tritci.TciProvider;
import org.etsi.adapter.TERFactory;
import org.etsi.codec.ITciCDWrapper;
import org.etsi.ttcn.tci.BooleanValue;
import org.etsi.ttcn.tci.CharstringValue;
......
......@@ -6,6 +6,7 @@ package org.etsi.tool.elvior;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Logger;
import org.elvior.ttcn.tritci.TriFactory;
import org.elvior.ttcn.tritci.TriProvider;
......@@ -30,6 +31,8 @@ public class TeRequiredImpl implements ITERequired {
private static Properties _properties = new Properties();
protected final static Logger _logger = Logger.getLogger("org.etsi.its");
public TeRequiredImpl(PluginAdapter ta) {
_ta = ta;
// Load TA settings
......@@ -133,4 +136,14 @@ public class TeRequiredImpl implements ITERequired {
return getTriStatus(statusCode);
}
@Override
public void logDebug(String debugMessage) {
_logger.info(debugMessage);
}
@Override
public void logError(String errorMessage) {
_logger.severe(errorMessage);
}
} // End of class TeRequiredImpl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment