You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ko...@apache.org on 2021/03/02 08:14:56 UTC
[mynewt-nimble] branch master updated: btshell/gatt_svr.c: add
asserts to avoid fallthrough Added asserts after ctxt->op didn't matched to
avoid fallthrough.
This is an automated email from the ASF dual-hosted git repository.
kopyscinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new f5b2ed5 btshell/gatt_svr.c: add asserts to avoid fallthrough Added asserts after ctxt->op didn't matched to avoid fallthrough.
f5b2ed5 is described below
commit f5b2ed572c95e49aec9f36ed122ddc51119173d1
Author: Krzysztof Kopyściński <kr...@codecoup.pl>
AuthorDate: Wed Feb 24 08:15:51 2021 +0100
btshell/gatt_svr.c: add asserts to avoid fallthrough
Added asserts after ctxt->op didn't matched to avoid fallthrough.
---
apps/btshell/src/gatt_svr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/apps/btshell/src/gatt_svr.c b/apps/btshell/src/gatt_svr.c
index 99d44d0..dc025ca 100644
--- a/apps/btshell/src/gatt_svr.c
+++ b/apps/btshell/src/gatt_svr.c
@@ -512,6 +512,8 @@ gatt_svr_long_access_test(uint16_t conn_handle, uint16_t attr_handle,
sizeof gatt_svr_pts_static_long_val);
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
}
+ assert(0);
+ break;
case PTS_LONG_CHR_READ_WRITE_ALT:
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
@@ -524,6 +526,8 @@ gatt_svr_long_access_test(uint16_t conn_handle, uint16_t attr_handle,
sizeof gatt_svr_pts_static_long_val_alt);
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
}
+ assert(0);
+ break;
case PTS_LONG_CHR_READ_WRITE_ENC:
case PTS_LONG_CHR_READ_WRITE_AUTHEN:
@@ -537,6 +541,8 @@ gatt_svr_long_access_test(uint16_t conn_handle, uint16_t attr_handle,
sizeof gatt_svr_pts_static_long_val);
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
}
+ assert(0);
+ break;
case PTS_LONG_DSC_READ:
assert(ctxt->op == BLE_GATT_ACCESS_OP_READ_DSC);
@@ -564,6 +570,8 @@ gatt_svr_long_access_test(uint16_t conn_handle, uint16_t attr_handle,
sizeof gatt_svr_pts_static_long_val);
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
}
+ assert(0);
+ break;
default:
assert(0);