Ejemplo n.º 1
0
 public void Test2()
 {
     IJT808UdpSessionService jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808UdpSessionService>();
     var result1 = jT808SessionServiceDefaultImpl.GetAll();
     var result2 = jT808SessionServiceDefaultImpl.RemoveByTerminalPhoneNo("123456789001");
     var result3 = jT808SessionServiceDefaultImpl.GetAll();
 }
Ejemplo n.º 2
0
        public void Test3()
        {
            // 判断通道是否关闭
            IJT808UdpSessionService jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808UdpSessionService>();
            JT808UdpSessionManager  jT808UdpSessionManager         = ServiceProvider.GetService <JT808UdpSessionManager>();
            var result1 = jT808SessionServiceDefaultImpl.GetAll();

            SimpleUdpClient1.Down();
            var session = jT808UdpSessionManager.GetSession("123456789001");
            var result3 = jT808UdpSessionManager.GetAll();

            Thread.Sleep(100000);
        }
        public void Test1()
        {
            //"126 131 0 0 13 18 52 86 120 144 1 0 11 5 115 109 97 108 108 99 104 105 32 53 49 56 24 126"
            jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808UdpSessionService>();
            jT808UnificationUdpSendService = ServiceProvider.GetService <IJT808UnificationUdpSendService>();
            jT808SessionServiceDefaultImpl.GetAll();
            string no = "123456789001";
            // 文本信息包
            JT808Package jT808Package2 = JT808.Protocol.Enums.JT808MsgId.文本信息下发.Create(no, new JT808_0x8300
            {
                TextFlag = 5,
                TextInfo = "smallchi 518"
            });
            var data = JT808Serializer.Serialize(jT808Package2);
            JT808ResultDto <bool> jt808Result = jT808UnificationUdpSendService.Send(no, data);

            Thread.Sleep(1000);
            Assert.AreEqual(200, jt808Result.Code);
            Assert.IsTrue(jt808Result.Data);
        }
        /// <summary>
        /// 会话服务集合
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public JT808HttpResponse GetUdpSessionAll(JT808HttpRequest request)
        {
            var result = jT808UdpSessionService.GetAll();

            return(CreateJT808HttpResponse(result));
        }
Ejemplo n.º 5
0
 public void Test1()
 {
     IJT808UdpSessionService jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808UdpSessionService>();
     var result = jT808SessionServiceDefaultImpl.GetAll();
 }