riku
6 天以前 20b8d870efbbb89564b599561fc69202ba41223f
src/test/kotlin/com/flightfeather/uav/socket/UnderwayProcessorTest.kt
@@ -6,6 +6,9 @@
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import java.io.File
import java.nio.file.Files
import java.nio.file.Paths
/**
 * @author riku
@@ -20,7 +23,19 @@
    @Test
    fun bccCheck() {
        val s = "23 23 2 31 37 36 39 31 35 33 31 39 30 39 31 32 30 30 30 36 1 1 0 42 13 9 f 12 34 8 2 0 8b 1c 0 d8 0 0 12 d8 9 6c 0 c8 0 b4 0 0 66 0 0 0 0 0 0 73 0 0 0 b9 4 32 0 2e d8 c4 0 0 0 0 80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f6"
        println(messageManager.bccCheck(s))
        listOf(
            "01 04 0a 00 00 00 00 01 12 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 00 0c",
            "01 05 0a 00 00 00 00 01 52 00 05 af 00 cb f7 03 45 84 02 a1 65 00 71 92 01 ec 04 00 b7 9b 01 6e 0f 00 aa 9c 01 6b c4 00 0c 00 00 0d 00 00 1b 10 00 34 08 05 d3 1c 05 d4 7f 00 00 00 00 00 00 56 00 00 00 00 45 00 00 00 00 4e 00 00 00 50 01 06 08 0c 29 00 00 00 00 00 00 00 00 00 64"
        ).forEach {
            messageManager.dealStringMsg(it, null)
        }
//        println(messageManager.bccCheck(s))
//        val lines = Files.readAllLines(Paths.get("C:\\Users\\feiyu\\Desktop\\data-2026-04-10-10-03-14.txt"))
//        println("数据量:${lines.size - 1}")
//        lines.forEach {
//            val msg = it.split("data=> ")[1]
//            messageManager.dealStringMsg(msg, null)
//            Thread.sleep(4000)
//        }
    }
}