#include "power_display_service.h"
#include "custom_utils.h"
#include "cywee_service.h"
-extern "C" errcode_t uapi_get_timestampe_ms(uint64_t *tm);
+extern "C" errcode_t uapi_get_timestampe_ms(uint32_t *tm);
#define BLOODKEYABLE 0
namespace OHOS
#include "health_service.h"\r
#include "custom_utils.h"\r
\r
-extern "C" errcode_t uapi_get_timestampe_ms(uint64_t *tm);\r
+extern "C" errcode_t uapi_get_timestampe_ms(uint32_t *tm);\r
#ifdef __cplusplus\r
extern "C"\r
{\r
unsigned char nameLen;
unsigned char tel[MAX_PHONE_NUM];
unsigned char telLen;
- uint64 activeTime; // 首次电话接通时间点
- uint64 creationTime; // 通话创建时间(不是接通时间)
+ uint32 activeTime; // 首次电话接通时间点
+ uint32 creationTime; // 通话创建时间(不是接通时间)
hfp_hf_calls_info_t unitCalls;
} PhoneCallInfo;
#define HIGH_INTENSITY_LOWER_THRESHOLD 70
#define HIGH_INTENSITY_UPPER_THRESHOLD 79
-extern "C" errcode_t uapi_get_timestampe_ms(uint64_t *tm);
+extern "C" errcode_t uapi_get_timestampe_ms(uint32_t *tm);
extern "C" void custom_VibratorFunc(OHOS::VibratorType vibratorType);
#ifdef __cplusplus
unsigned char nameLen;
unsigned char tel[MAX_PHONE_NUM];
unsigned char telLen;
- uint64 activeTime; // 首次电话接通时间点
- uint64 creationTime; // 通话创建时间(不是接通时间)
+ uint32 activeTime; // 首次电话接通时间点
+ uint32 creationTime; // 通话创建时间(不是接通时间)
hfp_hf_calls_info_t unitCalls;
} PhoneCallInfo;
unsigned char tel[MAX_PHONE_NUM];
unsigned char telLen;
CallFinishStatus status;
- uint64 creationTime; // 通话创建时间(不是接通时间)
- uint64 callDurTime; // 通话持续时间
+ uint32 creationTime; // 通话创建时间(不是接通时间)
+ uint32 callDurTime; // 通话持续时间
} CallLogInfo;
// 通话状态改变回调函数
uint8_t data_len = 0;\r
uint32_t time = 1704090976;\r
uint32_t step = 0;\r
- uint64_t timeMs = 0;\r
+ uint32_t timeMs = 0;\r
int ret = uapi_get_timestampe_ms(&timeMs);\r
if(ret==0){\r
timeMs = timeMs/1000;\r
#include "systick.h"
#include "sys/time.h"
#include "time.h"
-errcode_t uapi_get_timestampe_ms(uint64_t *tm)
+errcode_t uapi_get_timestampe_ms(uint32_t *tm)
{
struct timeval tv = { 0 };
if (gettimeofday(&tv, NULL)) {
return ERRCODE_FAIL;
}
- *tm = (uint64_t)(tv.tv_sec*1000 + tv.tv_usec/1000 );
+ *tm = (uint32_t)(tv.tv_sec*1000 + tv.tv_usec/1000 );
return ERRCODE_SUCC;
}
return 2;
}
// const char* timestr="(2024, 3, 2, 18, 40, 1, 5, 62),8";
-
+ printf("decodeTime %s\r\n",time);
char buf[50] = {0};
if (strlen(time)>sizeof(buf))
{
i++;
}
tmp_timestamp = (uint32_t)mktime(&_tm);
- // tmp_timestamp -= tmp_zone * 3600; //cat1获得的时间时当下时间,实际上要减去zone的时间
+ tmp_timestamp -= tmp_zone * 3600; //cat1获得的时间时当下时间,实际上要减去zone的时间
printf("time %04d-%02d-%02d %02d:%02d:%02d \r\nstamp %u \r\nzone %d\n",
_tm.tm_year,_tm.tm_mon,_tm.tm_mday,_tm.tm_hour,_tm.tm_min,_tm.tm_sec,
tmp_timestamp,
time_t rawtime;
- struct tm* timeinfo;
+ struct tm timeinfo;
time(&rawtime);
- timeinfo = localtime(&rawtime);
+ localtime_r(&rawtime,&timeinfo);
printf("set time success %04d-%02d-%02d %02d:%02d:%02d %d\n",
- timeinfo->tm_year + 1900,
- timeinfo->tm_mon + 1,
- timeinfo->tm_mday,
- timeinfo->tm_hour,
- timeinfo->tm_min,
- timeinfo->tm_sec,zone);
+ timeinfo.tm_year + 1900,
+ timeinfo.tm_mon + 1,
+ timeinfo.tm_mday,
+ timeinfo.tm_hour,
+ timeinfo.tm_min,
+ timeinfo.tm_sec,zone);
- if (timeinfo->tm_year+1900 < 2024)
+ if (timeinfo.tm_year+1900 < 2024)
return ERRCODE_FAIL;
return ERRCODE_SUCC;
errcode_t uaip_cmd_update_request(void);
/**获取单位ms的时间戳*/
-errcode_t uapi_get_timestampe_ms(uint64_t *tm);
+errcode_t uapi_get_timestampe_ms(uint32_t *tm);
/*获取单位秒的时间戳*/
errcode_t uapi_get_timestampe_ss(uint32_t *tm);
/**根据cat1获取的时间字串设置时间*/
#define HTTPC_DEBUG_SERIOUS (HTTPC_DEBUG | LWIP_DBG_LEVEL_SERIOUS)
#define HTTPC_POLL_INTERVAL 1
-#define HTTPC_POLL_TIMEOUT 160 /* 15 seconds */
+#define HTTPC_POLL_TIMEOUT 80 /* 15 seconds */
#define HTTPC_CONTENT_LEN_INVALID 0xFFFFFFFF
}
return httpc_close(req, result, req->rx_status, ERR_OK);
}
+ req->timeout_ticks = HTTPC_POLL_TIMEOUT;
if (req->parse_state != HTTPC_PARSE_RX_DATA) {
if (req->rx_hdrs == NULL) {
req->rx_hdrs = p;
httpc_state_t* req = (httpc_state_t*)arg;
LWIP_UNUSED_ARG(pcb);
if (req != NULL) {
+ if (req->timeout_ticks == HTTPC_POLL_TIMEOUT)
+ {
+ // printf("=============== timeout_ticks reset to default !\r\n");
+ }
if (req->timeout_ticks) {
req->timeout_ticks--;
+ // printf("=============== timeout_ticks -- %d !\r\n",req->timeout_ticks);
}
if (!req->timeout_ticks) {
+ // printf("=============== timeout_ticks HTTPC_RESULT_ERR_TIMEOUT !\r\n");
+
return httpc_close(req, HTTPC_RESULT_ERR_TIMEOUT, 0, ERR_OK);
}
}