From f725fd980d313b8b1406f0362dd585fe730f43e6 Mon Sep 17 00:00:00 2001
From: Martin/Geno <geno+dev@fireorbit.de>
Date: Thu, 22 Aug 2019 16:42:09 +0200
Subject: [PATCH] ble: card10 svc - final cleanup

---
 Documentation/bluetooth/card10.rst |  4 ++--
 epicardium/ble/card10.c            | 21 ++++++++++++---------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/Documentation/bluetooth/card10.rst b/Documentation/bluetooth/card10.rst
index 207e1a37..e32ed6b4 100644
--- a/Documentation/bluetooth/card10.rst
+++ b/Documentation/bluetooth/card10.rst
@@ -53,12 +53,12 @@ The current draft uses following service specification:
 - LEDS dim bottom characteristic:
 
   UUID: ``42230215-2342-2342-2342-234223422342``
-  write
+  write with response
 
 - LEDs dim top characteristic:
 
   UUID: ``42230216-2342-2342-2342-234223422342``
-  write
+  write with response
 
 - LEDs powersafe characteristic:
 
diff --git a/epicardium/ble/card10.c b/epicardium/ble/card10.c
index d7003451..ab562db2 100644
--- a/epicardium/ble/card10.c
+++ b/epicardium/ble/card10.c
@@ -482,7 +482,6 @@ static const attsAttr_t card10SvcAttrList[] =
 };
 /* clang-format on */
 
-
 // validating, that the service really get all charateristics
 WSF_CT_ASSERT(
 	((sizeof(card10SvcAttrList) / sizeof(card10SvcAttrList[0])) ==
@@ -582,12 +581,14 @@ static uint8_t writeCard10CB(
 	case CARD10_LEDS_BOTTOM_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 
-			) {
+			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: dim bottom to: %d\n", pValue[0]
+					"ble-card10: dim bottom to: %d\n",
+					pValue[0]
 				);
 				return ATT_SUCCESS;
 			} else if (operation == ATT_PDU_PREP_WRITE_REQ) {
@@ -613,12 +614,14 @@ static uint8_t writeCard10CB(
 	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 
-			) {
+			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: dim top to: %d\n", pValue[0]
+					"ble-card10: dim top to: %d\n",
+					pValue[0]
 				);
 				return ATT_SUCCESS;
 			} else if (operation == ATT_PDU_PREP_WRITE_REQ) {
-- 
GitLab