Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "LibItsCam_EncdecDeclarations.hh"
namespace LibItsCam__EncdecDeclarations {
/****************************************************
* @desc External function to encode a CamReq type
* @param value to encode
* @return encoded value
****************************************************/
BITSTRING fx__enc__CamReq(const LibItsCam__TestSystem::CamReq& p)
{
//set error behavior
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL,TTCN_EncDec::EB_WARNING);
TTCN_Buffer TTCN_buf;
TTCN_buf.clear();
//encode message in BER (CER variant, but can be any)
p.msgOut().encode(CAM__PDU__Descriptions::CAM_descr_,TTCN_buf,TTCN_EncDec::CT_BER,BER_ENCODE_CER);
OCTETSTRING encodedData(TTCN_buf.get_len(), TTCN_buf.get_data());
//insert BER2PER recoding here!
return oct2bit(encodedData);
}
/****************************************************
* @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;
}
*/
} //end namespace