| | |
| | | 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.deviceTemperature = (parseVal(hex, 26, 28) + "." + parseVal(hex, 28, 30)); |
| | | this.gridVoltage = hex.substring(30, 34); |
| | | this.gridCurrent = hex.substring(34, 38); |
| | | this.frequency = hex.substring(38, 42); |
| | |
| | | |
| | | return this; |
| | | } |
| | | |
| | | private Integer parseVal(String frame, int start, int end) { |
| | | return Integer.parseInt(frame.substring(start, end), 16); |
| | | } |
| | | } |
| | | } |