|
@@ -443,7 +443,7 @@ int DB_Open(sqlite3 *db)
|
|
|
"stopReason text"
|
|
|
");";
|
|
|
|
|
|
- char* createCfgSql="CREATE TABLE `config` ( "
|
|
|
+ char* createCfgSql="CREATE TABLE IF NOT EXISTS `config` ( "
|
|
|
"`idx` INTEGER PRIMARY KEY AUTOINCREMENT, "
|
|
|
"`item` TEXT NOT NULL, "
|
|
|
"`connector` INTEGER NOT NULL, "
|
|
@@ -573,7 +573,7 @@ int DB_Get_Operactive(sqlite3 *db, uint8_t gun_index)
|
|
|
int rows, cols;
|
|
|
|
|
|
sprintf(sqlStr, "select * from config where item='isOperactive' and connector=%d;", gun_index);
|
|
|
- DEBUG_INFO("sqlStr= %s\r\n", sqlStr);
|
|
|
+ //DEBUG_INFO("sqlStr= %s\r\n", sqlStr);
|
|
|
|
|
|
if(sqlite3_open(DB_FILE, &db))
|
|
|
{
|
|
@@ -586,7 +586,7 @@ int DB_Get_Operactive(sqlite3 *db, uint8_t gun_index)
|
|
|
DEBUG_INFO( "Local config query database open successfully.\r\n");
|
|
|
sqlite3_get_table(db, sqlStr, &rs, &rows, &cols, &errMsg);
|
|
|
|
|
|
- if(rows>0)
|
|
|
+ if(rows>1)
|
|
|
{
|
|
|
for(int idxRow=1;idxRow<=rows;idxRow++)
|
|
|
{
|
|
@@ -594,10 +594,13 @@ int DB_Get_Operactive(sqlite3 *db, uint8_t gun_index)
|
|
|
{
|
|
|
result = false;
|
|
|
}
|
|
|
- DEBUG_INFO("%s, %s, %s, %s\r\n", rs[(idxRow*cols)+0], rs[(idxRow*cols)+1], rs[(idxRow*cols)+2], rs[(idxRow*cols)+3]);
|
|
|
DEBUG_INFO("Query connector-%d isOperactive: %s\r\n", gun_index, rs[(idxRow*cols)+3]);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_INFO("Query connector-%d fail, set default value to operactive.\r\n", gun_index);
|
|
|
+ }
|
|
|
|
|
|
sqlite3_free_table(rs);
|
|
|
sqlite3_close(db);
|
|
@@ -1174,7 +1177,7 @@ void get_firmware_version(unsigned char gun_index)
|
|
|
strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
|
|
|
|
|
|
// Get CSU root file system version
|
|
|
- sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.19.60.XXXX.B0");
|
|
|
+ sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.20.60.XXXX.B0");
|
|
|
|
|
|
// Get AC connector type from model name
|
|
|
for(uint8_t idx=0;idx<3;idx++)
|