mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-30 09:13:31 +00:00
Merge pull request #493 from sjanc/static_check
Few more fixes for issues reported by static checker X-Original-Commit: 95a88dd106c62ba1a49b715258988578a53c0f86
This commit is contained in:
@@ -1862,8 +1862,8 @@ ble_ll_adv_ext_set_param(uint8_t *cmdbuf, uint8_t *rspbuf, uint8_t *rsplen)
|
||||
}
|
||||
|
||||
sec_phy = cmdbuf[22];
|
||||
if (pri_phy != BLE_HCI_LE_PHY_1M && pri_phy != BLE_HCI_LE_PHY_2M &&
|
||||
pri_phy != BLE_HCI_LE_PHY_CODED) {
|
||||
if (sec_phy != BLE_HCI_LE_PHY_1M && sec_phy != BLE_HCI_LE_PHY_2M &&
|
||||
sec_phy != BLE_HCI_LE_PHY_CODED) {
|
||||
return BLE_ERR_INV_HCI_CMD_PARMS;
|
||||
}
|
||||
|
||||
|
||||
@@ -184,6 +184,8 @@ ble_svc_ans_access(uint16_t conn_handle, uint16_t attr_handle,
|
||||
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
|
||||
}
|
||||
|
||||
assert(0);
|
||||
return BLE_ATT_ERR_UNLIKELY;
|
||||
case BLE_SVC_ANS_CHR_UUID16_SUP_UNR_ALERT_CAT:
|
||||
assert(ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR);
|
||||
rc = os_mbuf_append(ctxt->om, &ble_svc_ans_unr_alert_cat,
|
||||
@@ -219,13 +221,15 @@ ble_svc_ans_access(uint16_t conn_handle, uint16_t attr_handle,
|
||||
cmd_id = ble_svc_ans_alert_not_ctrl_pt[0];
|
||||
cat_id = ble_svc_ans_alert_not_ctrl_pt[1];
|
||||
|
||||
|
||||
/* Set cat_bit_mask to the appropriate bitmask based on cat_id */
|
||||
if (cat_id < BLE_SVC_ANS_CAT_NUM) {
|
||||
cat_bit_mask = (1 << cat_id);
|
||||
} else if (cat_id == 0xff) {
|
||||
cat_bit_mask = cat_id;
|
||||
} else {
|
||||
cat_bit_mask = 0;
|
||||
/* invalid category ID */
|
||||
return BLE_ATT_ERR_UNLIKELY;
|
||||
}
|
||||
|
||||
switch (cmd_id) {
|
||||
|
||||
@@ -217,7 +217,7 @@ ble_l2cap_coc_rx_fn(struct ble_l2cap_chan *chan)
|
||||
* However, we still have buffer to for next LE Frame so lets give one more
|
||||
* credit to peer so it can send us full SDU
|
||||
*/
|
||||
if (rx->credits == 0 && rx->sdu) {
|
||||
if (rx->credits == 0) {
|
||||
/* Remote did not send full SDU. Lets give him one more credits to do
|
||||
* so since we have still buffer to handle it
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user