|
@@ -2121,6 +2121,8 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
|
|
|
if(line)
|
|
|
free(line);
|
|
|
+
|
|
|
+ ShmOCPP16Data->CSUMsg.bits[(connectorId==0?0:connectorId-1)].ChargingProfileConf = 1;
|
|
|
}
|
|
|
|
|
|
//==========================================
|
|
@@ -2349,7 +2351,6 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16Data->SmartChargingProfile[gun_index]);
|
|
|
ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
|
|
|
- ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf = 1;
|
|
|
}
|
|
|
|
|
|
//==============================================
|
|
@@ -2357,7 +2358,7 @@ void CheckSystemValue(void)
|
|
|
//==============================================
|
|
|
if(/*(server_sign == TRUE) &&*/ (ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq == 1))
|
|
|
{
|
|
|
- ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq =0;
|
|
|
+ ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq = 0;
|
|
|
sendStartTransactionRequest(gun_index);
|
|
|
clientTime.StartTransaction = time((time_t*)NULL);
|
|
|
clientTime.MeterValues[gun_index] = time((time_t*)NULL);
|
|
@@ -2368,7 +2369,7 @@ void CheckSystemValue(void)
|
|
|
//==============================================
|
|
|
if(/*(server_sign == TRUE) &&*/ ((ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq == 1)))
|
|
|
{
|
|
|
- ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq =0;
|
|
|
+ ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = 0;
|
|
|
sendStopTransactionRequest(gun_index);
|
|
|
clientTime.StopTransaction = time((time_t*)NULL);
|
|
|
}
|
|
@@ -3248,7 +3249,7 @@ int sendStartTransactionRequest(int gun_index)
|
|
|
strcpy((char *)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag, "");
|
|
|
strcpy((char *)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.Status, "");
|
|
|
ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId = 0;
|
|
|
-
|
|
|
+ clientTime.MeterValues[gun_index] = time((time_t*)NULL);
|
|
|
//J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DCcc
|
|
|
|
|
|
if(gunType[gun_index] == 'J')
|
|
@@ -3376,7 +3377,7 @@ int sendStartTransactionRequest(int gun_index)
|
|
|
|
|
|
#if 1
|
|
|
sprintf(tempdata, "StartTransaction,%d", (gun_index));
|
|
|
- if(hashmap_operation(0, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, mapItem[0].key_string, mapItem[0].key_value/*mapItem*/, (void**)(&mapItem)/*(void**)(&mapItem)*/) == MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
|
|
|
+ if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, mapItem[0].key_string, mapItem[0].key_value/*mapItem*/, (void**)(&mapItem)/*(void**)(&mapItem)*/) == MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
|
|
|
{
|
|
|
result = PASS;
|
|
|
}
|
|
@@ -3782,7 +3783,7 @@ S_FAULT =12
|
|
|
|
|
|
sprintf(tempdata, "StatusNotification,%d", (gun_index));
|
|
|
|
|
|
- if(hashmap_operation(0, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, guid, mapItem, tempdata/*(void**)(&mapItem)*//*(void**)(&mapItem)*/) == MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
|
|
|
+ if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, guid, mapItem, tempdata/*(void**)(&mapItem)*//*(void**)(&mapItem)*/) == MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
|
|
|
{
|
|
|
//DEBUG_ERROR("statusNotification mapitem pass");
|
|
|
result = PASS;
|
|
@@ -4773,10 +4774,10 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
|
|
|
#if 1
|
|
|
sprintf(tempdata, "StopTransaction,%d", (gun_index));
|
|
|
- if(hashmap_operation(0, guid, tempdata) == 1)
|
|
|
+ if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)
|
|
|
{
|
|
|
- result = PASS;
|
|
|
- DEBUG_INFO("StopTransaction mapitem pass\n");
|
|
|
+ result = PASS;
|
|
|
+ //DEBUG_INFO("StopTransaction mapitem pass\n");
|
|
|
}
|
|
|
#endif
|
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
@@ -4807,9 +4808,10 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
DEBUG_INFO("sendMeterValuesRequest ...\n");
|
|
|
|
|
|
memset(queuedata, 0, ARRAY_SIZE(queuedata));
|
|
|
+ memset(&ShmOCPP16Data->MeterValues[gun_index], 0, sizeof(struct StructMeterValues));
|
|
|
//set value
|
|
|
ShmOCPP16Data->MeterValues[gun_index].ConnectorId = gun_index + 1; // gun start from 1~
|
|
|
- ShmOCPP16Data->MeterValues[gun_index].TransactionId = ((strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "Charging") != NULL) ? ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId : 0);
|
|
|
+ ShmOCPP16Data->MeterValues[gun_index].TransactionId = ((strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "Charging") != NULL) ? ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId : -1);
|
|
|
|
|
|
random_uuid(guid);
|
|
|
|
|
@@ -5443,7 +5445,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Context, ReadingContextStr[ReadingContext_Sample_Periodic]);
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Context, ReadingContextStr[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]);
|
|
@@ -5566,194 +5568,79 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Unit,UnitOfMeasureStr[UnitOfMeasure_V]);
|
|
|
|
|
|
// Message create ====================================================================================================
|
|
|
- if((gunType[gun_index] == 'J')||(gunType[gun_index] == 'U')||(gunType[gun_index] == 'E')||(gunType[gun_index] == 'G')||(gunType[gun_index] == 'O'))
|
|
|
+ if(TRUE)
|
|
|
{
|
|
|
- sprintf(queuedata,"%d,[%d,\"%s\",\"MeterValues\",{\"connectorId\":%d,\"transactionId\":%d,\"meterValue\":[{\"timestamp\":\"%s\",\"sampledValue\":[{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"}]}]}]"
|
|
|
- ,gun_index + 1
|
|
|
- ,MESSAGE_TYPE_CALL
|
|
|
- ,guid
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].ConnectorId
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].TransactionId
|
|
|
- ,(const char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].TimeStamp
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[5].Unit
|
|
|
- );
|
|
|
+ json_object *MeterValueReq = json_object_new_object();
|
|
|
+ json_object *MeterValues = json_object_new_array();
|
|
|
+ json_object *sampledValues = json_object_new_array();
|
|
|
+
|
|
|
+ json_object_object_add(MeterValueReq, "connectorId", json_object_new_int(ShmOCPP16Data->MeterValues[gun_index].ConnectorId));
|
|
|
+
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ json_object *MeterValue = json_object_new_object();
|
|
|
+
|
|
|
+ for(int idxSample=0;idxSample<ARRAY_SIZE(ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue);idxSample++)
|
|
|
+ {
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Value) > 0)
|
|
|
+ {
|
|
|
+ json_object *sampledValue = json_object_new_object();
|
|
|
+
|
|
|
+ json_object_object_add(sampledValue, "value", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Value));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Context) > 0)
|
|
|
+ json_object_object_add(sampledValue, "context", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Context));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Format) > 0)
|
|
|
+ json_object_object_add(sampledValue, "format", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Format));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Measurand) > 0)
|
|
|
+ json_object_object_add(sampledValue, "measurand", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Measurand));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Phase) > 0)
|
|
|
+ json_object_object_add(sampledValue, "phase", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Phase));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Location) > 0)
|
|
|
+ json_object_object_add(sampledValue, "location", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Location));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Unit) > 0)
|
|
|
+ json_object_object_add(sampledValue, "unit", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].SampledValue[idxSample].Unit));
|
|
|
+
|
|
|
+ json_object_array_add(sampledValues, sampledValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+
|
|
|
+ sprintf(queuedata,"%d,[%d,\"%s\",\"MeterValues\",%s]"
|
|
|
+ ,gun_index + 1
|
|
|
+ ,MESSAGE_TYPE_CALL
|
|
|
+ ,guid
|
|
|
+ ,json_object_to_json_string_ext(MeterValueReq, JSON_C_TO_STRING_PLAIN));
|
|
|
+
|
|
|
+ json_object_put(MeterValueReq);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- if((ShmSysConfigAndInfo->SysConfig.ModelName[2] != 'Y') && (ShmSysConfigAndInfo->SysConfig.ModelName[2] != 'W'))
|
|
|
- {
|
|
|
- sprintf(queuedata,"%d,[%d,\"%s\",\"MeterValues\",{\"connectorId\":%d,\"transactionId\":%d,\"meterValue\":[{\"timestamp\":\"%s\",\"sampledValue\":[{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"}]}]}]"
|
|
|
- ,gun_index + 1
|
|
|
- ,MESSAGE_TYPE_CALL
|
|
|
- ,guid
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].ConnectorId
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].TransactionId
|
|
|
- ,(const char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].TimeStamp
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Unit
|
|
|
-
|
|
|
- );
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sprintf(queuedata,"%d,[%d,\"%s\",\"MeterValues\",{\"connectorId\":%d,\"transactionId\":%d,\"meterValue\":[{\"timestamp\":\"%s\",\"sampledValue\":[{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"},{\"value\":\"%s\",\"context\":\"%s\",\"format\":\"%s\",\"measurand\":\"%s\",\"phase\":\"%s\",\"location\":\"%s\",\"unit\":\"%s\"}]}]}]"
|
|
|
- ,gun_index + 1
|
|
|
- ,MESSAGE_TYPE_CALL
|
|
|
- ,guid
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].ConnectorId
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].TransactionId
|
|
|
- ,(const char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].TimeStamp
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[6].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[7].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[8].Unit
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Value
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Context
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Format
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Measurand
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Phase
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Location
|
|
|
- ,ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[9].Unit
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
// Put request guid to hash map
|
|
|
sprintf(tempdata, "MeterValues,%d", (gun_index));
|
|
|
if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, mapItem[0].key_string, mapItem[0].key_value/*mapItem*/, (void**)(&mapItem)/*(void**)(&mapItem)*/) == MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
|
|
|
{
|
|
|
result = PASS;
|
|
|
- DEBUG_INFO("MeterValues mapitem pass\n");
|
|
|
+ //DEBUG_INFO("MeterValues mapitem pass\n");
|
|
|
}
|
|
|
|
|
|
- if(dataType != ReadingContext_Trigger)
|
|
|
- queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );//addq(guid, queuedata); ---> remove temporally
|
|
|
+ if((dataType != ReadingContext_Trigger) &&
|
|
|
+ (dataType != ReadingContext_Sample_Clock) &&
|
|
|
+ (ShmOCPP16Data->MeterValues[gun_index].TransactionId != -1))
|
|
|
+ queue_operation(QUEUE_OPERATION_ADD, guid, queuedata );
|
|
|
else
|
|
|
LWS_Send(queuedata +2);
|
|
|
|
|
@@ -7516,6 +7403,19 @@ int handleClearChargingProfileRequest(char *uuid, char *payload)
|
|
|
}// (connectorIsNULL == FALSE) && (connectorIdInt != 0)
|
|
|
|
|
|
end:
|
|
|
+ if(strcmp(comfirmstr, ClearChargingProfileStatusStr[ClearChargingProfileStatus_Accepted]) == 0)
|
|
|
+ {
|
|
|
+ if(connectorIdInt == 0)
|
|
|
+ {
|
|
|
+ for(uint8_t idx=0;idx<gunTotalNumber;idx++)
|
|
|
+ {
|
|
|
+ checkCompositeSchedule((idx+1), 86400, &ShmOCPP16Data->SmartChargingProfile[idx]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ checkCompositeSchedule(connectorIdInt, 86400, &ShmOCPP16Data->SmartChargingProfile[connectorIdInt-1]);
|
|
|
+ }
|
|
|
+
|
|
|
sendClearChargingProfileConfirmation(uuid, comfirmstr);
|
|
|
|
|
|
return result;
|
|
@@ -7556,7 +7456,8 @@ void createFirmwareVersionByDataTransfer(void)
|
|
|
|
|
|
sprintf((char*)ShmOCPP16Data->DataTransfer[0].VendorId, "Phihong Technology");
|
|
|
sprintf((char*)ShmOCPP16Data->DataTransfer[0].MessageId, "ID_FirmwareVersion");
|
|
|
- sprintf((char*)ShmOCPP16Data->DataTransfer[0].Data, json_object_to_json_string(FirmwareDataTransfer));
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[0].Data, json_object_to_json_string_ext(FirmwareDataTransfer, JSON_C_TO_STRING_PLAIN));
|
|
|
+ json_object_put(FirmwareDataTransfer);
|
|
|
}
|
|
|
|
|
|
int handleDataTransferRequest(char *uuid, char *payload)
|
|
@@ -7599,7 +7500,8 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
createFirmwareVersionByDataTransfer();
|
|
|
json_object_object_add(response, "status", json_object_new_string("Accepted"));
|
|
|
json_object_object_add(response, "data", json_object_new_string((char*)ShmOCPP16Data->DataTransfer[0].Data));
|
|
|
- sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string(response));
|
|
|
+ sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string_ext(response, JSON_C_TO_STRING_PLAIN));
|
|
|
+ json_object_put(response);
|
|
|
}
|
|
|
else if(strstr(tempmessageId, "SetLEDBar") != NULL)
|
|
|
{
|
|
@@ -7628,7 +7530,8 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
}
|
|
|
json_object_put(data);
|
|
|
|
|
|
- sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string(response));
|
|
|
+ sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string_ext(response, JSON_C_TO_STRING_PLAIN));
|
|
|
+ json_object_put(response);
|
|
|
}
|
|
|
else if(strstr(tempmessageId, "SetUserPrice") != NULL)
|
|
|
{
|
|
@@ -7650,6 +7553,8 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
}
|
|
|
json_object_put(data);
|
|
|
+
|
|
|
+ json_object_put(response);
|
|
|
}
|
|
|
else if(strstr(tempmessageId, "RunningCost") != NULL)
|
|
|
{
|
|
@@ -7670,6 +7575,8 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
}
|
|
|
json_object_put(data);
|
|
|
+
|
|
|
+ json_object_put(response);
|
|
|
}
|
|
|
else if(strstr(tempmessageId, "FinalCost") != NULL)
|
|
|
{
|
|
@@ -7691,6 +7598,8 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
}
|
|
|
json_object_put(data);
|
|
|
+
|
|
|
+ json_object_put(response);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -8483,7 +8392,7 @@ int handleRemoteStartRequest(char *uuid, char *payload)
|
|
|
|
|
|
sprintf(cmdBuf, "/Storage/OCPP/TxProfile_%d.json", connectorIdInt);
|
|
|
fp = fopen(cmdBuf, "w");
|
|
|
- fprintf(fp, "{\"connectorId\":%d,\"csChargingProfiles\":%s}\n", connectorIdInt, json_object_to_json_string(json_object_object_get(RemoteStartTransaction, "chargingProfile")));
|
|
|
+ fprintf(fp, "{\"connectorId\":%d,\"csChargingProfiles\":%s}\n", connectorIdInt, json_object_to_json_string_ext(json_object_object_get(RemoteStartTransaction, "chargingProfile"), JSON_C_TO_STRING_PLAIN));
|
|
|
fclose(fp);
|
|
|
}
|
|
|
else
|
|
@@ -10445,6 +10354,19 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
sprintf(comfirmstr, "%s", ChargingProfileStatusStr[ChargingProfileStatus_Accepted] );
|
|
|
|
|
|
end:
|
|
|
+ if(strcmp(comfirmstr, ChargingProfileStatusStr[ChargingProfileStatus_Accepted]) == 0)
|
|
|
+ {
|
|
|
+ if(connectorIdInt == 0)
|
|
|
+ {
|
|
|
+ for(uint8_t idx=0;idx<gunTotalNumber;idx++)
|
|
|
+ {
|
|
|
+ checkCompositeSchedule((idx+1), 86400, &ShmOCPP16Data->SmartChargingProfile[idx]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ checkCompositeSchedule(connectorIdInt, 86400, &ShmOCPP16Data->SmartChargingProfile[connectorIdInt-1]);
|
|
|
+ }
|
|
|
+
|
|
|
sendSetChargingProfileConfirmation(uuid, comfirmstr);
|
|
|
return result;
|
|
|
}
|
|
@@ -11890,7 +11812,7 @@ int initialConfigurationTable(void)
|
|
|
// MaxChargingProfilesInstalled
|
|
|
ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemAccessibility = 0;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemName, "MaxChargingProfilesInstalled");
|
|
|
- strcpy((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "5" );
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "10" );
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","MaxChargingProfilesInstalled", "true", ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData);
|
|
|
|
|
@@ -12730,7 +12652,7 @@ void StoreConfigurationTable(void)
|
|
|
/*
|
|
|
ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemAccessibility = 0;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemName, "MaxChargingProfilesInstalled");
|
|
|
- strcpy((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "3" );
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "10" );
|
|
|
*/
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","MaxChargingProfilesInstalled", "true", (char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData);
|
|
@@ -14750,7 +14672,6 @@ int setKeyValue(char *key, char *value)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
-
|
|
|
sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "%d", atoi(value) );
|
|
|
isSuccess = ConfigurationStatus_Accepted;
|
|
|
}
|
|
@@ -15392,14 +15313,14 @@ int GetTransactionId(int gunindex, unsigned char idTag[], uint8_t isStopTransact
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
- char *revbuf[8] = {0}; //存放分割後的子字串
|
|
|
- int num = 0;//分割後子字串的個數
|
|
|
- DEBUG_INFO("str: %s\n", str);
|
|
|
- splitstring(str,",",revbuf,&num); //呼叫函式進行分割
|
|
|
- DEBUG_INFO("revbuf[0]: %s\n", revbuf[0]);
|
|
|
- DEBUG_INFO("revbuf[1]: %s\n", revbuf[1]);
|
|
|
- DEBUG_INFO("revbuf[2]: %s\n", revbuf[2]);
|
|
|
-
|
|
|
+ char *revbuf[8] = {0}; // Variable store string split
|
|
|
+ int num = 0;// Quantity after string split
|
|
|
+ DEBUG_INFO("Transaction queue data= %s\n", str);
|
|
|
+ splitstring(str,",",revbuf,&num); // String split
|
|
|
+ DEBUG_INFO(" revbuf[0]= %s\n", revbuf[0]);
|
|
|
+ DEBUG_INFO(" revbuf[1]= %s\n", revbuf[1]);
|
|
|
+ DEBUG_INFO(" revbuf[2]= %s\n", revbuf[2]);
|
|
|
+ DEBUG_INFO("------------------------------\n");
|
|
|
if((revbuf[1][0] != '\0')&&(revbuf[2][0] != '\0'))
|
|
|
{
|
|
|
if(isStopTransaction)
|
|
@@ -16545,7 +16466,7 @@ void checkTempStopTransaction(int gun_index)
|
|
|
sprintf(tempdata, "StopTransaction,%d", (gun_index));
|
|
|
if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)
|
|
|
{
|
|
|
- DEBUG_INFO("StopTransaction mapitem pass\n");
|
|
|
+ //DEBUG_INFO("StopTransaction mapitem pass\n");
|
|
|
}
|
|
|
queue_operation(QUEUE_OPERATION_ADD, guid, str);//addq(guid, queuedata); ---> remove temporally
|
|
|
|