LibItsCam_Encdec.cc 1.31 KB
Newer Older
#include "LibItsCam_EncdecDeclarations.hh"
garciay's avatar
garciay committed
#include "CAMCodec.hh"

namespace LibItsCam__EncdecDeclarations {
garciay's avatar
garciay committed

INTEGER fx__dec__CAM(BITSTRING& b, CAM__PDU__Descriptions::CAM& p);

/****************************************************
 * @desc    External function to encode a CamReq type
 * @param   value to encode
 * @return  encoded value
 ****************************************************/
BITSTRING fx__enc__CamReq(const LibItsCam__TestSystem::CamReq& p)
{
	return fx__enc__CAM(p.msgOut());
filatov's avatar
filatov committed
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
 ****************************************************/
garciay's avatar
garciay committed
/* 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;
}
garciay's avatar
garciay committed

BITSTRING fx__enc__CAM(const CAM__PDU__Descriptions::CAM& p)
{
	CAMPDUCodec codec;
	BITSTRING b;
	codec.encode(p, b);
	return b;
}

INTEGER fx__dec__CAM(BITSTRING& b, CAM__PDU__Descriptions::CAM& p)
{
garciay's avatar
garciay committed
//	CAMPDUCodec codec;
//	INTEGER rc = codec.decode(b, p);
//	if(rc > 0){
//		b = (b >> rc);
//	}
	return -1;
} //end namespace