Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //RTPHeader header = new RTPHeader();
            //header.Version = 2;
            //header.PaddingFlag = 0;
            //header.HeaderExtensionFlag = 0;
            //header.CSRCCount = 0;
            //header.MarkerBit = 1;
            //header.PayloadType = 8;
            //header.SequenceNumber = 1;
            //header.HeaderExtensionFlag = 0;
            //header.Timestamp = 320;
            //header.SyncSource = 0x0857;
            //header.GetBytes();
            //packet.Header = header;
            //packet.Payload = buffer;

            // string viaStr = via.ToString();

            Console.WriteLine("");

            //Register re = new Register()
            //{
            //    CmdType = CommandType.Catalog,
            //    SN = 1,
            //    SumNum = 3,
            //    DeviceID = "34020000002000000001"
            //};
            //re.DeviceList = new Register.DevList()
            //{
            //    Num = 3
            //};
            //re.DeviceList.Item.Add(new Register.Items()
            //{
            //    DeviceID = "34020000001310000001",
            //    Event = "OFF"
            //});

            //re.DeviceList.Item.Add(
            //new Register.Items()
            //{
            //    DeviceID = "34020000001340000001",
            //    Event = "OFF"
            //});
            //re.DeviceList.Item.Add(new Register.Items()
            //{
            //    DeviceID = "34020000001370000001",
            //    Event = "OFF"
            //});
            //string body = Register.Instance.Save<Register>(re);
            //DateTime begin = new DateTime(2018, 1, 11, 9, 55, 24);
            //DateTime end = new DateTime(2018, 1, 8, 14, 15, 28);
            //uint start = TimeConvert.DateToTimeStamp(begin);
            //uint stop = TimeConvert.DateToTimeStamp(end);
            //int ssrc=24567;
            //string ffffff = "y=0" + ssrc.ToString("D9");
            //int aa = 1474127777;
            //int bb = aa.ToString().Length;
            //string str = "0" + aa.ToString("D9");
            ////t=
            uint     time  = 1516084912;
            uint     end   = 1516085076;
            DateTime start = TimeConvert.TimeStampToDate(time);
            DateTime stop  = TimeConvert.TimeStampToDate(end);
            //int a = 0xfc;
            //byte[] buffer = BitConverter.GetBytes(a);
            //buffer = BitConverter.GetBytes(System.Net.IPAddress.HostToNetworkOrder((short)a));
            /// test();
            //DeviceConfig config = new DeviceConfig()
            //{
            //    CommandType = CommandType.DeviceControl,
            //    DeviceID = "123",
            //    SN = new Random().Next(1, ushort.MaxValue),
            //    BasicParam = new DeviceParam()
            //    {
            //        Name = "test",
            //        Expiration = 1,
            //        HeartBeatInterval = 1,
            //        HeartBeatCount = 1
            //    }
            //};
            //string xmlBody = GB28181.SIPSorcery.Sys.XML.DeviceConfig.Instance.Save<DeviceConfig>(config);
        }