Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 848 → Rev 849

/trunk/javasrc/codec/org/etsi/its/codec/ItsCodecImpl.java
561,11 → 561,11
_logger.info(String.format("Octetstring value=length<%d> - <%s> - <%s>", ov.getLength(), ov.getType().getTypeEncoding(), ov.getValueEncodingVariant()));
String variant = ov.getValueEncodingVariant();
if (variant != null) {
if (variant == "MarkForIPv6SrcAddress") {
if (variant.equals("MarkForIPv6SrcAddress")) {
encodingContext.markIPv6SrcAddress();
} else if (variant == "MarkForIPv6DstAddress") {
} else if (variant.equals("MarkForIPv6DstAddress")) {
encodingContext.markIPv6DstAddress();
} else if (variant == "MarkForIPv6ChecksumCalculation") {
} else if (variant.equals("MarkForIPv6ChecksumCalculation")) {
encodingContext.markForIPv6ChecksumCalculation();
}
}
/trunk/javasrc/codec/org/etsi/its/codec/ttcn/LibItsCam_TypesAndValues/LibItsCam_TypesAndValuesCodec.java
104,10 → 104,10
public void encodeRecordValue(EncodingContext encodingContext, final RecordValue rv) {
_logger.entering("LibItsCam_TypesAndValuesCodec", "encodeRecordValue", String.format("%s - %s", rv.getType().getName(), rv.getType().getTypeEncoding()));
 
if (rv.getType().getName() == "CamPdu") {
if (rv.getType().getName().equals("CamPdu")) {
super.encodeRecordValue(encodingContext, rv);
} else {
if (rv.getType().getName() == "_0CoopAwareness") {
if (rv.getType().getName().equals("_0CoopAwareness")) {
try {
encodingContext.setByte(TestAdapterMessageTypeEnum.StationCharacteristics.convert());
} catch (IOException e) {
236,7 → 236,7
public void encodeUnionValue(EncodingContext encodingContext, final UnionValue uv) {
_logger.entering("LibItsCam_TypesAndValuesCodec", "encodeUnionValue", String.format("%s - %s", uv.getType().getName(), uv.getType().getTypeEncoding()));
 
if (uv.getType().getName() == "UtCamEvent") {
if (uv.getType().getName().equals("UtCamEvent")) {
try {
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(uv.getType().getName()));
} catch (IOException e) {
250,8 → 250,8
} // Type
EncodingContext out_uv1 = new EncodingContext();
if (
(uv.getPresentVariantName() == "setTurnAdvice") ||
(uv.getPresentVariantName() == "setPtLineDescription")) {
(uv.getPresentVariantName().equals("setTurnAdvice")) ||
(uv.getPresentVariantName().equals("setPtLineDescription"))) {
RecordValue rv = (RecordValue) uv.getVariant(uv.getPresentVariantName());
for (String fieldName : rv.getFieldNames()) {
try {
289,8 → 289,8
}
} // End of 'for' statement
} else if (
(uv.getPresentVariantName() == "setDoorStatus") ||
(uv.getPresentVariantName() == "setExteriorLightsStatus")) {
(uv.getPresentVariantName().equals("setDoorStatus")) ||
(uv.getPresentVariantName().equals("setExteriorLightsStatus"))) {
super.encodeBitstringValue(out_uv1, (BitstringValue) uv.getVariant(uv.getPresentVariantName())); // Value
out_uv1.finalizeBitstringValueEncoding(); // Needed to flush not aligned bits
} else {
/trunk/javasrc/codec/org/etsi/its/codec/ttcn/LibItsGeoNetworking_TypesAndValues/LibItsGeoNetworking_TypesAndValuesCodec.java
403,14 → 403,14
}
 
if (
(uv.getType().getName() == "AcGnPrimitive") ||
(uv.getType().getName() == "AcStartBeaconing") ||
(uv.getType().getName() == "AcStopBeaconing") ||
(uv.getType().getName() == "AcStartPassBeaconing") ||
(uv.getType().getName() == "AcStopPassBeaconing") ||
(uv.getType().getName() == "AcStartBeaconingMultipleNeighbour") ||
(uv.getType().getName() == "AcStopBeaconingMultipleNeighbour") ||
(uv.getType().getName() == "UtGNEvent")) {
(uv.getType().getName().equals("AcGnPrimitive")) ||
(uv.getType().getName().equals("AcStartBeaconing")) ||
(uv.getType().getName().equals("AcStopBeaconing")) ||
(uv.getType().getName().equals("AcStartPassBeaconing")) ||
(uv.getType().getName().equals("AcStopPassBeaconing")) ||
(uv.getType().getName().equals("AcStartBeaconingMultipleNeighbour")) ||
(uv.getType().getName().equals("AcStopBeaconingMultipleNeighbour")) ||
(uv.getType().getName().equals("UtGNEvent"))) {
try {
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(uv.getType().getName()));
} catch (IOException e) {
440,9 → 440,9
}
}
} else if ( // The Codec shall set the length of the payload if present
(uv.getType().getName() == "Payload") ||
(uv.getType().getName() == "BtpPacket") ||
(uv.getType().getName() == "Ipv6Packet")) {
(uv.getType().getName().equals("Payload")) ||
(uv.getType().getName().equals("BtpPacket")) ||
(uv.getType().getName().equals("Ipv6Packet"))) {
EncodingContext out_uv = new EncodingContext();
super.encodeUnionValue(out_uv, uv);
if (out_uv.size() != 0) {
723,7 → 723,7
String variantName = null;
GeoNetworkingTypesEnum enumType; // Used when the union variant selector is an enum type
Value decodedType = null; // Used when the union variant selector is an record type
if (decodingHypothesis.getName() == "StationType") {
if (decodingHypothesis.getName().equals("StationType")) {
/**
* See ETSI TS 102 636-4-1 - Table 1: Fields of GeoNetworking address
*/
739,7 → 739,7
enumType = GeoNetworkingTypesEnum.e_vehicleStation;
}
decodedType = (RecordValue) unionValue.getVariant(variantName).getType().newInstance();
} else if (decodingHypothesis.getName() == "Header") {
} else if (decodingHypothesis.getName().equals("Header")) {
/**
* See ETSI TS 102 636-4-1 - Table 4: Fields of the Common Header
*/
791,7 → 791,7
} // End of 'switch' statement
decodedType = (RecordValue) unionValue.getVariant(variantName).getType().newInstance();
((RecordValue)decodedType).setField(((RecordValue)decodedType).getFieldNames()[0], decodingContext.get_commonHeader());
} else if (decodingHypothesis.getName() == "HeaderTST") {
} else if (decodingHypothesis.getName().equals("HeaderTST")) {
/**
* See ETSI TS 102 636-4-1 - Table 6: GeoNetworking Header Types and Header Sub-Types
*/
844,7 → 844,7
break;
} // End of 'switch' statement
decodedType = (RecordValue) unionValue.getVariant(variantName).getType().newInstance();
} else if (decodingHypothesis.getName() == "Payload") {
} else if (decodingHypothesis.getName().equals("Payload")) {
/*
* If CommonHeader.PL field is set to 0, this means that we have to calculate the length of the payload
* Otherwise, the value of CommonHeader.PL field was forced by TTCN TC with a wrong value. In this case,
853,7 → 853,7
// FIXME Q&D code, need to be improved: problem is that constraint is not accessible and type is Type_133 !!!!!!
String nextHeader = ((EnumeratedValue)decodingContext.get_commonHeader().getField("nextHeader")).getEnum();
_logger.info(String.format("Payload: PL=%d - NH:%s", ((IntegerValue)decodingContext.get_commonHeader().getField("plLength")).getInt(), nextHeader));
if (nextHeader == "e_any") {
if (nextHeader.equals("e_any")) {
// Decode 'otherPayload' field
variantName = "otherPayload";
enumType = GeoNetworkingTypesEnum.e_any;
862,7 → 862,7
length = ((IntegerValue)decodingContext.get_commonHeader().getField("plLength")).getInt() * 8;
}
decodedType = decodeOctetstringValue(decodingContext, length);
} else if ((nextHeader == "e_btpA") || (nextHeader == "e_btpB")) {
} else if ((nextHeader.equals("e_btpA")) || (nextHeader.equals("e_btpB"))) {
// Decode 'btpPacket' field
variantName = "btpPacket";
enumType = GeoNetworkingTypesEnum.valueOf(nextHeader);
877,7 → 877,7
try {
btpPayload.write(0x34);
btpPayload.write(ByteHelper.intToByteArray(lengthInByte + 3, 2));
if (nextHeader == "e_btpA") {
if (nextHeader.equals("e_btpA")) {
btpPayload.write(TestAdapterMessageTypeEnum.BtpAHeader.convert());
} else {
btpPayload.write(TestAdapterMessageTypeEnum.BtpBHeader.convert());
901,7 → 901,7
} else {
throw new RuntimeException(String.format("Next header is '%s', payload is expected", nextHeader));
}
} else if (nextHeader == "e_ipv6") {
} else if (nextHeader.equals("e_ipv6")) {
// Decode 'ipv6Packet' field
variantName = "ipv6Packet";
enumType = GeoNetworkingTypesEnum.e_ipv6;
982,22 → 982,22
for (int i = 0; i < bitValue.getLength(); i++) {
value = (value << 1) | bitValue.getBit(i);
}
if (enumValue.getType().getName() == "TypeOfAddress") {
if (enumValue.getType().getName().equals("TypeOfAddress")) {
/**
* See ETSI TS 102 636-4-1 - Table 1: Fields of the GeoNetworking address
*/
enumValue.setEnum((value == 0) ? GeoNetworkingTypesEnum.e_initial.name() : GeoNetworkingTypesEnum.e_manual.name());
} else if (enumValue.getType().getName() == "StationSubType") {
} else if (enumValue.getType().getName().equals("StationSubType")) {
/**
* See ETSI TS 102 636-4-1 - Table 1: Fields of the GeoNetworking address
*/
enumValue.setEnum((value == 0) ? GeoNetworkingTypesEnum.e_public.name() : GeoNetworkingTypesEnum.e_private.name());
} else if (enumValue.getType().getName() == "StationTypeIdentifier") { // FIXME Why constraint is not accessble, Type_133
} else if (enumValue.getType().getName().equals("StationTypeIdentifier")) { // FIXME Why constraint is not accessble, Type_133
/**
* See ETSI TS 102 636-4-1 - Table 1: Fields of the GeoNetworking address
*/
enumValue.setEnum((value == 0) ? GeoNetworkingTypesEnum.e_vehicleStation.name() : GeoNetworkingTypesEnum.e_roadsideStation.name());
} else if (enumValue.getType().getName() == "VsKind") {
} else if (enumValue.getType().getName().equals("VsKind")) {
/**
* See ETSI TS 102 636-4-1 - Table 1: Fields of the GeoNetworking address
*/
1020,7 → 1020,7
default:
throw new RuntimeException(String.format("VsKind: 0x%02x enum value unknown", value));
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "RsKind") {
} else if (enumValue.getType().getName().equals("RsKind")) {
/**
* See ETSI TS 102 636-4-1 - Table 1: Fields of the GeoNetworking address
*/
1035,7 → 1035,7
enumValue.setEnum(GeoNetworkingTypesEnum.e_reserved.name());
break;
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "NextHeader") {
} else if (enumValue.getType().getName().equals("NextHeader")) {
/**
* See ETSI TS 102 636-4-1 - Table 4: Next Header (NH) field in GeoNetworking Common Header
*/
1056,7 → 1056,7
enumValue.setEnum(GeoNetworkingTypesEnum.e_reserved.name());
break;
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "Reliability") {
} else if (enumValue.getType().getName().equals("Reliability")) {
/**
* See ETSI TS 102 636-4-1 - Table 7: Encoding of the Traffic Class (TC) sub-field Reliability
*/
1076,7 → 1076,7
default:
throw new RuntimeException(String.format("Reliability: 0x%02x enum value unknown", value));
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "Latency") {
} else if (enumValue.getType().getName().equals("Latency")) {
/**
* See ETSI TS 102 636-4-1 - Table 8: Encoding of the TC sub-field Latency
*/
1096,7 → 1096,7
default:
throw new RuntimeException(String.format("Latency: 0x%02x enum value unknown", value));
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "LtBase") {
} else if (enumValue.getType().getName().equals("LtBase")) {
/**
* See ETSI TS 102 636-4-1 - Table 9: Encoding of LT sub-field LT Base
*/
1116,7 → 1116,7
default:
throw new RuntimeException(String.format("LtBase: 0x%02x enum value unknown", value));
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "HeaderSubTypeLs") {
} else if (enumValue.getType().getName().equals("HeaderSubTypeLs")) {
/**
* See ETSI TS 102 636-4-1 - Table 9: Encoding of LT sub-field LT Base
*/
1131,7 → 1131,7
enumValue.setEnum(GeoNetworkingTypesEnum.e_reserved.name());
break;
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "HeaderSubTypeGeoBroadcast") {
} else if (enumValue.getType().getName().equals("HeaderSubTypeGeoBroadcast")) {
/**
* See ETSI TS 102 636-4-1 - Table 6: GeoNetworking Header Types and Header Sub-Types
*/
1149,7 → 1149,7
enumValue.setEnum(GeoNetworkingTypesEnum.e_reserved.name());
break;
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "HeaderSubTypeGeoAnycast") {
} else if (enumValue.getType().getName().equals("HeaderSubTypeGeoAnycast")) {
/**
* See ETSI TS 102 636-4-1 - Table 6: GeoNetworking Header Types and Header Sub-Types
*/
1167,7 → 1167,7
enumValue.setEnum(GeoNetworkingTypesEnum.e_reserved.name());
break;
} // End of 'switch' statement
} else if (enumValue.getType().getName() == "HeaderSubTypeTSB") {
} else if (enumValue.getType().getName().equals("HeaderSubTypeTSB")) {
/**
* See ETSI TS 102 636-4-1 - Table 6: GeoNetworking Header Types and Header Sub-Types
*/