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
Pete
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
No related tags found
No related merge requests found
Changes
1
Show 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(
...
@@ -581,58 +581,66 @@ static uint8_t writeCard10CB(
// dim
// dim
case
CARD10_LEDS_BOTTOM_DIM_VAL_HDL
:
case
CARD10_LEDS_BOTTOM_DIM_VAL_HDL
:
ui8
=
pValue
[
0
];
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
(
APP_TRACE_INFO1
(
"ble_card10: prep to dim bottom to: %d
\n
"
,
"ble-card10: dim bottom to: %d
\n
"
,
pValue
[
0
]
pValue
[
0
]
);
);
return
ATT_SUCCESS
;
return
ATT_SUCCESS
;
}
}
else
if
(
operation
==
ATT_PDU_PREP_WRITE_REQ
)
{
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
(
APP_TRACE_INFO1
(
"ble-card10: dim bottom to: %d
\n
"
,
pValue
[
0
]
"ble_card10: value for dim bottom would be okay: %d
\n
"
,
pValue
[
0
]
);
);
return
ATT_SUCCESS
;
return
ATT_SUCCESS
;
}
}
else
{
APP_TRACE_INFO1
(
APP_TRACE_INFO1
(
"ble-card10: dim bottom with unknown operation: %d
\n
"
,
"ble-card10: dim bottom with unknown operation: %d
\n
"
,
operation
operation
);
);
return
ATT_ERR_INVALID_PDU
;
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
)
{
APP_TRACE_INFO1
(
"ble_card10: prep to dim top to: %d
\n
"
,
pValue
[
0
]
);
return
ATT_SUCCESS
;
}
}
}
else
{
APP_TRACE_INFO1
(
APP_TRACE_INFO1
(
"ble-card: prep dim to
p
invalid value (1-8): %d
\n
"
,
"ble-card: prep dim
bot
to
m
invalid value (1-8): %d
\n
"
,
ui8
ui8
);
);
return
ATT_ERR_RANGE
;
return
ATT_ERR_RANGE
;
}
else
if
(
operation
==
ATT_PDU_EXEC_WRITE_REQ
)
{
}
case
CARD10_LEDS_TOP_DIM_VAL_HDL
:
ui8
=
pValue
[
0
];
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
]);
epic_leds_dim_top
(
pValue
[
0
]);
APP_TRACE_INFO1
(
APP_TRACE_INFO1
(
"ble-card10: dim top to: %d
\n
"
,
pValue
[
0
]
"ble-card10: dim top to: %d
\n
"
,
pValue
[
0
]
);
);
return
ATT_SUCCESS
;
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
(
APP_TRACE_INFO1
(
"ble-card10: dim top with unknown operation: %d
\n
"
,
"ble-card10: dim top with unknown operation: %d
\n
"
,
operation
operation
);
);
return
ATT_ERR_INVALID_PDU
;
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
;
}
// led powersafe
// led powersafe
case
CARD10_LED_POWERSAFE_VAL_HDL
:
case
CARD10_LED_POWERSAFE_VAL_HDL
:
epic_leds_set_powersave
(
pValue
[
0
]);
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