From 879378a9a2e73278dc822c97f8d1dda589919b6d Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 21 五月 2021 17:36:44 +0800 Subject: [PATCH] 1. 根据新的协议,扩展了设备编号的位数从1位至6位; 2. 新增监测因子无人机高度; --- src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt b/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt index a5ffbd5..3290fa7 100644 --- a/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt +++ b/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt @@ -89,10 +89,10 @@ } FactorType.TIME -> { val year = b[i].toInt(16).toString().run { numberFormat(this) } - val month = b[i+1].toInt(16).toString().run { numberFormat(this) } - val day = b[i+2].toInt(16).toString().run { numberFormat(this) } - val hour = b[i+3].toInt(16).toString().run { numberFormat(this) } - val minute = b[i+4].toInt(16).toString().run { numberFormat(this) } + val month = b[i + 1].toInt(16).toString().run { numberFormat(this) } + val day = b[i + 2].toInt(16).toString().run { numberFormat(this) } + val hour = b[i + 3].toInt(16).toString().run { numberFormat(this) } + val minute = b[i + 4].toInt(16).toString().run { numberFormat(this) } val second = b[i + 5].toInt(16).toString().run { numberFormat(this) } val date = "20$year-$month-$day $hour:$minute:$second" val time = SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(date).time -- Gitblit v1.9.3