From 3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 23 Aug 2018 17:08:59 +0200 Subject: o Initial import. --- .../connectivity/codecs/common/ble_dtm_conn.h | 113 +++++++++++ .../connectivity/codecs/common/ble_dtm_init.c | 83 ++++++++ .../connectivity/codecs/common/conn_mw.c | 107 ++++++++++ .../connectivity/codecs/common/conn_mw.h | 88 ++++++++ .../connectivity/codecs/common/conn_mw_items.c | 224 +++++++++++++++++++++ .../connectivity/codecs/common/conn_mw_nrf_soc.c | 114 +++++++++++ .../connectivity/codecs/common/conn_mw_nrf_soc.h | 118 +++++++++++ 7 files changed, 847 insertions(+) create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_conn.h create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_init.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.h create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_items.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.c create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.h (limited to 'thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common') diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_conn.h b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_conn.h new file mode 100644 index 0000000..53a80d2 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_conn.h @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef BLE_DTM_CONN_H__ +#define BLE_DTM_CONN_H__ + +/** + * @addtogroup ser_codecs_conn Connectivity codecs + * @ingroup ser_codecs + */ + +/** + * @addtogroup ser_conn_common_codecs Connectivity common codecs + * @ingroup ser_codecs_conn + */ + +/**@file + * + * @defgroup ble_dtm_conn DTM Connectivity command request decoder and command response encoder + * @{ + * @ingroup ser_conn_common_codecs + * + * @brief DTM Connectivity command request decoder and command response encoder. + */ + +#include "dtm_uart.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@brief Decodes @ref ble_dtm_init command request. + * + * @sa @ref encoding_data for packet format, + * @ref ble_dtm_init_rsp_enc for response encoding. + * + * @param[in] p_buf Pointer to beginning of command request packet. + * @param[in] packet_len Length (in bytes) of request packet. + * @param[in] p_comm_params Pointer to the structure with DTM UART configuration. + + * + * @retval NRF_SUCCESS Decoding success. + * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. + * @retval NRF_ERROR_INVALID_LENGTH Decoding failure. Incorrect buffer length. + */ +uint32_t ble_dtm_init_req_dec(uint8_t const * const p_buf, + uint16_t packet_len, + app_uart_stream_comm_params_t * p_comm_params); + + +/**@brief Encodes @ref ble_dtm_init command response. + * + * @sa @ref encoding_data for packet format. + * @ref ble_dtm_init_req_dec for request decoding. + * + * @param[in] return_code Return code indicating if command was successful or not. + * @param[out] p_buf Pointer to buffer where encoded data command response will be + * returned. + * @param[in,out] p_buf_len \c in: size of \p p_buf buffer. + * \c out: Length of encoded command response packet. + * + * @retval NRF_SUCCESS Encoding success. + * @retval NRF_ERROR_NULL Encoding failure. NULL pointer supplied. + * @retval NRF_ERROR_INVALID_LENGTH Encoding failure. Incorrect buffer length. + */ +uint32_t ble_dtm_init_rsp_enc(uint32_t return_code, + uint8_t * const p_buf, + uint32_t * const p_buf_len); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif // BLE_DTM_CONN_H__ + diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_init.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_init.c new file mode 100644 index 0000000..e9dfefa --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/ble_dtm_init.c @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include "ble_dtm_conn.h" +#include "dtm_uart.h" +#include "nrf_error.h" +#include "ble_serialization.h" + +uint32_t ble_dtm_init_req_dec(uint8_t const * const p_buf, uint16_t packet_len, + app_uart_stream_comm_params_t * p_comm_params) +{ + SER_ASSERT_NOT_NULL(p_buf); + SER_ASSERT_NOT_NULL(p_comm_params); + + uint32_t index = 0; + uint32_t err_code = NRF_SUCCESS; + + err_code = uint8_t_dec(p_buf, packet_len, &index, &p_comm_params->tx_pin_no); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + err_code = uint8_t_dec(p_buf, packet_len, &index, &p_comm_params->rx_pin_no); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + err_code = uint8_t_dec(p_buf, packet_len, &index, &p_comm_params->baud_rate); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + SER_ASSERT(index == packet_len, NRF_ERROR_INVALID_LENGTH); + + return err_code; +} + +uint32_t ble_dtm_init_rsp_enc(uint32_t return_code, uint8_t * const p_buf, + uint32_t * const p_buf_len) +{ + SER_ASSERT_NOT_NULL(p_buf); + SER_ASSERT_NOT_NULL(p_buf_len); + + uint32_t index = 0; + uint32_t err_code = NRF_SUCCESS; + + err_code = uint32_t_enc(&return_code, p_buf, *p_buf_len, &index); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + *p_buf_len = index; + + return err_code; +} diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.c new file mode 100644 index 0000000..fcd780c --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.c @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include + +#include "ble_serialization.h" +#include "nrf_soc.h" + +/**@brief Connectivity middleware handler type. */ +typedef uint32_t (*conn_mw_handler_t)(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len); + +/**@brief Connectivity middleware item. */ +typedef struct +{ + uint8_t opcode; /**< Opcode by which specific codec is identified */ + conn_mw_handler_t fp_handler; /**< Function pointer to handler associated with given opcode */ +} conn_mw_item_t; + +/* Include handlers for given softdevice */ +#include "conn_mw_items.c" + +/**@brief Number of registered connectivity middleware handlers. */ +static const uint32_t conn_mw_item_len = sizeof (conn_mw_item) / sizeof (conn_mw_item[0]); + +/**@brief Local function for finding connectivity middleware handler in the table.. */ +static conn_mw_handler_t conn_mw_handler_get(uint8_t opcode) +{ + conn_mw_handler_t fp_handler = NULL; + uint32_t i; + + for (i = 0; i < conn_mw_item_len; i++) + { + if (opcode == conn_mw_item[i].opcode) + { + fp_handler = conn_mw_item[i].fp_handler; + break; + } + } + + return fp_handler; +} + +uint32_t conn_mw_handler(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len) +{ + SER_ASSERT_NOT_NULL(p_rx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf_len); + + conn_mw_handler_t fp_handler; + uint32_t err_code = NRF_SUCCESS; + uint8_t opcode = p_rx_buf[SER_CMD_OP_CODE_POS]; + + fp_handler = conn_mw_handler_get(opcode); + + if (fp_handler) + { + err_code = fp_handler(p_rx_buf, rx_buf_len, p_tx_buf, p_tx_buf_len); + } + else + { + err_code = NRF_ERROR_NOT_SUPPORTED; + } + + return err_code; +} diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.h b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.h new file mode 100644 index 0000000..4ff3c8e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw.h @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef _CONN_MW_H +#define _CONN_MW_H + +/** + * @addtogroup ser_codecs_mw Connectivity middleware codecs + * @ingroup ser_codecs + */ + +/** + * @addtogroup ser_mw_common_codecs Connectivity middleware common codecs + * @{ + * @ingroup ser_codecs_mw + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**@brief Connectivity Middleware dispatcher function + * + * @details It will handle decode the opcode from the RX buffer and based on the opcode it will search + * for registered handler. Handler is called once it is found. + * + * @param[in] p_rx_buf Pointer to input buffer. + * @param[in] rx_buf_len Size of @p p_rx_buf. + * @param[out] p_tx_buf Pointer to output buffer. + * @param[in,out] p_tx_buf_len \c in: Size of \p p_tx_buf buffer. + * \c out: Length of valid data in \p p_tx_buf. + * + * @retval NRF_SUCCESS Handler success. + * @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied. + * @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length. + * @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type. + * @retval NRF_ERROR_NOT_SUPPORTED Handler failure. Opcode not supported. + */ +uint32_t conn_mw_handler (uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len); + +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif //_CONN_MW_H diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_items.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_items.c new file mode 100644 index 0000000..0502ada --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_items.c @@ -0,0 +1,224 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include "conn_mw_nrf_soc.h" +#if defined(BLE_STACK_SUPPORT_REQD) +#include "ble.h" +#include "ble_gap.h" +#include "ble_gattc.h" +#include "ble_gatts.h" + +#ifndef S112 +#include "ble_l2cap.h" +#endif //!S112 + +#include "conn_mw_ble.h" +#include "conn_mw_ble_l2cap.h" +#include "conn_mw_ble_gap.h" +#include "conn_mw_ble_gatts.h" +#include "conn_mw_ble_gattc.h" +#endif // defined(BLE_STACK_SUPPORT_REQD) +#if defined(ANT_STACK_SUPPORT_REQD) +#include "conn_mw_ant.h" +#include "ant_interface.h" +#endif // defined(ANT_STACK_SUPPORT_REQD) + +/**@brief Connectivity middleware handlers table. */ +static const conn_mw_item_t conn_mw_item[] = { + //Functions from nrf_soc.h + {SD_POWER_SYSTEM_OFF, conn_mw_power_system_off}, + {SD_TEMP_GET, conn_mw_temp_get}, + {SD_ECB_BLOCK_ENCRYPT, conn_mw_ecb_block_encrypt}, +#if defined(BLE_STACK_SUPPORT_REQD) + //Functions from ble.h +#if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4 + {SD_BLE_TX_PACKET_COUNT_GET, conn_mw_ble_tx_packet_count_get}, +#endif + {SD_BLE_UUID_VS_ADD, conn_mw_ble_uuid_vs_add}, + {SD_BLE_UUID_DECODE, conn_mw_ble_uuid_decode}, + {SD_BLE_UUID_ENCODE, conn_mw_ble_uuid_encode}, + {SD_BLE_VERSION_GET, conn_mw_ble_version_get}, + {SD_BLE_OPT_GET, conn_mw_ble_opt_get}, + {SD_BLE_OPT_SET, conn_mw_ble_opt_set}, + {SD_BLE_ENABLE, conn_mw_ble_enable}, + {SD_BLE_USER_MEM_REPLY, conn_mw_ble_user_mem_reply}, +#if NRF_SD_BLE_API_VERSION >= 4 + {SD_BLE_CFG_SET, conn_mw_ble_cfg_set}, +#endif + //Functions from ble_l2cap.h +#ifndef S112 +#if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4 + {SD_BLE_L2CAP_CID_REGISTER, conn_mw_ble_l2cap_cid_register}, + {SD_BLE_L2CAP_CID_UNREGISTER, conn_mw_ble_l2cap_cid_unregister}, + {SD_BLE_L2CAP_TX, conn_mw_ble_l2cap_tx}, +#elif defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION >= 5 + {SD_BLE_L2CAP_CH_SETUP, conn_mw_l2cap_ch_setup}, + {SD_BLE_L2CAP_CH_RELEASE, conn_mw_l2cap_ch_release}, + {SD_BLE_L2CAP_CH_RX, conn_mw_l2cap_ch_rx}, + {SD_BLE_L2CAP_CH_TX, conn_mw_l2cap_ch_tx}, + {SD_BLE_L2CAP_CH_FLOW_CONTROL, conn_mw_l2cap_ch_flow_control}, +#endif +#endif //!S112 + //Functions from ble_gap.h + {SD_BLE_GAP_ADDR_SET, conn_mw_ble_gap_addr_set}, + {SD_BLE_GAP_ADDR_GET, conn_mw_ble_gap_addr_get}, + {SD_BLE_GAP_PRIVACY_SET, conn_mw_ble_gap_privacy_set}, + {SD_BLE_GAP_PRIVACY_GET, conn_mw_ble_gap_privacy_get}, + {SD_BLE_GAP_WHITELIST_SET, conn_mw_ble_gap_whitelist_set}, + {SD_BLE_GAP_DEVICE_IDENTITIES_SET, conn_mw_ble_gap_device_identities_set}, +#ifndef S112 + {SD_BLE_GAP_SCAN_START, conn_mw_ble_gap_scan_start}, + {SD_BLE_GAP_SCAN_STOP, conn_mw_ble_gap_scan_stop}, + {SD_BLE_GAP_CONNECT, conn_mw_ble_gap_connect}, + {SD_BLE_GAP_CONNECT_CANCEL, conn_mw_ble_gap_connect_cancel}, + {SD_BLE_GAP_ENCRYPT, conn_mw_ble_gap_encrypt}, +#endif + {SD_BLE_GAP_SEC_INFO_REPLY, conn_mw_ble_gap_sec_info_reply}, +#if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 6 + {SD_BLE_GAP_ADV_DATA_SET, conn_mw_ble_gap_adv_data_set}, +#endif + {SD_BLE_GAP_ADV_START, conn_mw_ble_gap_adv_start}, + {SD_BLE_GAP_ADV_STOP, conn_mw_ble_gap_adv_stop}, + {SD_BLE_GAP_CONN_PARAM_UPDATE, conn_mw_ble_gap_conn_param_update}, + {SD_BLE_GAP_DISCONNECT, conn_mw_ble_gap_disconnect}, + {SD_BLE_GAP_TX_POWER_SET, conn_mw_ble_gap_tx_power_set}, + {SD_BLE_GAP_APPEARANCE_SET, conn_mw_ble_gap_appearance_set}, + {SD_BLE_GAP_APPEARANCE_GET, conn_mw_ble_gap_appearance_get}, + {SD_BLE_GAP_PPCP_SET, conn_mw_ble_gap_ppcp_set}, + {SD_BLE_GAP_PPCP_GET, conn_mw_ble_gap_ppcp_get}, + {SD_BLE_GAP_DEVICE_NAME_SET, conn_mw_ble_gap_device_name_set}, + {SD_BLE_GAP_DEVICE_NAME_GET, conn_mw_ble_gap_device_name_get}, + {SD_BLE_GAP_AUTHENTICATE, conn_mw_ble_gap_authenticate}, + {SD_BLE_GAP_SEC_PARAMS_REPLY, conn_mw_ble_gap_sec_params_reply}, + {SD_BLE_GAP_AUTH_KEY_REPLY, conn_mw_ble_gap_auth_key_reply}, + {SD_BLE_GAP_SEC_INFO_REPLY, conn_mw_ble_gap_sec_info_reply}, + {SD_BLE_GAP_CONN_SEC_GET, conn_mw_ble_gap_conn_sec_get}, + {SD_BLE_GAP_RSSI_START, conn_mw_ble_gap_rssi_start}, + {SD_BLE_GAP_RSSI_STOP, conn_mw_ble_gap_rssi_stop}, + {SD_BLE_GAP_KEYPRESS_NOTIFY, conn_mw_ble_gap_keypress_notify}, + {SD_BLE_GAP_LESC_DHKEY_REPLY, conn_mw_ble_gap_lesc_dhkey_reply}, + {SD_BLE_GAP_LESC_OOB_DATA_SET, conn_mw_ble_gap_lesc_oob_data_set}, + {SD_BLE_GAP_LESC_OOB_DATA_GET, conn_mw_ble_gap_lesc_oob_data_get}, + {SD_BLE_GAP_RSSI_GET, conn_mw_ble_gap_rssi_get}, +#if NRF_SD_BLE_API_VERSION >= 5 + {SD_BLE_GAP_PHY_UPDATE, conn_mw_ble_gap_phy_update}, +#endif +#if NRF_SD_BLE_API_VERSION >= 4 && !defined(S112) + {SD_BLE_GAP_DATA_LENGTH_UPDATE, conn_mw_ble_gap_data_length_update}, +#endif +#if NRF_SD_BLE_API_VERSION > 5 + {SD_BLE_GAP_ADV_SET_CONFIGURE, conn_mw_ble_gap_adv_set_configure}, +#ifndef S112 + {SD_BLE_GAP_QOS_CHANNEL_SURVEY_START, conn_mw_ble_gap_qos_channel_survey_start}, + {SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP, conn_mw_ble_gap_qos_channel_survey_stop}, +#endif //!S112 +#endif + //Functions from ble_gattc.h + {SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER, conn_mw_ble_gattc_primary_services_discover}, + {SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, conn_mw_ble_gattc_relationships_discover}, + {SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, conn_mw_ble_gattc_characteristics_discover}, + {SD_BLE_GATTC_DESCRIPTORS_DISCOVER, conn_mw_ble_gattc_descriptors_discover}, + {SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, conn_mw_ble_gattc_char_value_by_uuid_read}, + {SD_BLE_GATTC_READ, conn_mw_ble_gattc_read}, + {SD_BLE_GATTC_CHAR_VALUES_READ, conn_mw_ble_gattc_char_values_read}, + {SD_BLE_GATTC_WRITE, conn_mw_ble_gattc_write}, + {SD_BLE_GATTC_HV_CONFIRM, conn_mw_ble_gattc_hv_confirm}, + {SD_BLE_GATTC_ATTR_INFO_DISCOVER, conn_mw_ble_gattc_attr_info_discover}, + {SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, conn_mw_ble_gattc_exchange_mtu_request}, + //Functions from ble_gatts.h + {SD_BLE_GATTS_SERVICE_ADD, conn_mw_ble_gatts_service_add}, + {SD_BLE_GATTS_INCLUDE_ADD, conn_mw_ble_gatts_include_add}, + {SD_BLE_GATTS_CHARACTERISTIC_ADD, conn_mw_ble_gatts_characteristic_add}, + {SD_BLE_GATTS_DESCRIPTOR_ADD, conn_mw_ble_gatts_descriptor_add}, + {SD_BLE_GATTS_VALUE_SET, conn_mw_ble_gatts_value_set}, + {SD_BLE_GATTS_VALUE_GET, conn_mw_ble_gatts_value_get}, + {SD_BLE_GATTS_HVX, conn_mw_ble_gatts_hvx}, + {SD_BLE_GATTS_SERVICE_CHANGED, conn_mw_ble_gatts_service_changed}, + {SD_BLE_GATTS_RW_AUTHORIZE_REPLY, conn_mw_ble_gatts_rw_authorize_reply}, + {SD_BLE_GATTS_SYS_ATTR_SET, conn_mw_ble_gatts_sys_attr_set}, + {SD_BLE_GATTS_SYS_ATTR_GET, conn_mw_ble_gatts_sys_attr_get}, + {SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, conn_mw_ble_gatts_initial_user_handle_get}, + {SD_BLE_GATTS_ATTR_GET, conn_mw_ble_gatts_attr_get}, + {SD_BLE_GATTS_EXCHANGE_MTU_REPLY, conn_mw_ble_gatts_exchange_mtu_reply}, +#endif // // defined(BLE_STACK_SUPPORT_REQD) +#if defined(ANT_STACK_SUPPORT_REQD) + //Functions from ant_interface.h + {SVC_ANT_ENABLE, conn_mw_ant_enable}, + {SVC_ANT_CHANNEL_ASSIGN, conn_ant_channel_assign}, + {SVC_ANT_CHANNEL_OPEN, conn_ant_channel_open_with_offset}, + {SVC_ANT_CHANNEL_ID_SET, conn_ant_channel_id_set}, + {SVC_ANT_CHANNEL_PERIOD_SET, conn_ant_channel_period_set}, + {SVC_ANT_CHANNEL_RADIO_FREQ_SET, conn_ant_channel_radio_freq_set}, + {SVC_ANT_TX_BROADCAST_MESSAGE, conn_ant_broadcast_message_tx}, + {SVC_ANT_TX_ACKNOWLEDGED_MESSAGE, conn_ant_acknowledge_message_tx}, + {SVC_ANT_CHANNEL_UNASSIGN, conn_ant_channel_unassign}, + {SVC_ANT_CHANNEL_CLOSE, conn_ant_channel_close}, + {SVC_ANT_NETWORK_KEY_SET, conn_ant_network_address_set}, + {SVC_ANT_CHANNEL_RADIO_TX_POWER_SET, conn_ant_channel_radio_tx_power_set}, + {SVC_ANT_CHANNEL_SEARCH_TIMEOUT_SET, conn_ant_channel_rx_search_timeout_set}, + {SVC_ANT_CHANNEL_LOW_PRIO_RX_SEARCH_TIMEOUT_SET, conn_ant_channel_low_priority_rx_search_timeout_set}, + {SVC_ANT_PROX_SEARCH_SET, conn_ant_prox_search_set}, + {SVC_ANT_SEARCH_WAVEFORM_SET, conn_ant_search_waveform_set}, + {SVC_ANT_CHANNEL_ID_GET, conn_ant_channel_id_get}, + {SVC_ANT_CHANNEL_RADIO_FREQ_GET, conn_ant_channel_radio_freq_get}, + {SVC_ANT_CHANNEL_PERIOD_GET, conn_ant_channel_period_get}, + {SVC_ANT_SEARCH_CHANNEL_PRIORITY_SET, conn_ant_search_channel_priority_set}, + {SVC_ANT_ACTIVE_SEARCH_SHARING_CYCLES_SET, conn_ant_active_search_sharing_cycles_set}, + {SVC_ANT_LIB_CONFIG_SET, conn_ant_lib_config_set}, + {SVC_ANT_ACTIVE_SEARCH_SHARING_CYCLES_GET, conn_ant_active_search_sharing_cycles_get}, + {SVC_ANT_LIB_CONFIG_GET, conn_ant_lib_config_get}, + {SVC_ANT_LIB_CONFIG_CLEAR, conn_ant_lib_config_clear}, + {SVC_ANT_STACK_INIT, conn_ant_stack_reset}, + {SVC_ANT_RX_SCAN_MODE_START, conn_ant_rx_scan_mode_start}, + {SVC_ANT_ID_LIST_ADD, conn_ant_id_list_add}, + {SVC_ANT_ID_LIST_CONFIG, conn_ant_id_list_config}, + {SVC_ANT_CHANNEL_STATUS_GET, conn_ant_channel_status_get}, + {SVC_ANT_INIT_CW_TEST_MODE, conn_ant_cw_test_mode_init}, + {SVC_ANT_CW_TEST_MODE, conn_ant_cw_test_mode}, + {SVC_ANT_VERSION, conn_ant_version_get}, + {SVC_ANT_CAPABILITIES, conn_ant_capabilities_get}, + {SVC_ANT_CRYPTO_CHANNEL_ENABLE, conn_ant_crypto_channel_enable}, + {SVC_ANT_ADV_BURST_CONFIG_SET, conn_ant_adv_burst_config_set}, + {SVC_ANT_CRYPTO_KEY_SET, conn_ant_crypto_key_set}, + {SVC_ANT_CRYPTO_INFO_SET, conn_ant_crypto_info_set}, + {SVC_ANT_CRYPTO_INFO_GET, conn_ant_crypto_info_get}, + {SVC_ANT_COEX_CONFIG_SET, conn_ant_coex_config_set}, + {SVC_ANT_COEX_CONFIG_GET, conn_ant_coex_config_get}, +#endif // // defined(ANT_STACK_SUPPORT_REQD) +}; diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.c b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.c new file mode 100644 index 0000000..62d034e --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.c @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include "nrf_soc_conn.h" +#include "conn_mw_nrf_soc.h" +#include "ble_serialization.h" + +uint32_t conn_mw_power_system_off(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len) +{ + SER_ASSERT_NOT_NULL(p_rx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf_len); + + uint32_t err_code = NRF_SUCCESS; + + err_code = power_system_off_req_dec(p_rx_buf, rx_buf_len); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + err_code = sd_power_system_off(); + /* There should be no return from sd_power_system_off() */ + + return err_code; +} + +uint32_t conn_mw_temp_get(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len) +{ + SER_ASSERT_NOT_NULL(p_rx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf_len); + + int32_t temperature; + int32_t * p_temperature = &temperature; + + uint32_t err_code = NRF_SUCCESS; + uint32_t sd_err_code; + + err_code = temp_get_req_dec(p_rx_buf, rx_buf_len, &p_temperature); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + sd_err_code = sd_temp_get(p_temperature); + + err_code = temp_get_rsp_enc(sd_err_code, p_tx_buf, p_tx_buf_len, p_temperature); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + return err_code; +} + +uint32_t conn_mw_ecb_block_encrypt(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len) +{ + SER_ASSERT_NOT_NULL(p_rx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf); + SER_ASSERT_NOT_NULL(p_tx_buf_len); + + nrf_ecb_hal_data_t ecb_data; + nrf_ecb_hal_data_t * p_ecb_data = &ecb_data; + + uint32_t err_code = NRF_SUCCESS; + uint32_t sd_err_code; + + err_code = ecb_block_encrypt_req_dec(p_rx_buf, rx_buf_len, &p_ecb_data); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + sd_err_code = sd_ecb_block_encrypt(p_ecb_data); + + err_code = ecb_block_encrypt_rsp_enc(sd_err_code, p_tx_buf, p_tx_buf_len, p_ecb_data); + SER_ASSERT(err_code == NRF_SUCCESS, err_code); + + return err_code; +} diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.h b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.h new file mode 100644 index 0000000..7e029db --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/components/serialization/connectivity/codecs/common/conn_mw_nrf_soc.h @@ -0,0 +1,118 @@ +/** + * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef CONN_MW_NRF_SOC_H__ +#define CONN_MW_NRF_SOC_H__ + +/** + * @addtogroup ser_mw_common_codecs + * @{ + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**@brief Handles @ref sd_power_system_off command request. + * + * @param[in] p_rx_buf Pointer to input buffer. + * @param[in] rx_buf_len Size of @p p_rx_buf. + * @param[out] p_tx_buf Pointer to output buffer. + * @param[in,out] p_tx_buf_len \c in: Size of \p p_tx_buf buffer. + * \c out: Length of valid data in \p p_tx_buf. + * + * @retval NRF_SUCCESS Handler success. + * @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied. + * @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length. + * @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type. + * @retval NRF_ERROR_NOT_SUPPORTED Handler failure. Opcode not supported. + */ +uint32_t conn_mw_power_system_off(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len); + +/**@brief Handles @ref sd_temp_get command request and prepares response. + * + * @param[in] p_rx_buf Pointer to input buffer. + * @param[in] rx_buf_len Size of @p p_rx_buf. + * @param[out] p_tx_buf Pointer to output buffer. + * @param[in,out] p_tx_buf_len \c in: Size of \p p_tx_buf buffer. + * \c out: Length of valid data in \p p_tx_buf. + * + * @retval NRF_SUCCESS Handler success. + * @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied. + * @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length. + * @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type. + * @retval NRF_ERROR_NOT_SUPPORTED Handler failure. Opcode not supported. + */ +uint32_t conn_mw_temp_get(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len); + +/**@brief Handles @ref sd_ecb_block_encrypt command request and prepares response. + * + * @param[in] p_rx_buf Pointer to input buffer. + * @param[in] rx_buf_len Size of @p p_rx_buf. + * @param[out] p_tx_buf Pointer to output buffer. + * @param[in,out] p_tx_buf_len \c in: Size of \p p_tx_buf buffer. + * \c out: Length of valid data in \p p_tx_buf. + * + * @retval NRF_SUCCESS Handler success. + * @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied. + * @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length. + * @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type. + * @retval NRF_ERROR_NOT_SUPPORTED Handler failure. Opcode not supported. + */ +uint32_t conn_mw_ecb_block_encrypt(uint8_t const * const p_rx_buf, + uint32_t rx_buf_len, + uint8_t * const p_tx_buf, + uint32_t * const p_tx_buf_len); + + +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif -- cgit v1.2.3