#include "BTPCodec.hh"
#include "BTPTypes.hh"

#include <TTCN3.hh>

int BTPCodec::encode (const LibItsBtp__TypesAndValues::BtpPacket& p, OCTETSTRING& data)
{

    TTCN_Buffer b;
    p.header().encode(LibItsBtp__TypesAndValues::BtpHeader_descr_, b, TTCN_EncDec::CT_RAW);
    b.get_string(data);

    return 0;
}

int BTPCodec::decode (const OCTETSTRING& data, LibItsBtp__TypesAndValues::BtpPacket& p)
{

    TTCN_Buffer b(data);
    p.header().decode(LibItsBtp__TypesAndValues::BtpHeader_descr_, b, TTCN_EncDec::CT_RAW);
    return 0;
}
