From 5d318b62c8441f162220d694a65856aec5d6ceb5 Mon Sep 17 00:00:00 2001 From: "XI.CHEN" <2311041011@qq.com> Date: Fri, 10 Jan 2025 17:05:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BD=91=E7=BB=9C=E6=8B=8D?= =?UTF-8?q?=E7=85=A7=E5=A4=B1=E8=B4=A5=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/GPIOControl.cpp | 3 +-- app/src/main/cpp/PhoneDevice.cpp | 2 +- app/src/main/cpp/netcamera/httpclient.cpp | 4 ++++ app/src/main/cpp/netcamera/httpclient.h | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/GPIOControl.cpp b/app/src/main/cpp/GPIOControl.cpp index fd1227e1..134f7ace 100644 --- a/app/src/main/cpp/GPIOControl.cpp +++ b/app/src/main/cpp/GPIOControl.cpp @@ -58,8 +58,7 @@ size_t GpioControl::turnOnImpl(const IOT_PARAM& param) } if (it == m_items.end()) { - ITEM item = {param.cmd, references, 0, 0, 0}; - item.openTime = now; + ITEM item = {param.cmd, references, 0, 0, now}; m_items.push_back(item); SetCamerastatus(param.cmd, true); } diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 6855ba5b..b2d924e2 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1622,7 +1622,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c } else { - XYLOG(XYLOG_SEVERITY_ERROR, "Faile to TP on NET Camera CH=%u PR=%X PHOTOID=%u URL=http://%s%s", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, + XYLOG(XYLOG_SEVERITY_ERROR, "Failed to TP on NET Camera CH=%u PR=%X PHOTOID=%u URL=http://%s%s", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId, netPhotoInfo.ip, netPhotoInfo.url); TakePhotoCb(0, localPhotoInfo, "", 0); } diff --git a/app/src/main/cpp/netcamera/httpclient.cpp b/app/src/main/cpp/netcamera/httpclient.cpp index 874ef20d..f67e2990 100644 --- a/app/src/main/cpp/netcamera/httpclient.cpp +++ b/app/src/main/cpp/netcamera/httpclient.cpp @@ -97,6 +97,7 @@ int DoGetRequest(const char* url, int authType, const char* userName, const char } else { + XYLOG(XYLOG_SEVERITY_WARNING, "Net Photo failure, nRet=%s", nRet); printf("GET err=%d", nRet); } curl_easy_cleanup(curl); @@ -137,6 +138,9 @@ int DoPutRequest(const char* url, int authType, const char* userName, const char curl_easy_setopt(curl, CURLOPT_SOCKOPTDATA, &netHandle); } + if(contents != NULL) + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, contents); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, OnWriteData); // 设置回调函数的参数,获取反馈信息 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &data); diff --git a/app/src/main/cpp/netcamera/httpclient.h b/app/src/main/cpp/netcamera/httpclient.h index 71af1a76..6f8c3186 100644 --- a/app/src/main/cpp/netcamera/httpclient.h +++ b/app/src/main/cpp/netcamera/httpclient.h @@ -10,6 +10,7 @@ #include #include +#include "LogThread.h" #ifndef __HTTP_CLIENT__ #define __HTTP_CLIENT__