Exemplo n.º 1
0
        public void Test1()
        {
            JT808_0x8001 jT808_0X8001 = new JT808_0x8001();

            jT808_0X8001.JT808PlatformResult = Enums.JT808PlatformResult.成功;
            jT808_0X8001.MsgId  = 999;
            jT808_0X8001.MsgNum = 123;
        }
Exemplo n.º 2
0
        public void Test2()
        {
            var          bytes        = "7E 80 01 00 05 01 23 45 67 89 00 00 0A 00 64 02 00 00 61 7E".ToHexBytes();
            JT808Package jT808Package = JT808Serializer.Deserialize <JT808Package>(bytes);

            Assert.Equal(Enums.JT808MsgId.平台通用应答.ToUInt16Value(), jT808Package.Header.MsgId);
            Assert.Equal(10, jT808Package.Header.MsgNum);
            Assert.Equal("12345678900", jT808Package.Header.TerminalPhoneNo);

            JT808_0x8001 JT808Bodies = (JT808_0x8001)jT808Package.Bodies;

            Assert.Equal(Enums.JT808MsgId.位置信息汇报.ToUInt16Value(), JT808Bodies.AckMsgId);
            Assert.Equal(100, JT808Bodies.MsgNum);
            Assert.Equal(Enums.JT808PlatformResult.成功, JT808Bodies.JT808PlatformResult);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 平台通用应答
        /// </summary>
        /// <returns></returns>
        public byte[] Response(string phoneno)
        {
            JT808Package jT808Package = new JT808Package();

            jT808Package.Header = new JT808Header
            {
                MsgId           = JT808MsgId.平台通用应答.ToUInt16Value(),
                MsgNum          = 126,
                TerminalPhoneNo = phoneno
            };

            JT808_0x8001 jT808_0x0200 = new JT808_0x8001
            {
                MsgNum = 126,
                MsgId  = JT808MsgId.平台通用应答.ToUInt16Value(),
                JT808PlatformResult = JT808PlatformResult.成功
            };

            jT808Package.Bodies = jT808_0x0200;

            return(_JT808Serializer.Serialize(jT808Package));
        }