From 635d762aef37b5de6cd2e34f4a076ab56d9a239d Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 11 四月 2025 17:35:11 +0800 Subject: [PATCH] 1. 添加自动输出接口API文档功能 --- src/main/kotlin/com/flightfeather/uav/socket/ServerHandler.kt | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/socket/ServerHandler.kt b/src/main/kotlin/com/flightfeather/uav/socket/ServerHandler.kt index d08948c..61a2d8c 100644 --- a/src/main/kotlin/com/flightfeather/uav/socket/ServerHandler.kt +++ b/src/main/kotlin/com/flightfeather/uav/socket/ServerHandler.kt @@ -4,6 +4,7 @@ import io.netty.channel.ChannelHandlerContext import io.netty.channel.ChannelInboundHandlerAdapter import io.netty.util.AttributeKey +import org.ietf.jgss.MessageProp import java.lang.StringBuilder import java.text.SimpleDateFormat import java.util.* @@ -57,7 +58,12 @@ println(str) + if (str == "01 04 00 00 00 00 00 00 00 00 00") { + ctx?.writeAndFlush("trigger") + return + } if (str.isNotEmpty()) { + ctx?.writeAndFlush("data") processor.dealStringMsg(str, ctx) } } @@ -71,6 +77,7 @@ super.channelInactive(ctx) } + @Deprecated("Deprecated in Java") override fun exceptionCaught(ctx: ChannelHandlerContext?, cause: Throwable?) { cause?.printStackTrace() ctx?.close() -- Gitblit v1.9.3