private byte[] GetAndLogHeartBeat() { var hbMsg = MessageBuilder.BuildHeartBeat(mac); var hbHex = BytesUtil.BytesToHexWithSeparator(hbMsg, "-"); Console.WriteLine($"Time: {DateTime.Now} Mac: {mac} => 发送心跳消息:{hbHex}"); return(hbMsg); }
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); }