From 69596fa400a09f476bac75c5ec0d2587d56dc18b Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 29 Nov 2021 02:30:20 +0300 Subject: p18: fix serial number parsing in get-p-rated --- src/p18/response.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/p18') diff --git a/src/p18/response.cc b/src/p18/response.cc index 0239b2d..453272c 100644 --- a/src/p18/response.cc +++ b/src/p18/response.cc @@ -658,7 +658,7 @@ void ParallelRatedInformation::unpack() { parallel_id_connection_status = static_cast(stou(list[0])); serial_number_valid_length = stou(list[1]); - serial_number = std::string(list[2], serial_number_valid_length); + serial_number = std::string(list[2], 0, serial_number_valid_length); charger_source_priority = static_cast(stou(list[3])); max_charging_current = stou(list[4]); max_ac_charging_current = stou(list[5]); -- cgit v1.2.3