Compare commits
2 Commits
177350830a
...
e4d07a5306
| Author | SHA1 | Date | |
|---|---|---|---|
| e4d07a5306 | |||
| 4cd520ab78 |
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
@@ -435,12 +435,23 @@ pipeline {
|
||||
// 辅助函数
|
||||
// ============================================
|
||||
|
||||
// 获取变更的文件列表
|
||||
// 获取变更的文件列表(对比上次成功构建,支持多 commit)
|
||||
def getChangedFiles() {
|
||||
def changedFiles = sh(
|
||||
script: '''
|
||||
PREV=$(git rev-parse HEAD~1 2>/dev/null || echo "")
|
||||
[ -z "$PREV" ] && echo "all" || git diff --name-only $PREV HEAD
|
||||
# 优先使用上次成功构建的 commit
|
||||
if [ -n "$GIT_PREVIOUS_SUCCESSFUL_COMMIT" ]; then
|
||||
PREV="$GIT_PREVIOUS_SUCCESSFUL_COMMIT"
|
||||
else
|
||||
# 回退到 origin/master(如果有)
|
||||
PREV=$(git rev-parse origin/master 2>/dev/null || git rev-parse HEAD~1 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
if [ -z "$PREV" ]; then
|
||||
echo "all"
|
||||
else
|
||||
git diff --name-only $PREV HEAD
|
||||
fi
|
||||
''',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
@@ -56,18 +56,16 @@ public class Jt808Decoder {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (expectedBodyLength > actualAvailableLength) {
|
||||
log.warn("[bytes2PackageData][消息体长度不匹配: 头部声明={}, 实际可用={}, 数据总长度={}, 消息ID=0x{}]",
|
||||
expectedBodyLength, actualAvailableLength, data.length,
|
||||
// 使用实际可用的长度处理(兼容设备端长度计算不准确的情况)
|
||||
int actualBodyLength = Math.min(expectedBodyLength, actualAvailableLength);
|
||||
if (expectedBodyLength != actualAvailableLength) {
|
||||
log.debug("[bytes2PackageData][消息体长度差异: 头部声明={}, 实际可用={}, 使用={}, 消息ID=0x{}]",
|
||||
expectedBodyLength, actualAvailableLength, actualBodyLength,
|
||||
Integer.toHexString(msgHeader.getId()));
|
||||
// 使用 null 标记长度不匹配(区别于合法的空消息体如心跳)
|
||||
ret.setBodyBytes(null);
|
||||
ret.setCheckSum(data[data.length - 1]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
byte[] bodyBytes = new byte[msgHeader.getBodyLength()];
|
||||
System.arraycopy(data, msgBodyByteStartIndex, bodyBytes, 0, bodyBytes.length);
|
||||
byte[] bodyBytes = new byte[actualBodyLength];
|
||||
System.arraycopy(data, msgBodyByteStartIndex, bodyBytes, 0, actualBodyLength);
|
||||
ret.setBodyBytes(bodyBytes);
|
||||
|
||||
// 3. 解析校验码
|
||||
|
||||
Reference in New Issue
Block a user