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
Marek
firmware
Commits
beed271f
Commit
beed271f
authored
5 years ago
by
genofire
Committed by
schneider
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ble: card10 svc - validierung of dim
parent
aff737ed
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
+20
-9
20 additions, 9 deletions
epicardium/ble/card10.c
with
20 additions
and
9 deletions
epicardium/ble/card10.c
+
20
−
9
View file @
beed271f
...
...
@@ -168,7 +168,7 @@ static const uint8_t UUID_attChar_led_bg_top_left[] = {
/* BLE UUID for card10 dim leds on bottom */
static
const
uint8_t
UUID_char_leds_bottom_dim
[]
=
{
ATT_PROP_WRITE
_NO_RSP
,
ATT_PROP_WRITE
,
UINT16_TO_BYTES
(
CARD10_LEDS_BOTTOM_DIM_VAL_HDL
),
CARD10_UUID_SUFFIX
,
0x15
,
CARD10_UUID_PREFIX
};
...
...
@@ -179,7 +179,7 @@ static const uint8_t UUID_attChar_leds_bottom_dim[] = {
/* BLE UUID for card10 dim leds on top */
static
const
uint8_t
UUID_char_leds_top_dim
[]
=
{
ATT_PROP_WRITE
_NO_RSP
,
ATT_PROP_WRITE
,
UINT16_TO_BYTES
(
CARD10_LEDS_TOP_DIM_VAL_HDL
),
CARD10_UUID_SUFFIX
,
0x16
,
CARD10_UUID_PREFIX
};
...
...
@@ -533,7 +533,8 @@ static uint8_t writeCard10CB(
uint8_t
*
pValue
,
attsAttr_t
*
pAttr
)
{
uint16_t
ui16
;
uint16_t
ui16
=
0
;
uint8_t
ui8
=
0
;
switch
(
handle
)
{
case
CARD10_TIME_UPDATE_VAL_HDL
:
...
...
@@ -597,13 +598,23 @@ static uint8_t writeCard10CB(
);
return
ATT_SUCCESS
;
case
CARD10_LEDS_BOTTOM_DIM_VAL_HDL
:
epic_leds_dim_bottom
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"dim bottom to: %d
\n
"
,
pValue
[
0
]);
return
ATT_SUCCESS
;
ui8
=
pValue
[
0
];
if
(
ui8
>=
1
&&
ui8
<=
8
)
{
epic_leds_dim_bottom
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"dim bottom to: %d
\n
"
,
pValue
[
0
]);
return
ATT_SUCCESS
;
}
APP_TRACE_INFO1
(
"dim bottom invalid value (1-8): %d
\n
"
,
ui8
);
return
ATT_ERR_RANGE
;
case
CARD10_LEDS_TOP_DIM_VAL_HDL
:
epic_leds_dim_top
(
pValue
[
0
]);
APP_TRACE_INFO1
(
"dim top to: %d
\n
"
,
pValue
[
0
]);
return
ATT_SUCCESS
;
ui8
=
pValue
[
0
];
if
(
ui8
>=
1
&&
ui8
<=
8
)
{
epic_leds_dim_top
(
ui8
);
APP_TRACE_INFO1
(
"dim top to: %d
\n
"
,
ui8
);
return
ATT_SUCCESS
;
}
APP_TRACE_INFO1
(
"dim top invalid value (1-8): %d
\n
"
,
ui8
);
return
ATT_ERR_RANGE
;
case
CARD10_LEDS_ABOVE_VAL_HDL
:
for
(
ui16
=
0
;
ui16
<
11
;
ui16
++
)
{
epic_leds_set
(
...
...
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