Commit 3304abf6 authored by garciay's avatar garciay
Browse files

GeoNetworking codecs ongoing

Add GeoNetworkingLayer
parent 99930cfa
......@@ -13,9 +13,11 @@ BITSTRING fx__enc__GeoNetworkingReq(LibItsGeoNetworking__TestSystem::GeoNetworki
{
loggers::loggers::log("fx__enc__GeoNetworkingReq");
GeoNetworkingCodec codec;
OCTETSTRING os;
const LibItsGeoNetworking__TypesAndValues::GeoNetworkingPdu & pdu = p_geoNetworkingReq.msgOut();
OCTETSTRING os;
codec.encode(pdu, os);
const unsigned char mac_address[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
os += OCTETSTRING(sizeof(mac_address), static_cast<const unsigned char *>(mac_address));
return oct2bit(os);
}
......@@ -28,7 +30,19 @@ BITSTRING fx__enc__GeoNetworkingReq(LibItsGeoNetworking__TestSystem::GeoNetworki
INTEGER fx__dec__GeoNetworkingReq(BITSTRING& b, LibItsGeoNetworking__TestSystem::GeoNetworkingReq& p)
{
loggers::loggers::log("fx__dec__GeoNetworkingReq");
return -1;
GeoNetworkingCodec codec;
LibItsGeoNetworking__TypesAndValues::GeoNetworkingPdu pdu;
OCTETSTRING is = bit2oct(b);
if (codec.decode(OCTETSTRING(is.lengthof() - 6, static_cast<const unsigned char *>(is)), pdu) == -1) {
return -1;
}
const unsigned char mac_address[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
p = LibItsGeoNetworking__TestSystem::GeoNetworkingReq(
pdu,
OCTETSTRING(sizeof(mac_address), static_cast<const unsigned char *>(mac_address)),
0);
return 0;
}
/****************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment