Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈伟灿
k-sdk
Commits
2d0627b1
Commit
2d0627b1
authored
Sep 07, 2020
by
黄振令
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】获取毫秒有问题,修改为获取秒
【提交人】huang.zhenling
parent
e54d33e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
common/hal/HAL_OS_linux.c
common/hal/HAL_OS_linux.c
+8
-0
midware/midware/dm/kk_dm_msg.c
midware/midware/dm/kk_dm_msg.c
+4
-4
No files found.
common/hal/HAL_OS_linux.c
View file @
2d0627b1
...
@@ -115,6 +115,14 @@ uint64_t HAL_UptimeMs(void)
...
@@ -115,6 +115,14 @@ uint64_t HAL_UptimeMs(void)
return
time_ms
;
return
time_ms
;
}
}
uint64_t
HAL_GetTime
(
void
)
{
time_t
t
;
t
=
time
(
NULL
);
return
t
;
}
uint64_t
HAL_GetTimeMs
(
void
)
uint64_t
HAL_GetTimeMs
(
void
)
{
{
uint64_t
time_ms
;
uint64_t
time_ms
;
...
...
midware/midware/dm/kk_dm_msg.c
View file @
2d0627b1
...
@@ -321,7 +321,7 @@ const char DM_MSG_COMBINE_STATUS_ONLINE[] DM_READ_ONLY =
...
@@ -321,7 +321,7 @@ const char DM_MSG_COMBINE_STATUS_ONLINE[] DM_READ_ONLY =
}
}
/* TimeStamp */
/* TimeStamp */
HAL_Snprintf
(
timestamp
,
DM_UTILS_UINT64_STRLEN
,
"%
llu"
,
(
unsigned
long
long
)
HAL_GetTimeMs
());
HAL_Snprintf
(
timestamp
,
DM_UTILS_UINT64_STRLEN
,
"%
d"
,
HAL_GetTime
());
/* dm_log_debug("Time Stamp: %s", timestamp); */
/* dm_log_debug("Time Stamp: %s", timestamp); */
...
@@ -365,7 +365,7 @@ int dm_msg_status_offline(_IN_ char productCode[PRODUCT_CODE_MAXLEN],
...
@@ -365,7 +365,7 @@ int dm_msg_status_offline(_IN_ char productCode[PRODUCT_CODE_MAXLEN],
}
}
/* TimeStamp */
/* TimeStamp */
HAL_Snprintf
(
timestamp
,
DM_UTILS_UINT64_STRLEN
,
"%
llu"
,
(
unsigned
long
long
)
HAL_GetTimeMs
());
HAL_Snprintf
(
timestamp
,
DM_UTILS_UINT64_STRLEN
,
"%
d"
,
HAL_GetTime
());
/* dm_log_debug("Time Stamp: %s", timestamp); */
/* dm_log_debug("Time Stamp: %s", timestamp); */
...
@@ -411,7 +411,7 @@ int dm_msg_combine_login(_IN_ char productCode[PRODUCT_CODE_MAXLEN],
...
@@ -411,7 +411,7 @@ int dm_msg_combine_login(_IN_ char productCode[PRODUCT_CODE_MAXLEN],
}
}
/* TimeStamp */
/* TimeStamp */
HAL_Snprintf
(
timestamp
,
DM_UTILS_UINT64_STRLEN
,
"%
llu"
,
(
unsigned
long
long
)
HAL_GetTimeMs
());
HAL_Snprintf
(
timestamp
,
DM_UTILS_UINT64_STRLEN
,
"%
d"
,
HAL_GetTime
());
/* dm_log_debug("Time Stamp: %s", timestamp); */
/* dm_log_debug("Time Stamp: %s", timestamp); */
/* Client ID */
/* Client ID */
...
@@ -548,7 +548,7 @@ int dm_msg_request (_IN_ dm_msg_request_t *request,_IN_ int isAsync)
...
@@ -548,7 +548,7 @@ int dm_msg_request (_IN_ dm_msg_request_t *request,_IN_ int isAsync)
}
}
memset
(
payload
,
0
,
payload_len
);
memset
(
payload
,
0
,
payload_len
);
snprintf
(
payload
,
payload_len
,
DM_MSG_REQUEST
,
request
->
msgid
,
snprintf
(
payload
,
payload_len
,
DM_MSG_REQUEST
,
request
->
msgid
,
DM_MSG_VERSION
,
request
->
params
,
HAL_GetTime
Ms
(),
request
->
method
);
DM_MSG_VERSION
,
request
->
params
,
HAL_GetTime
(),
request
->
method
);
req_info_len
=
strlen
(
DM_MSG_INFO
)
+
10
+
strlen
(
request
->
productCode
)
+
strlen
(
request
->
deviceCode
)
+
strlen
(
request
->
msgTypeStr
)
+
1
;
req_info_len
=
strlen
(
DM_MSG_INFO
)
+
10
+
strlen
(
request
->
productCode
)
+
strlen
(
request
->
deviceCode
)
+
strlen
(
request
->
msgTypeStr
)
+
1
;
req_info
=
malloc
(
req_info_len
);
req_info
=
malloc
(
req_info_len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment