From 844597b5813ff8589de503cd7d7b1bbd0586d287 Mon Sep 17 00:00:00 2001 From: zuoxiao <470321431@qq.com> Date: 星期一, 13 五月 2024 19:38:03 +0800 Subject: [PATCH] 1.添加水量单价 2.修复发现的bug --- qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java b/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java index 9adf95a..f6aa469 100644 --- a/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java +++ b/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java @@ -59,12 +59,16 @@ byte[] data = new byte[16]; data[0] = HexUtil.hexToByte(cardType); - byte[] regionBytes = HexUtil.hexToByteArray(cardData); + byte[] regionBytes = new byte[4]; + byte[] regionDatas = HexUtil.hexToByteArray(cardData); + System.arraycopy(regionDatas, 0, regionBytes, 0, regionDatas.length); if (regionBytes != null) { System.arraycopy(regionBytes, 0, data, 1, regionBytes.length); } - byte[] controllerCodelBytes = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricPrice)); + byte[] controllerCodelBytes = new byte[4]; + byte[] controllerCodelDatas = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricPrice)); + System.arraycopy(controllerCodelDatas, 0, controllerCodelBytes, 0, controllerCodelDatas.length); if (controllerCodelBytes != null) { System.arraycopy(controllerCodelBytes, 0, data, 5, controllerCodelBytes.length); } -- Gitblit v1.8.0