!17 根据GBT27930解析中止原因

* Merge branch 'feat_0x1d' into develop
* 删除main方法; 添加单元测试
* Merge branch 'feat_0x1d' into develop
* 根据GBT27930解析中止原因
This commit is contained in:
2025-08-07 13:16:16 +00:00
committed by 三丙
parent 3f4bb375a0
commit 35ea634f9d
2 changed files with 201 additions and 29 deletions

View File

@@ -0,0 +1,33 @@
package sanbing.jcpp.protocol.yunkuaichong.v150;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
import sanbing.jcpp.protocol.yunkuaichong.v150.cmd.YunKuaiChongV150BmsAbortULCmd;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
public class BmsAbortULCmdTest {
@Test
public void test() {
YunKuaiChongV150BmsAbortULCmd bmsAbortULCmd = new YunKuaiChongV150BmsAbortULCmd();
/*
解析中止原因
0x05 -> 00000101
*/
System.out.println("BMS中止充电原因: " + bmsAbortULCmd.parseAbortReasons((byte) 0x05));
/*
解析故障原因
0x0005 -> 00000000 00000101
*/
System.out.println("BMS中止充电故障原因: " + bmsAbortULCmd.parseFaultReasons(new byte[]{(byte)0x00, (byte)0x05}));
/*
解析错误原因
0x01 -> 00000001
*/
System.out.println("BMS中止充电错误原因: " + bmsAbortULCmd.parseErrorReasons((byte) 0x01));
}
}