Exemple #1
0
        private byte[] GetAndLogHeartBeat()
        {
            var hbMsg = MessageBuilder.BuildHeartBeat(mac);
            var hbHex = BytesUtil.BytesToHexWithSeparator(hbMsg, "-");

            Console.WriteLine($"Time: {DateTime.Now} Mac: {mac} => 发送心跳消息:{hbHex}");
            return(hbMsg);
        }
Exemple #2
0
        protected override void Decode(IChannelHandlerContext context, IByteBuffer input, List <object> output)
        {
            var header = LoraParser.HeaderParse(input);

            Console.WriteLine($"消息头解析结果:fun = {header.FunType}, mac = {header.SrcMac}, content = {BytesUtil.BytesToHexWithSeparator(header.Content,"-")}");
            output.Add(header);
        }