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
19b549ff
Commit
19b549ff
authored
Jun 07, 2017
by
filatov
Browse files
fix external functions
parent
48596740
Changes
4
Hide whitespace changes
Inline
Side-by-side
ccsrc/EncDec/LibItsBtp_Encdec.cc
View file @
19b549ff
...
...
@@ -22,4 +22,16 @@ INTEGER fx__dec__BtpPayload(BITSTRING& b, LibItsBtp__TypesAndValues::BtpPayload&
return -1;
}
*/
BITSTRING
fx__enc__BtpReq
(
LibItsBtp__TestSystem
::
BtpReq
const
&
)
{
return
int2bit
(
0
,
8
);
}
INTEGER
fx__dec__BtpInd
(
BITSTRING
&
,
LibItsBtp__TestSystem
::
BtpInd
&
)
{
return
0
;
}
}
//end namespace
ccsrc/EncDec/LibItsCam_Encdec.cc
View file @
19b549ff
...
...
@@ -2,9 +2,6 @@
#include
"CAMCodec.hh"
namespace
LibItsCam__EncdecDeclarations
{
INTEGER
fx__dec__CAM
(
BITSTRING
&
b
,
CAM__PDU__Descriptions
::
CAM
&
p
);
/****************************************************
* @desc External function to encode a CamReq type
* @param value to encode
...
...
@@ -15,22 +12,20 @@ BITSTRING fx__enc__CamReq(const LibItsCam__TestSystem::CamReq& p)
return
fx__enc__CAM
(
p
.
msgOut
());
}
INTEGER
fx__dec__CamInd
(
BITSTRING
&
b
,
LibItsCam__TestSystem
::
CamInd
&
p
)
{
return
fx__dec__CAM
(
b
,
p
.
msgIn
());
}
/****************************************************
* @desc External function to decode a DenmReq type
* @param value to encode
* @return encoded value
****************************************************/
/* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016)*/
INTEGER
fx__dec__CamReq
(
BITSTRING
&
b
,
LibItsCam__TestSystem
::
CamReq
&
p
)
{
return
-
1
;
}
INTEGER
fx__dec__CamInd
(
BITSTRING
&
b
,
LibItsCam__TestSystem
::
CamInd
&
p
)
{
return
fx__dec__CAM
(
b
,
p
.
msgIn
());
}
BITSTRING
fx__enc__CAM
(
const
CAM__PDU__Descriptions
::
CAM
&
p
)
{
...
...
@@ -42,12 +37,12 @@ BITSTRING fx__enc__CAM(const CAM__PDU__Descriptions::CAM& p)
INTEGER
fx__dec__CAM
(
BITSTRING
&
b
,
CAM__PDU__Descriptions
::
CAM
&
p
)
{
//
CAMPDUCodec codec;
//
INTEGER rc = codec.decode(b, p);
//
if(rc > 0){
//
b = (b >> rc);
//
}
return
-
1
;
CAMPDUCodec
codec
;
INTEGER
rc
=
codec
.
decode
(
b
,
p
);
if
(
rc
>
0
){
b
=
(
b
>>
rc
);
}
return
0
;
}
}
//end namespace
...
...
ccsrc/EncDec/LibItsDenm_Encdec.cc
View file @
19b549ff
...
...
@@ -17,6 +17,7 @@ BITSTRING fx__enc__DenmReq(const LibItsDenm__TestSystem::DenmReq& p)
//encode message in BER (CER variant, but can be any)
p
.
msgOut
().
encode
(
DENM__PDU__Descriptions
::
DENM_descr_
,
TTCN_buf
,
TTCN_EncDec
::
CT_BER
,
BER_ENCODE_CER
);
OCTETSTRING
encodedData
(
TTCN_buf
.
get_len
(),
TTCN_buf
.
get_data
());
//insert BER2PER recoding here!
...
...
@@ -35,4 +36,9 @@ INTEGER fx__dec__DenmReq(BITSTRING& b, LibItsDenm__TestSystem::DenmReq& p)
return
-
1
;
}
INTEGER
fx__dec__DenmInd
(
BITSTRING
&
b
,
LibItsDenm__TestSystem
::
DenmInd
&
p
)
{
return
-
1
;
}
}
//end namespace
ttcn/TestCodec/TestCodec_CAM.ttcn
View file @
19b549ff
...
...
@@ -127,7 +127,7 @@ module TestCodec_CAM {
// Encode template
log
(
"Encode template "
,
valueof
(
p_camReq
));
v_encMsg
:=
encvalue
(
p_camReq
);
log
(
"Encoded message: "
,
bit2oct
(
v_encMsg
));
log
(
"Encoded message:
"
,
bit2oct
(
v_encMsg
));
// Check result
if
(
not
isbound
(
v_encMsg
))
{
setverdict
(
fail
,
"Encoding failed!"
);
...
...
@@ -135,7 +135,7 @@ module TestCodec_CAM {
}
if
(
ispresent
(
v_tr
.
bs
))
{
if
(
not
match
(
v_encMsg
,
p_expEncMsg
))
{
log
(
"Expected message: "
,
p_expEncMsg
);
log
(
"Expected message: "
,
bit2oct
(
valueof
(
p_expEncMsg
)
))
;
setverdict
(
fail
,
"Encoding failed, not the expected result!"
);
stop
;
}
...
...
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