| | |
| | | |
| | | setDestinationAddress(hex.substring(8, 16)); |
| | | |
| | | String heartBeatData = hex.substring(16, hex.length() - 8); |
| | | String heartBeatData = hex.substring(8, hex.length() - 8); |
| | | HeartBeatDataPackage heartBeatDataPackage = new HeartBeatDataPackage(); |
| | | heartBeatDataPackage.transformFrame(heartBeatData); |
| | | setHeartBeatDataPackage(heartBeatDataPackage); |
| | |
| | | if (StrUtil.isBlank(hex)) { |
| | | return null; |
| | | } |
| | | this.year = hex.substring(0, 2); |
| | | this.month = hex.substring(2, 4); |
| | | this.day = hex.substring(4, 6); |
| | | this.hour = hex.substring(6, 8); |
| | | this.min = hex.substring(8, 10); |
| | | this.sec = hex.substring(10, 12); |
| | | this.chargingPort = hex.substring(12, 16); |
| | | this.statusBit = hex.substring(16, 18); |
| | | this.deviceTemperature = hex.substring(18, 22); |
| | | this.gridVoltage = hex.substring(22, 26); |
| | | this.gridCurrent = hex.substring(26, 30); |
| | | this.frequency = hex.substring(30, 34); |
| | | this.powerFactor = hex.substring(34, 38); |
| | | this.activePower = hex.substring(38, 42); |
| | | this.reactivePower = hex.substring(42, 46); |
| | | this.chargedCapacity = hex.substring(46, 50); |
| | | this.reservedCapacity = hex.substring(50, 54); |
| | | this.remainingAmount = hex.substring(54, 58); |
| | | this.alreadyChargingTime = hex.substring(58, 64); |
| | | this.c3Mac = hex.substring(0, 8); |
| | | this.year = hex.substring(8, 10); |
| | | this.month = hex.substring(10, 12); |
| | | this.day = hex.substring(12, 14); |
| | | this.hour = hex.substring(14, 16); |
| | | this.min = hex.substring(16, 18); |
| | | this.sec = hex.substring(18, 20); |
| | | this.chargingPort = hex.substring(20, 24); |
| | | this.statusBit = hex.substring(24, 26); |
| | | this.deviceTemperature = hex.substring(26, 30); |
| | | this.gridVoltage = hex.substring(30, 34); |
| | | this.gridCurrent = hex.substring(34, 38); |
| | | this.frequency = hex.substring(38, 42); |
| | | this.powerFactor = hex.substring(42, 46); |
| | | this.activePower = hex.substring(46, 50); |
| | | this.reactivePower = hex.substring(50, 54); |
| | | this.chargedCapacity = hex.substring(54, 58); |
| | | this.reservedCapacity = hex.substring(58, 62); |
| | | this.remainingAmount = hex.substring(62, 66); |
| | | this.alreadyChargingTime = hex.substring(66, 72); |
| | | |
| | | return this; |
| | | } |