public void BuildingMsgsTest()
        {
            ushort sUser = 34;

            byte[] user = BitConverter.GetBytes(UInt16.Parse(sUser.ToString()));
            Array.Reverse(user);

            ConfigurationManager cfgMan = new ConfigurationManager();

            cfgMan.Get((cfg) => {
                // Enviar una trama Ini a TWR
                var twr = cfg.Dependencies.Where(d => d.Id == "TWR").FirstOrDefault();
                var msg = SactaMsg.MsgToScv(twr, SactaMsg.MsgType.Init, 0, 0).Serialize();

                //var to = new IPEndPoint(IPAddress.Parse(twr.Comm.Listen.Lan1.Ip), twr.Comm.Listen.Port);
                //var Sender = new UdpSocket(9000);
                //Sender.Send(to, msg);
            });
        }
Beispiel #2
0
        public void TestMethod1()
        {
            var app = new SactaProxy(false);

            app.StartOnConsole(null);

            ConfigurationManager cfgMan = new ConfigurationManager();

            cfgMan.Get((cfg) => {
                // Enviar una trama Ini a TWR
                var twr    = cfg.Dependencies.Where(d => d.Id == "TWR").FirstOrDefault();
                var msg    = SactaMsg.MsgToScv(twr, SactaMsg.MsgType.Init, 0, 0).Serialize();
                var to     = new IPEndPoint(IPAddress.Parse(twr.Comm.If1.Ip), twr.Comm.ListenPort);
                var Sender = new UdpSocket(9000);

                Sender.Send(to, msg);
            });

            Task.Delay(TimeSpan.FromSeconds(1000)).Wait();
            app.StopOnConsole();
        }