|
@@ -8,7 +8,7 @@
|
|
|
#include "meterComm.h"
|
|
|
#include "Module_RatedCurrent.h"
|
|
|
|
|
|
-#define _DEBUG_ 1
|
|
|
+#define _DEBUG_ 0
|
|
|
|
|
|
#if _DEBUG_
|
|
|
#define PR(...) printf(__VA_ARGS__)
|
|
@@ -89,6 +89,12 @@ int main(void)
|
|
|
Meter_transaction_Action meter_read_transaction_record[4];
|
|
|
Meter_transaction_Action meter_transaction_Action[4];
|
|
|
Meter_transaction_Result meter_transaction_Result[4];
|
|
|
+ //log use
|
|
|
+ Meter_Info before_meter_info[4];
|
|
|
+ uint8_t before_failCount[4];
|
|
|
+ Meter_transaction_Action before_meter_transaction_Action[4];
|
|
|
+ Meter_transaction_Action before_meter_read_transaction_record[4];
|
|
|
+
|
|
|
uint8_t failCount[4];
|
|
|
uint8_t startTransactionFailCount[4];
|
|
|
uint8_t stopTransactionFailCount[4];
|
|
@@ -153,8 +159,8 @@ int main(void)
|
|
|
DEBUG_INFO("shm ");
|
|
|
#endif
|
|
|
|
|
|
- printf("modelnameInfo.GetGunCount : %d \n", modelnameInfo.GetGunCount);
|
|
|
- DEBUG_INFO("modelnameInfo.GetGunCount : %d \n", modelnameInfo.GetGunCount);
|
|
|
+ printf("modelnameInfo.GetGunCount : %d \n\n\n", modelnameInfo.GetGunCount);
|
|
|
+ DEBUG_INFO("modelnameInfo.GetGunCount : %d \n\n\n", modelnameInfo.GetGunCount);
|
|
|
|
|
|
|
|
|
|
|
@@ -178,6 +184,28 @@ int main(void)
|
|
|
meter_read_transaction_record[gun_index].ActionCmd = ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd;
|
|
|
meter_read_transaction_record[gun_index].OcmfInfoReady = ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady;
|
|
|
meter_transaction_Action[gun_index].OcmfInfoReady = ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady;
|
|
|
+
|
|
|
+ if(before_meter_transaction_Action[gun_index].ActionCmd != ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd ||
|
|
|
+ before_meter_transaction_Action[gun_index].OcmfInfoReady != ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady ||
|
|
|
+ before_meter_read_transaction_record[gun_index].ActionCmd != ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd ||
|
|
|
+ before_meter_read_transaction_record[gun_index].OcmfInfoReady != ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady ||
|
|
|
+ before_meter_info[gun_index].LinkStatus != meter_info[gun_index].LinkStatus ||
|
|
|
+ before_failCount[gun_index] != failCount[gun_index])
|
|
|
+ {
|
|
|
+ DEBUG_INFO("shm Meter %d - LinkStatus %d : failCount: %d ActionCmd: %d OcmpInfoReady: %d RecordActionCmd: %d RecordOcmpInfoReady: %d \n", gun_index,
|
|
|
+ meter_info[gun_index].LinkStatus,failCount[gun_index] ,
|
|
|
+ ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd ,
|
|
|
+ ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady,
|
|
|
+ ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd ,
|
|
|
+ ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady);
|
|
|
+
|
|
|
+ before_meter_transaction_Action[gun_index].ActionCmd = ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd;
|
|
|
+ before_meter_transaction_Action[gun_index].OcmfInfoReady = ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady;
|
|
|
+ before_meter_read_transaction_record[gun_index].ActionCmd = ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd;
|
|
|
+ before_meter_read_transaction_record[gun_index].OcmfInfoReady = ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady;
|
|
|
+ before_meter_info[gun_index].LinkStatus = meter_info[gun_index].LinkStatus;
|
|
|
+ before_failCount[gun_index] = failCount[gun_index];
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
|
|
@@ -386,7 +414,8 @@ int main(void)
|
|
|
DEBUG_INFO(" %-26s : %s\n\n\n\n\n\n", "signature", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].signature);
|
|
|
#endif
|
|
|
|
|
|
- #else
|
|
|
+ #else //DEBUG_STANDALONG
|
|
|
+
|
|
|
#ifdef DEBUG_STANDALONE_TRANSACTION_RESULT_LOG
|
|
|
DEBUG_INFO(" ================================= Standalone Transaction Result : %d ================================= \n",gun_index);
|
|
|
DEBUG_INFO(" %-26s : %d\n", "paginationCounter", meter_transaction_Result[gun_index].paginationCounter);
|
|
@@ -409,7 +438,8 @@ int main(void)
|
|
|
DEBUG_INFO(" %-26s : %.3f\n", "energyExportTotalStop", gun_index, meter_transaction_Result[gun_index].energyExportTotalStop);
|
|
|
DEBUG_INFO(" %-26s : %s\n\n\n\n\n\n", "signature", meter_transaction_Result[gun_index].signature);
|
|
|
#endif
|
|
|
- #endif//DEBUG_STANDALONG
|
|
|
+
|
|
|
+ #endif //DEBUG_STANDALONG
|
|
|
|
|
|
failCount[gun_index] = 0;
|
|
|
stopTransactionFailCount[gun_index] = 0;
|
|
@@ -436,15 +466,17 @@ int main(void)
|
|
|
|
|
|
#ifdef DEBUG_SHAREMEM_TRANSACTION_RESULT_LOG
|
|
|
DEBUG_INFO("shm transactionOCMF %d : %s\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].transactionOCMF);
|
|
|
+ DEBUG_INFO("shm publicKeyOCMF %d : %s\n\n\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].publicKeyOcmf);
|
|
|
#endif
|
|
|
|
|
|
- #else
|
|
|
+ #else //DEBUG_STANDALONG
|
|
|
|
|
|
PR("OCMF : %s\n",meter_transaction_Action[gun_index].transactionOCMF);
|
|
|
|
|
|
#ifdef DEBUG_STANDALONE_TRANSACTION_RESULT_LOG
|
|
|
DEBUG_INFO("transactionOCMF %d : %s\n", gun_index, meter_transaction_Action[gun_index].transactionOCMF);
|
|
|
- #endif
|
|
|
+ #endif
|
|
|
+
|
|
|
#endif//DEBUG_STANDALONG
|
|
|
|
|
|
meter_transaction_Action[gun_index].OcmfInfoReady = 1;
|
|
@@ -522,7 +554,8 @@ int main(void)
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_SHAREMEM_TRANSACTION_RESULT_LOG
|
|
|
- DEBUG_INFO("shm transactionOCMF %d : %s\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].transactionOCMF);
|
|
|
+ DEBUG_INFO("shm record transactionOCMF %d : %s\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].transactionOCMF);
|
|
|
+ DEBUG_INFO("shm record publicKeyOCMF %d : %s\n\n\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].publicKeyOcmf);
|
|
|
#endif
|
|
|
|
|
|
#else
|
|
@@ -865,12 +898,7 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
#ifndef DEBUG_STANDALONG
|
|
|
- DEBUG_INFO("shm Meter %d - LinkStatus %d : failCount: %d ActionCmd: %d OcmpInfoReady: %d\n RecordActionCmd: %d RecordOcmpInfoReady: %d", gun_index,
|
|
|
- meter_info[gun_index].LinkStatus,failCount[gun_index] ,
|
|
|
- ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd ,
|
|
|
- ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady,
|
|
|
- ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd ,
|
|
|
- ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady);
|
|
|
+
|
|
|
PR ("=================== ModelName %s\n", ShmSysConfigAndInfo->SysConfig.ModelName);
|
|
|
PR("end : %d ActionCmd : %d OcmfInfoReady : %d RecordActionCmd: %d RecordOcmpInfoReady: %d \n", gun_index,ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd,
|
|
|
ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady,
|
|
@@ -882,12 +910,14 @@ int main(void)
|
|
|
|
|
|
|
|
|
#else
|
|
|
- DEBUG_INFO("Meter %d - LinkStatus %d : failCount: %d ActionCmd: %d OcmpInfoReady: %d RecordActionCmd: %d RecordOcmpInfoReady: %d\n", gun_index,
|
|
|
+ /*
|
|
|
+ DEBUG_INFO("Meter %d - LinkStatus %d : failCount: %d ActionCmd: %d OcmpInfoReady: %d RecordActionCmd: %d RecordOcmpInfoReady: %d \n", gun_index,
|
|
|
meter_info[gun_index].LinkStatus,failCount[gun_index] ,
|
|
|
meter_transaction_Action[gun_index].ActionCmd ,
|
|
|
meter_transaction_Action[gun_index].OcmfInfoReady,
|
|
|
meter_read_transaction_record[gun_index].ActionCmd ,
|
|
|
meter_read_transaction_record[gun_index].OcmfInfoReady);
|
|
|
+ */
|
|
|
|
|
|
PR ("=================== STAND ALONE\n");
|
|
|
PR("end : %d ActionCmd : %d OcmfInfoReady : %d RecordActionCmd: %d RecordOcmpInfoReady: %d \n", gun_index,meter_transaction_Action[gun_index].ActionCmd,
|