nimble/att: Use packed struct for receiving Execute Write Response Use packed structure to map it to received mbuf instead of using dedicated parsing function. Modern compilers generate effective code in such case anyway.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/f495fa70 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f495fa70 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f495fa70 Branch: refs/heads/master Commit: f495fa70a9a4870f306b8248c79371a0c2bade83 Parents: ca16b6b Author: Szymon Janc <szymon.j...@codecoup.pl> Authored: Fri Mar 24 15:50:06 2017 +0100 Committer: Szymon Janc <szymon.j...@codecoup.pl> Committed: Mon Apr 10 11:31:33 2017 +0200 ---------------------------------------------------------------------- net/nimble/host/src/ble_att_clt.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f495fa70/net/nimble/host/src/ble_att_clt.c ---------------------------------------------------------------------- diff --git a/net/nimble/host/src/ble_att_clt.c b/net/nimble/host/src/ble_att_clt.c index 2666eb2..4a04e70 100644 --- a/net/nimble/host/src/ble_att_clt.c +++ b/net/nimble/host/src/ble_att_clt.c @@ -971,17 +971,15 @@ ble_att_clt_rx_exec_write(uint16_t conn_handle, struct os_mbuf **rxom) return BLE_HS_ENOTSUP; #endif - int rc; + /* TODO move this to common part + * Strip L2CAP ATT header from the front of the mbuf. + */ + os_mbuf_adj(*rxom, 1); BLE_ATT_LOG_EMPTY_CMD(0, "exec write rsp", conn_handle); - rc = ble_hs_mbuf_pullup_base(rxom, BLE_ATT_EXEC_WRITE_RSP_SZ); - if (rc == 0) { - ble_att_exec_write_rsp_parse((*rxom)->om_data, (*rxom)->om_len); - } - - ble_gattc_rx_exec_write_rsp(conn_handle, rc); - return rc; + ble_gattc_rx_exec_write_rsp(conn_handle, 0); + return 0; } /*****************************************************************************