Ejemplo n.º 1
0
        public static void setMac(String mac)
        {
            long macL = long.Parse(mac.Replace(":", ""), System.Globalization.NumberStyles.HexNumber);

            DataStruct data = new DataStruct();

            data.type   = DataStruct.macIdType1;
            data.length = 0x06;
            data.data   = new byte[data.length];

            for (int i = 0; i < 6; i++)
            {
                data.data[i] = (byte)((macL >> ((5 - i) * 8)) & 0xff);
            }

            dataList.Add(data);
        }
Ejemplo n.º 2
0
        public static void parseFileData()
        {
            int index = 0;

            while (true)
            {
                if (recvData[index] == 0)
                {
                    break;
                }

                DataStruct ds = new DataStruct();
                ds.type   = recvData[index++];
                ds.length = (short)(recvData[index++] | (recvData[index++] << 8));
                ds.data   = new byte[ds.length];
                for (int i = 0; i < ds.length; i++)
                {
                    ds.data[i] = recvData[index++];
                }

                fileDataList.Add(ds);
            }
        }