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
Woazboat
firmware
Commits
83eaf79b
Verified
Commit
83eaf79b
authored
5 years ago
by
genofire
Browse files
Options
Downloads
Patches
Plain Diff
ble: card10 svc - fix write (with response)
parent
d8ef26c8
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
+36
-28
36 additions, 28 deletions
epicardium/ble/card10.c
with
36 additions
and
28 deletions
epicardium/ble/card10.c
+
36
−
28
View file @
83eaf79b
...
...
@@ -581,58 +581,66 @@ static uint8_t writeCard10CB(
// dim
case
CARD10_LEDS_BOTTOM_DIM_VAL_HDL
:
ui8
=
pValue
[
0
];
if
(
operation
==
ATT_PDU_PREP_WRITE_REQ
)
{
if
(
ui8
>=
1
&&
ui8
<=
8
)
{
if
(
ui8
>=
1
&&
ui8
<=
8
)
{
if
(
operation
==
ATT_PDU_WRITE_CMD
||
operation
==
ATT_PDU_SIGNED_WRITE_CMD
||
operation
==
ATT_PDU_WRITE_REQ
||
operation
==
ATT_PDU_EXEC_WRITE_REQ
)
{
epic_leds_dim_bottom
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"ble_card10: prep to dim bottom to: %d
\n
"
,
"ble-card10: dim bottom to: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
else
if
(
operation
==
ATT_PDU_PREP_WRITE_REQ
)
{
APP_TRACE_INFO1
(
"ble_card10: value for dim bottom would be okay: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
else
{
APP_TRACE_INFO1
(
"ble-card10: dim bottom with unknown operation: %d
\n
"
,
operation
);
return
ATT_ERR_INVALID_PDU
;
}
}
else
{
APP_TRACE_INFO1
(
"ble-card: prep dim bottom invalid value (1-8): %d
\n
"
,
ui8
);
return
ATT_ERR_RANGE
;
}
else
if
(
operation
==
ATT_PDU_EXEC_WRITE_REQ
)
{
epic_leds_dim_bottom
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"ble-card10: dim bottom to: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
APP_TRACE_INFO1
(
"ble-card10: dim bottom with unknown operation: %d
\n
"
,
operation
);
return
ATT_ERR_INVALID_PDU
;
case
CARD10_LEDS_TOP_DIM_VAL_HDL
:
ui8
=
pValue
[
0
];
if
(
operation
==
ATT_PDU_PREP_WRITE_REQ
)
{
if
(
ui8
>=
1
&&
ui8
<=
8
)
{
if
(
ui8
>=
1
&&
ui8
<=
8
)
{
if
(
operation
==
ATT_PDU_WRITE_CMD
||
operation
==
ATT_PDU_SIGNED_WRITE_CMD
||
operation
==
ATT_PDU_WRITE_REQ
||
operation
==
ATT_PDU_EXEC_WRITE_REQ
)
{
epic_leds_dim_top
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"ble_card10: prep to dim top to: %d
\n
"
,
"ble-card10: dim top to: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
else
if
(
operation
==
ATT_PDU_PREP_WRITE_REQ
)
{
APP_TRACE_INFO1
(
"ble_card10: value for dim top would be okay: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
else
{
APP_TRACE_INFO1
(
"ble-card10: dim top with unknown operation: %d
\n
"
,
operation
);
return
ATT_ERR_INVALID_PDU
;
}
}
else
{
APP_TRACE_INFO1
(
"ble-card: prep dim top invalid value (1-8): %d
\n
"
,
ui8
);
return
ATT_ERR_RANGE
;
}
else
if
(
operation
==
ATT_PDU_EXEC_WRITE_REQ
)
{
epic_leds_dim_top
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"ble-card10: dim top to: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
APP_TRACE_INFO1
(
"ble-card10: dim top with unknown operation: %d
\n
"
,
operation
);
return
ATT_ERR_INVALID_PDU
;
// led powersafe
case
CARD10_LED_POWERSAFE_VAL_HDL
:
epic_leds_set_powersave
(
pValue
[
0
]);
...
...
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