Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ln
firmware
Commits
223c5bbd
Commit
223c5bbd
authored
5 years ago
by
genofire
Committed by
schneider
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ble: make set time easier
parent
14b869a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/card10.c
+3
-12
3 additions, 12 deletions
epicardium/ble/card10.c
with
3 additions
and
12 deletions
epicardium/ble/card10.c
+
3
−
12
View file @
223c5bbd
...
...
@@ -504,19 +504,16 @@ static void *addCard10GroupDyn(void)
/*
* Set the time given in milliseconds since 1.1.1970 as 64 bit integer.
*/
static
uint8_t
setTime
(
uint8_t
*
pValue
,
uint16_t
len
)
static
uint8_t
setTime
(
uint8_t
*
pValue
)
{
uint64_t
timeNet
;
uint64_t
time
;
if
(
len
<
sizeof
(
uint64_t
))
{
return
ATT_ERR_LENGTH
;
}
memcpy
(
&
timeNet
,
pValue
,
sizeof
(
timeNet
));
time
=
__bswap64
(
timeNet
);
epic_rtc_set_milliseconds
(
time
);
APP_TRACE_INFO1
(
"set time to: %d
\n
"
,
time
);
return
ATT_SUCCESS
;
}
...
...
@@ -539,13 +536,7 @@ static uint8_t writeCard10CB(
switch
(
handle
)
{
// time
case
CARD10_TIME_UPDATE_VAL_HDL
:
if
(
operation
==
ATT_PDU_PREP_WRITE_REQ
)
{
if
(
len
<
sizeof
(
uint64_t
))
{
return
ATT_ERR_LENGTH
;
}
return
ATT_SUCCESS
;
}
return
setTime
(
pValue
,
len
);
return
setTime
(
pValue
);
// vibra
case
CARD10_VIBRA_VAL_HDL
:
BYTES_TO_UINT16
(
ui16
,
pValue
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment