private static byte[] GetHdlcAddressBytes(int value, byte size)
{
Object tmp = GetHhlcAddress(value, size);
GXByteBuffer bb = new GXByteBuffer();
if (tmp is byte)
{
bb.SetUInt8((byte)tmp);
}
else if (tmp is UInt16)
{
bb.SetUInt16((UInt16)tmp);
}
else if (tmp is UInt32)
{
bb.SetUInt32((UInt32)tmp);
}
else
{
throw new ArgumentException("Invalid address type.");
}
return bb.Array();
}