• 大小: 1.37M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 物联网  联网  开发  

资源简介

JT808-Server 是基于Netty和Spring Boot框架,实现了JT/T 808部标协议的服务端程序;


在网上看到Azure团队开源的DotNetty框架,一时兴起写了个基于DotNetty的Tcp Server Demo 
解析了JT808的部分指令,应答部分暂时未弄完,代码写的比较随意请不要在意。

部分代码参考了java版本的jt808协议解析 https://github.com/hylexus/jt-808-protocol

感慨JAVA强大的同时,还是喜欢C#强大的语法,希望.net core发展越来越好

直接运行程序,端口默认9623(在Main方法里面修改),可以使用网络调试助手联调(Tool\NetAssist.exe)


资源截图

代码片段和文件信息

using DataGateway.gps.server;
using DataGateway.GPS.JT808.Util;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Extensions.Logging.Console;
using System;
using System.Collections.Concurrent;
using System.Text;
using System.Threading.Tasks;

namespace DataGateway
{
    class Program
    {
        private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();

        static void Main(string[] args)
        { 
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            //注册GBK编码后面的解析 Btye[] 转String需要用到
            //Console.WriteLine(Encoding.GetEncoding(“GBK“));
            DataServer jt808ser

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-15 14:35  JT808-Server-master\
     文件          11  2018-05-15 14:35  JT808-Server-master\.gitignore
     目录           0  2018-05-15 14:35  JT808-Server-master\.vs\
     目录           0  2018-05-15 14:35  JT808-Server-master\.vs\JT808DataServer\
     目录           0  2018-05-15 14:35  JT808-Server-master\.vs\JT808DataServer\v15\
     文件       20992  2018-05-15 14:35  JT808-Server-master\.vs\JT808DataServer\v15\.suo
     目录           0  2018-05-15 14:35  JT808-Server-master\.vs\JT808DataServer\v15\sqlite3\
     文件      782336  2018-05-15 14:35  JT808-Server-master\.vs\JT808DataServer\v15\sqlite3\storage.ide
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\Common\
     文件       27220  2018-05-15 14:35  JT808-Server-master\DataGateway\Common\ByteBuffer.cs
     文件         493  2018-05-15 14:35  JT808-Server-master\DataGateway\Common\DateTimeEx.cs
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Codec\
     文件        9739  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Codec\JT808Decoder.cs
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Constant\
     文件        2338  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Constant\JT808Constant.cs
     文件         727  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Constant\MessageResult.cs
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Data\
     文件        2590  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Data\LocationInfo.cs
     文件        1391  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Data\TerminalRegInfo.cs
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Handler\
     文件        2908  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Handler\JT808ProInHandler.cs
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Messages\
     文件         753  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Messages\JT808Message.cs
     文件         886  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Messages\JT808MessageBodyAttr.cs
     文件        1063  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Messages\JT808MessageHead.cs
     文件         435  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Messages\MessageSplitInfo.cs
     目录           0  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Model\
     文件        1288  2018-05-15 14:35  JT808-Server-master\DataGateway\GPS\JT808\Model\CommonPlatformResp.cs
............此处省略96个文件信息

评论

共有 条评论