| | |
| | | package udpdell; |
| | | |
| | | import java.io.IOException; |
| | | import java.net.DatagramPacket; |
| | | import java.net.DatagramSocket; |
| | |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | import Mqttmessage.Client; |
| | | import gecaoji.Device; |
| | | import zhuye.Coordinate; |
| | | |
| | | import publicway.Gpstoxuzuobiao; |
| | | |
| | | public class UDPServer { |
| | |
| | | thread.setDaemon(false); // 保持 JVM 持续存活 |
| | | thread.start(); |
| | | serverThread = thread; |
| | | // Client.test(); |
| | | return thread; |
| | | } |
| | | |
| | |
| | | |
| | | /** 处理串口接收到的数据 */ |
| | | public static void processSerialData(String message) { |
| | | message=message.replace("GPGGA", "GNGGA"); |
| | | String[] fields = message.split(","); |
| | | // 检查字段数量是否完整 |
| | | if (fields.length < 15) { |