private DevAddr UnmarshalDevAddr(byte[] devaddr) { var returnvalue = new DevAddr(); returnvalue.NwkId = (byte)(devaddr[0] >> 1); devaddr[0] = (byte)(devaddr[0] & 1); returnvalue.NwkAddr = BitConverter.ToUInt32(devaddr, 0); return(returnvalue); }
public byte[] MarshalDevAddr(DevAddr devaddr) { return(BitConverter.GetBytes(Convert.ToUInt32((devaddr.NwkId * 16777216) + devaddr.NwkAddr))); }