|
@@ -1730,7 +1730,7 @@ BOOL COTA::GetKeyInfo(std::string host, std::string context, std::string keyname
|
|
|
{
|
|
|
AUTOTIMING;
|
|
|
std::string result;
|
|
|
- if (!HttpPost(host, context, result))
|
|
|
+ if (!HttpPost(host, context, result, DATA_JSON))
|
|
|
{
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -1832,10 +1832,12 @@ BOOL COTA::GetKeyInfo(std::string host, std::string context, std::string keyname
|
|
|
|
|
|
return FALSE;
|
|
|
}
|
|
|
+
|
|
|
+ return TRUE;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return TRUE;
|
|
|
+ return FALSE;
|
|
|
}
|
|
|
|
|
|
void COTA::UpgradeCheck(std::string factoryNum)
|
|
@@ -2085,7 +2087,7 @@ BOOL COTA::ReportLog(TReportData& repdata)
|
|
|
|
|
|
std::string strHttpUrl, strResHttp, strContext;
|
|
|
strContext = pJsonText;
|
|
|
- strHttpUrl = _T("https://cn.ota.qhmoka.com/ota-services/report/reportToolsLog.do");
|
|
|
+ strHttpUrl = _T("https://cn.ota.qhmoka.com/ota-services/report/reportToolsLog");
|
|
|
HttpPost(strHttpUrl.c_str(), strContext.c_str(), strResHttp, DATA_JSON);
|
|
|
|
|
|
|
|
@@ -2117,6 +2119,37 @@ BOOL COTA::ReportLog(TReportData& repdata)
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
|
+BOOL COTA::ReportLog(std::string url, std::string content)
|
|
|
+{
|
|
|
+ AUTOTIMING;
|
|
|
+
|
|
|
+ std::string result;
|
|
|
+ if (!HttpPost(url, content, result, DATA_JSON))
|
|
|
+ return FALSE;
|
|
|
+
|
|
|
+
|
|
|
+ cJSON *pJson = cJSON_Parse(result.c_str());
|
|
|
+ if (pJson == NULL)
|
|
|
+ {
|
|
|
+ LOG4C((LOG_WARN, "解析JSON失败:post=%s;return=%s", content.c_str(), result.c_str()));
|
|
|
+ Global::WriteReportLog(0, __FUNCTION__, "JSON Parsing Error: host=%s, content=%s, result=%s", url.c_str(), content.c_str(), result.c_str());
|
|
|
+
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::string code = cJSON_GetObjectItem(pJson, "code") ? cJSON_GetObjectItem(pJson, "code")->valuestring : "";
|
|
|
+ cJSON_Delete(pJson);
|
|
|
+ pJson = NULL;
|
|
|
+ if (_tcsicmp(code.c_str(), _T("1000")) == 0)
|
|
|
+ {
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ Global::WriteReportLog(0, __FUNCTION__, "http Code is not equal to 1000: host=%s, content=%s, result=%s", url.c_str(), content.c_str(), result.c_str());
|
|
|
+
|
|
|
+ return FALSE;
|
|
|
+}
|
|
|
+
|
|
|
BOOL COTA::GetVCode(std::string mac, std::string& vcode)
|
|
|
{
|
|
|
std::string result;
|