|
@@ -487,11 +487,11 @@ static int qrCodeUrlInfoHandle(uint8_t *data)
|
|
|
tm->tm_mday,
|
|
|
tm->tm_hour,
|
|
|
tm->tm_min);
|
|
|
-
|
|
|
+ memset(pSysConfig->SystemId, '\0', sizeof(pSysConfig->SystemId));
|
|
|
+ string2ByteArray((char *)data, (uint8_t *)pSysConfig->SystemId);
|
|
|
+ //log_info("Data = %s SystemId = %s",data, pSysConfig->SystemId);
|
|
|
//copy QR code string
|
|
|
if (strncmp((char *)localTime, (char *)&data[0], timeLen - 2) != 0) {
|
|
|
- memset(pSysConfig->SystemId, '\0', sizeof(pSysConfig->SystemId));
|
|
|
-
|
|
|
// 充電槍IDLE時才更新系統時間
|
|
|
for (int i = 0; i < pSysConfig->TotalConnectorCount; i++) {
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(i);
|
|
@@ -499,9 +499,8 @@ static int qrCodeUrlInfoHandle(uint8_t *data)
|
|
|
is_idle = FALSE;
|
|
|
}
|
|
|
|
|
|
- string2ByteArray((char *)data, (uint8_t *)pSysConfig->SystemId);
|
|
|
string2Date((char*)data, (uint8_t*)_setTime);
|
|
|
- //printf("SystemId = %s", pSysConfig->SystemId);
|
|
|
+ //printf("SystemId = %s", pSysConfig->SystemId);
|
|
|
if (!timecmp(localTime, _setTime) && is_idle) {
|
|
|
//log_info("Set Timer:%s", _setTime);
|
|
|
sprintf((char*)cmdBuf, "date -u -s \"%s\" >> /dev/null &", _setTime);
|
|
@@ -741,11 +740,15 @@ static int miscCommandHandle(uint8_t dataLen, uint8_t plugNum, uint8_t *data)
|
|
|
|
|
|
//pSysInfo->CurGunSelected = (plugNum);
|
|
|
//pSysInfo->CurGunSelectedByAc = NO_DEFINE;
|
|
|
-
|
|
|
+ if (ShmDcCommonData->pGunInfo[plugNum].ParkingStatus) {
|
|
|
+ log_info("Gun%d is in the Parking status can't access Remote Start",plugNum);
|
|
|
+ break;
|
|
|
+ }
|
|
|
setConfirmSelGun(plugNum);
|
|
|
|
|
|
ShmOCPP16Data->CsMsg.bits[plugNum].RemoteStartTransactionReq = YES;
|
|
|
ShmSelectGunInfo->PricesInfo[plugNum].Balance = 0.00;
|
|
|
+
|
|
|
clearMiscCommand();
|
|
|
break;
|
|
|
|
|
@@ -945,12 +948,12 @@ static int chargingbillHandle(uint8_t* data, uint8_t gunIndex)
|
|
|
ShmDcCommonData->PriceBill.ParkingFee = transPricesUnit(ntohl(pBillInfo->ParkingFee));
|
|
|
pBillInfo->RemainAmount = ntohl(pBillInfo->RemainAmount);
|
|
|
memcpy((char*)&ShmDcCommonData->PriceBill.RemainAmount, (char*)&pBillInfo->RemainAmount, sizeof(uint32_t));
|
|
|
- log_info("\t ******* TxId %d Charging Bill *******\n", ShmDcCommonData->PriceBill.TransactionId);
|
|
|
- log_info("\t Total Cost = %.2f\n", ShmDcCommonData->PriceBill.TotalCost);
|
|
|
- log_info("\t Discount = %.2f\n", ShmDcCommonData->PriceBill.Discount);
|
|
|
- log_info("\t EnergyCost = %.2f\n", ShmDcCommonData->PriceBill.EnergyCost);
|
|
|
- log_info("\t ParkingFee = %.2f\n", ShmDcCommonData->PriceBill.ParkingFee);
|
|
|
- log_info("\t RemainAmount = %.2f\n", ShmDcCommonData->PriceBill.RemainAmount);
|
|
|
+ log_info("\t ******* TxId %d Charging Bill *******", ShmDcCommonData->PriceBill.TransactionId);
|
|
|
+ log_info("\t Total Cost = %.2f", ShmDcCommonData->PriceBill.TotalCost);
|
|
|
+ log_info("\t Discount = %.2f", ShmDcCommonData->PriceBill.Discount);
|
|
|
+ log_info("\t EnergyCost = %.2f", ShmDcCommonData->PriceBill.EnergyCost);
|
|
|
+ log_info("\t ParkingFee = %.2f", ShmDcCommonData->PriceBill.ParkingFee);
|
|
|
+ log_info("\t RemainAmount = %.2f", ShmDcCommonData->PriceBill.RemainAmount);
|
|
|
if (ShmDcCommonData->PriceBill.TransactionId != ShmDcCommonData->TransactionInfo[gunIndex].TransactionId)
|
|
|
UpdateRedeuctBill(ShmDcCommonData->PriceBill.TransactionId, ShmDcCommonData->PriceBill.TotalCost);
|
|
|
}
|
|
@@ -1556,12 +1559,13 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
|
|
|
memcpy(ShmDcCommonData->ParkingInfo[plugNum].OccupancySN,&pCsuResult->Data.Data[1],36);
|
|
|
}
|
|
|
if (ShmDcCommonData->pGunInfo[plugNum].ParkingStatus != pCsuResult->Data.Data[0]) {
|
|
|
- if (ShmDcCommonData->pGunInfo[plugNum].ParkingStatus)
|
|
|
- ShmDcCommonData->pGunInfo[plugNum].isParking = TRUE;
|
|
|
- else
|
|
|
- ShmDcCommonData->pGunInfo[plugNum].isParking = FALSE;
|
|
|
ShmDcCommonData->pGunInfo[plugNum].ParkingStatus = pCsuResult->Data.Data[0];
|
|
|
- log_info("Gun%d Parking STATUS is [%d] SN:[%s]",plugNum,pCsuResult->Data.Data[0],cmd);
|
|
|
+ if (ShmDcCommonData->pGunInfo[plugNum].ParkingStatus == _TCC_PARKING_NONE )
|
|
|
+ ShmDcCommonData->pGunInfo[plugNum].isParking = FALSE;
|
|
|
+ else {
|
|
|
+ ShmDcCommonData->pGunInfo[plugNum].isParking = TRUE;
|
|
|
+ }
|
|
|
+ log_info("Gun%d Parking STATUS is [%d] SN:[%s] isParking:[%s]",plugNum,pCsuResult->Data.Data[0],cmd,(ShmDcCommonData->pGunInfo[plugNum].isParking ? "ON":"OFF"));
|
|
|
if (!ShmDcCommonData->pGunInfo[plugNum].ParkingStatus) {
|
|
|
//if (pSysInfo->CurGunSelected == plugNum)
|
|
|
// systemPageRestoreInit();
|
|
@@ -2557,14 +2561,14 @@ static int messageTrigger(int fd, uint8_t plugNum, uint8_t gunID, uint8_t curReg
|
|
|
curReg = REG_QRCODE_URL_INFO;
|
|
|
break;
|
|
|
case REG_QRCODE_URL_INFO:
|
|
|
- if (gunID == 1) {
|
|
|
+ //if (gunID == 1) {
|
|
|
if (DiffTimeb(gRegTimeUp[plugNum][curReg], NowTime) > (LOOP_RETRY_TIME * 10) ||
|
|
|
DiffTimeb(gRegTimeUp[plugNum][curReg], NowTime) < 0
|
|
|
) {
|
|
|
readQRcodeURLAndSystemDate(fd);
|
|
|
ftime(&gRegTimeUp[plugNum][curReg]);
|
|
|
}
|
|
|
- }
|
|
|
+ //}
|
|
|
|
|
|
//check misc command from power cabinet
|
|
|
if (gDoCommGblData.MiscCmd != 0) {
|