Skip to content

Commit f5b2ed5

Browse files
committed
btshell/gatt_svr.c: add asserts to avoid fallthrough
Added asserts after ctxt->op didn't matched to avoid fallthrough.
1 parent 6c15e8f commit f5b2ed5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/btshell/src/gatt_svr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ gatt_svr_long_access_test(uint16_t conn_handle, uint16_t attr_handle,
512512
sizeof gatt_svr_pts_static_long_val);
513513
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
514514
}
515+
assert(0);
516+
break;
515517

516518
case PTS_LONG_CHR_READ_WRITE_ALT:
517519
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,
524526
sizeof gatt_svr_pts_static_long_val_alt);
525527
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
526528
}
529+
assert(0);
530+
break;
527531

528532
case PTS_LONG_CHR_READ_WRITE_ENC:
529533
case PTS_LONG_CHR_READ_WRITE_AUTHEN:
@@ -537,6 +541,8 @@ gatt_svr_long_access_test(uint16_t conn_handle, uint16_t attr_handle,
537541
sizeof gatt_svr_pts_static_long_val);
538542
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
539543
}
544+
assert(0);
545+
break;
540546

541547
case PTS_LONG_DSC_READ:
542548
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,
564570
sizeof gatt_svr_pts_static_long_val);
565571
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
566572
}
573+
assert(0);
574+
break;
567575

568576
default:
569577
assert(0);

0 commit comments

Comments
 (0)