Skip to content

Commit b451cef

Browse files
committed
bluetooth: services: ble_mcumgr: do not translate error of _hvx() call
Remove error translation for the SoftDevice _hvx() call. Return the SoftDevice error directly. The return value of the call invoking _hvx() is anyway only checked against zero, its actual value is not used. Signed-off-by: Emanuele Di Santo <[email protected]>
1 parent f7ece6c commit b451cef

File tree

1 file changed

+4
-26
lines changed
  • subsys/bluetooth/services/ble_mcumgr

1 file changed

+4
-26
lines changed

subsys/bluetooth/services/ble_mcumgr/mcumgr.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -256,34 +256,12 @@ uint32_t ble_mcumgr_data_send(uint8_t *data, uint16_t *len, struct ble_mcumgr_cl
256256
}
257257

258258
nrf_err = sd_ble_gatts_hvx(conn_handle, &hvx_params);
259-
260-
switch (nrf_err) {
261-
case NRF_SUCCESS:
262-
{
263-
return NRF_SUCCESS;
264-
}
265-
case BLE_ERROR_INVALID_CONN_HANDLE:
266-
{
267-
return NRF_ERROR_NOT_FOUND;
268-
}
269-
case NRF_ERROR_INVALID_STATE:
270-
{
271-
return NRF_ERROR_INVALID_STATE;
272-
}
273-
case NRF_ERROR_RESOURCES:
274-
{
275-
return NRF_ERROR_RESOURCES;
276-
}
277-
case NRF_ERROR_NOT_FOUND:
278-
{
279-
return NRF_ERROR_NOT_FOUND;
280-
}
281-
default:
282-
{
259+
if (nrf_err) {
283260
LOG_ERR("Failed to send MCUmgr data, nrf_error %#x", nrf_err);
284-
return NRF_ERROR_INTERNAL;
261+
return nrf_err;
285262
}
286-
};
263+
264+
return NRF_SUCCESS;
287265
}
288266

289267
/* Return errno! */

0 commit comments

Comments
 (0)