|
@@ -5479,7 +5479,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Format, ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Measurand, MeasurandStr[SoC]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Phase, PhaseStr[L3_N]);
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Location, LocationStr[Location_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Location, LocationStr[Location_EV]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Unit,UnitOfMeasureStr[UnitOfMeasure_Percent]);
|
|
|
}
|
|
|
|
|
@@ -5609,8 +5609,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
if(ShmOCPP16Data->MeterValues[gun_index].TransactionId != -1)
|
|
|
json_object_object_add(MeterValueReq, "transactionId", json_object_new_int(ShmOCPP16Data->MeterValues[gun_index].TransactionId));
|
|
|
|
|
|
- uint8_t idxMeter = 0;
|
|
|
- while(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].TimeStamp) > 0)
|
|
|
+ for(uint8_t idxMeter=0;idxMeter<ARRAY_SIZE(ShmOCPP16Data->MeterValues[gun_index].MeterValue);idxMeter++)
|
|
|
{
|
|
|
json_object *MeterValue = json_object_new_object();
|
|
|
|
|
@@ -5646,7 +5645,6 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
json_object_object_add(MeterValue, "timestamp", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].TimeStamp));
|
|
|
json_object_object_add(MeterValue, "sampledValue", sampledValues);
|
|
|
json_object_array_add(MeterValues, MeterValue);
|
|
|
- idxMeter++;
|
|
|
}
|
|
|
json_object_object_add(MeterValueReq, "meterValue", MeterValues);
|
|
|
|
|
@@ -5657,7 +5655,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
,json_object_to_json_string_ext(MeterValueReq, JSON_C_TO_STRING_PLAIN));
|
|
|
|
|
|
json_object_put(MeterValueReq);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
// Put request guid to hash map
|
|
|
sprintf(tempdata, "MeterValues,%d", (gun_index));
|