Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
bce23619
Commit
bce23619
authored
Aug 17, 2016
by
garciay
Browse files
Add a workaround on incorrect decodeHypothesis returned value ("per-basic-unaligned:1997")
parent
c4df8f4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
javasrc/tool/org/etsi/its/tool/elvior/Its_CodecProvider.java
View file @
bce23619
...
...
@@ -87,7 +87,13 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT
}
catch
(
InstantiationException
|
IllegalAccessException
|
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
// End of 'foreach' loop
}
// End of 'for' loop
try
{
_cf
.
setExternalCodec
(
"per-basic-unaligned:1997"
,
(
TciCDProvided
)
Class
.
forName
(
"org.etsi.its.tool.elvior.LibIts_asn1"
).
newInstance
());
}
catch
(
InstantiationException
|
IllegalAccessException
|
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
public
void
run
()
{
...
...
javasrc/tool/org/etsi/its/tool/elvior/LibIts_asn1.java
View file @
bce23619
...
...
@@ -59,7 +59,26 @@ public class LibIts_asn1 implements TciCDProvided {
msg
.
setEncodedMessage
(
message
.
getEncodedMessage
());
if
(
_logger
.
isLoggable
(
Level
.
ALL
))
ByteHelper
.
dump
(
"LibIts_asn1.decode: "
,
msg
.
getEncodedMessage
());
String
type
=
String
.
format
(
"%s.%s"
,
_encodingName
,
decodingHypothesis
.
getName
());
String
type
=
""
;
if
(
decodingHypothesis
.
getTypeEncoding
().
equals
(
"per-basic-unaligned:1997"
))
{
if
(
decodingHypothesis
.
getName
().
equals
(
"CAM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"CAM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
else
if
(
decodingHypothesis
.
getName
().
equals
(
"DENM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"DENM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
else
if
(
decodingHypothesis
.
getName
().
equals
(
"MAPEM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"MAPEM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
else
if
(
decodingHypothesis
.
getName
().
equals
(
"SPATEM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"SPATEM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
else
if
(
decodingHypothesis
.
getName
().
equals
(
"IVIM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"IVIM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
else
if
(
decodingHypothesis
.
getName
().
equals
(
"SREM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"SREM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
else
if
(
decodingHypothesis
.
getName
().
equals
(
"SSEM"
))
{
type
=
String
.
format
(
"%s.%s"
,
"SSEM_PDU_Descriptions"
,
decodingHypothesis
.
getName
());
}
}
else
{
type
=
String
.
format
(
"%s.%s"
,
_encodingName
,
decodingHypothesis
.
getName
());
}
_logger
.
info
(
"Type: "
+
type
);
Type
asnOriginalType
=
getTypeForName
(
type
);
// Check which type class the decoding hypothesis is of
...
...
javasrc/tool/org/etsi/tool/elvior/TciCDWrapper.java
View file @
bce23619
...
...
@@ -104,7 +104,7 @@ public class TciCDWrapper implements ITciCDWrapper {
String
variantTypeName
=
decodingHypothesis
.
getDefiningModule
().
getModuleName
()
+
"."
+
decodingHypothesis
.
getName
()
+
"."
+
variantName
;
// TERFactory.getInstance().logDebug("variantTypeName is " + variantTypeName);
Type
variantType
=
_tciFactory
.
getTypeForName
(
variantTypeName
);
Type
variantType
=
getTypeForName
(
variantTypeName
);
if
(
variantType
!=
null
)
{
Value
testVal
=
variantType
.
newInstance
();
if
(
testVal
!=
null
)
{
...
...
@@ -120,10 +120,26 @@ public class TciCDWrapper implements ITciCDWrapper {
@Override
public
Type
getTypeForName
(
final
String
type
)
{
// return TciProvider.getInstance().getTciCDRequired().getTypeForName(type);
// TERFactory.getInstance().logDebug("TciCDWrapper.getTypeForName" + type);
Type
originalType
=
TciProvider
.
getInstance
().
getTciCDRequired
().
getTypeForName
(
type
);
// TERFactory.getInstance().logDebug("TciCDWrapper.getTypeForName" + originalType.getName());
// TERFactory.getInstance().logDebug("TciCDWrapper.getTypeForName: " + type);
Type
originalType
;
if
(
type
.
indexOf
(
"DecodedBtpPayload"
)
!=
-
1
)
{
if
(
type
.
endsWith
(
"camPacket"
))
{
originalType
=
_tciFactory
.
getTypeForName
(
"CAM_PDU_Descriptions.CAM"
);
}
else
if
(
type
.
endsWith
(
"denmPacket"
))
{
originalType
=
_tciFactory
.
getTypeForName
(
"DENM_PDU_Descriptions.DENM"
);
}
else
if
(
type
.
endsWith
(
"mapemPacket"
))
{
originalType
=
_tciFactory
.
getTypeForName
(
"MAPEM_PDU_Descriptions.MAPEM"
);
}
else
if
(
type
.
endsWith
(
"spatemPacket"
))
{
originalType
=
_tciFactory
.
getTypeForName
(
"MAPEM_PDU_Descriptions.SPATEM"
);
}
else
if
(
type
.
endsWith
(
"ivimPacket"
))
{
originalType
=
_tciFactory
.
getTypeForName
(
"IVIM_PDU_Descriptions.IVIM"
);
}
else
{
originalType
=
_tciFactory
.
getTypeForName
(
type
);
}
}
else
{
originalType
=
_tciFactory
.
getTypeForName
(
type
);
}
// TERFactory.getInstance().logDebug("TciCDWrapper.getTypeForName: " + originalType.getName());
return
originalType
;
}
// End of method getTypeForName
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment