http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_params_request.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_params_request.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_params_request.c deleted file mode 100644 index 8872c2c..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_params_request.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_evt_app.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "app_util.h" - -uint32_t ble_gap_evt_sec_params_request_dec(uint8_t const * const p_buf, - uint32_t packet_len, - ble_evt_t * const p_event, - uint32_t * const p_event_len) -{ - uint32_t index = 0; - uint32_t event_len; - uint32_t err_code = NRF_SUCCESS; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_event_len); - - SER_ASSERT_LENGTH_LEQ(7, packet_len); - - event_len = SER_EVT_CONN_HANDLE_SIZE + sizeof (ble_gap_evt_sec_params_request_t); - - if (p_event == NULL) - { - *p_event_len = event_len; - return NRF_SUCCESS; - } - - SER_ASSERT(event_len <= *p_event_len, NRF_ERROR_DATA_SIZE); - p_event->header.evt_id = BLE_GAP_EVT_SEC_PARAMS_REQUEST; - p_event->header.evt_len = event_len; - - err_code = uint16_t_dec(p_buf, packet_len, &index, &(p_event->evt.gap_evt.conn_handle)); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = ble_gap_evt_sec_params_request_t_dec(p_buf, packet_len, &index, &(p_event->evt.gap_evt.params.sec_params_request)); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - SER_ASSERT_LENGTH_EQ(index, packet_len); - - *p_event_len = event_len; - - return err_code; -}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_request.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_request.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_request.c deleted file mode 100644 index dc90202..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_sec_request.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include <string.h> - -#include "ble_gap_evt_app.h" -#include "ble_gap_struct_serialization.h" -#include "ble_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_evt_sec_request_dec(uint8_t const * const p_buf, - uint32_t packet_len, - ble_evt_t * const p_event, - uint32_t * const p_event_len) -{ - uint32_t index = 0; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_event_len); - - SER_ASSERT_LENGTH_LEQ(3, packet_len); - - uint32_t event_len = sizeof (ble_gap_evt_sec_request_t) + - sizeof (p_event->evt.gap_evt.conn_handle); - - if (p_event == NULL) - { - *p_event_len = event_len; - return NRF_SUCCESS; - } - - SER_ASSERT(event_len <= *p_event_len, NRF_ERROR_DATA_SIZE); - - p_event->header.evt_len = event_len; - uint16_dec(p_buf, packet_len, &index, &p_event->evt.gap_evt.conn_handle); - - ble_gap_evt_sec_request_t * p_decoded_evt = &(p_event->evt.gap_evt.params.sec_request); - - uint32_t err_code = ble_gap_evt_sec_request_t_dec(p_buf, packet_len, &index, p_decoded_evt); - if (err_code != NRF_SUCCESS) - { - return err_code; - } - - SER_ASSERT_LENGTH_EQ(index, packet_len); - *p_event_len = event_len; - - return NRF_SUCCESS; -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_timeout.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_timeout.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_timeout.c deleted file mode 100644 index 0d230f5..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_evt_timeout.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_evt_app.h" -#include "ble_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_evt_timeout_dec(uint8_t const * const p_buf, - uint32_t packet_len, - ble_evt_t * const p_event, - uint32_t * const p_event_len) -{ - uint32_t index = 0; - uint32_t event_len; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_event_len); - - SER_ASSERT_LENGTH_EQ(SER_EVT_CONN_HANDLE_SIZE + 1, packet_len); - - event_len = SER_EVT_CONN_HANDLE_SIZE + sizeof (ble_gap_evt_timeout_t); - - if (p_event == NULL) - { - *p_event_len = event_len; - return NRF_SUCCESS; - } - - SER_ASSERT(event_len <= *p_event_len, NRF_ERROR_DATA_SIZE); - - p_event->header.evt_id = BLE_GAP_EVT_TIMEOUT; - p_event->header.evt_len = event_len; - - uint16_dec(p_buf, packet_len, &index, &p_event->evt.gap_evt.conn_handle); - uint8_dec(p_buf, packet_len, &index, &p_event->evt.gap_evt.params.timeout.src); - - SER_ASSERT_LENGTH_EQ(index, packet_len); - - *p_event_len = event_len; - - return NRF_SUCCESS; -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_keypress_notify.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_keypress_notify.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_keypress_notify.c deleted file mode 100644 index 9b8a9ab..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_keypress_notify.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_keypress_notify_req_enc(uint16_t conn_handle, - uint8_t kp_not, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_KEYPRESS_NOTIFY; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint8_t_enc(&kp_not, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_keypress_notify_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_KEYPRESS_NOTIFY, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_dhkey_reply.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_dhkey_reply.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_dhkey_reply.c deleted file mode 100644 index 4326f82..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_dhkey_reply.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_lesc_dhkey_reply_req_enc(uint16_t conn_handle, - ble_gap_lesc_dhkey_t const *p_dhkey, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_LESC_DHKEY_REPLY; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_dhkey, p_buf, buf_len, &index, ble_gap_lesc_dhkey_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_lesc_dhkey_reply_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_LESC_DHKEY_REPLY, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_get.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_get.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_get.c deleted file mode 100644 index 8efc46b..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_get.c +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_lesc_oob_data_get_req_enc(uint16_t conn_handle, - ble_gap_lesc_p256_pk_t const *p_pk_own, - ble_gap_lesc_oob_data_t *p_oobd_own, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_LESC_OOB_DATA_GET; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_pk_own, p_buf, buf_len, &index, ble_gap_lesc_p256_pk_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_oobd_own, p_buf, buf_len, &index, NULL); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_lesc_oob_data_get_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - ble_gap_lesc_oob_data_t * *pp_oobd_own, - uint32_t * const p_result_code) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_result_code); - uint32_t index = 0; - uint32_t err_code = ser_ble_cmd_rsp_result_code_dec(p_buf, &index, packet_len, - SD_BLE_GAP_LESC_OOB_DATA_GET, - p_result_code); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - if (*p_result_code != NRF_SUCCESS) - { - SER_ASSERT_LENGTH_EQ(index, packet_len); - return NRF_SUCCESS; - } - - err_code = cond_field_dec(p_buf, packet_len, &index, (void * *)pp_oobd_own, - ble_gap_lesc_oob_data_t_dec); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - SER_ASSERT_LENGTH_EQ(index, packet_len); - - return err_code; -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_set.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_set.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_set.c deleted file mode 100644 index ebc1958..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_lesc_oob_data_set.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_lesc_oob_data_set_req_enc(uint16_t conn_handle, - ble_gap_lesc_oob_data_t const *p_oobd_own, - ble_gap_lesc_oob_data_t const *p_oobd_peer, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_LESC_OOB_DATA_SET; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_oobd_own, p_buf, buf_len, &index, ble_gap_lesc_oob_data_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_oobd_peer, p_buf, buf_len, &index, ble_gap_lesc_oob_data_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_lesc_oob_data_set_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_LESC_OOB_DATA_SET, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_get.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_get.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_get.c deleted file mode 100644 index 91c6cac..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_get.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" - - -uint32_t ble_gap_ppcp_get_req_enc(ble_gap_conn_params_t const * const p_conn_params, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - uint32_t index = 0; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - SER_ASSERT_LENGTH_LEQ(index + 1 + 1, *p_buf_len); - - p_buf[index++] = SD_BLE_GAP_PPCP_GET; - p_buf[index++] = (p_conn_params != NULL) ? SER_FIELD_PRESENT : SER_FIELD_NOT_PRESENT; - - *p_buf_len = index; - - return NRF_SUCCESS; -} - - -uint32_t ble_gap_ppcp_get_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - ble_gap_conn_params_t * const p_conn_params, - uint32_t * const p_result_code) -{ - uint32_t index = 0; - - uint32_t decode_result = ser_ble_cmd_rsp_result_code_dec(p_buf, &index, packet_len, - SD_BLE_GAP_PPCP_GET, p_result_code); - - if (decode_result != NRF_SUCCESS) - { - return decode_result; - } - - if (*p_result_code != NRF_SUCCESS) - { - return NRF_SUCCESS; - } - - SER_ASSERT_NOT_NULL(p_conn_params); - - SER_ASSERT_LENGTH_LEQ(index + 8, packet_len); - uint16_dec(p_buf, packet_len, &index, &p_conn_params->min_conn_interval); - uint16_dec(p_buf, packet_len, &index, &p_conn_params->max_conn_interval); - uint16_dec(p_buf, packet_len, &index, &p_conn_params->slave_latency); - uint16_dec(p_buf, packet_len, &index, &p_conn_params->conn_sup_timeout); - - SER_ASSERT_LENGTH_EQ(index, packet_len); - - return decode_result; -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_set.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_set.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_set.c deleted file mode 100644 index dc95078..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_ppcp_set.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include <stddef.h> -#include "nrf_error.h" -#include "ble_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_ppcp_set_req_enc(ble_gap_conn_params_t const * const p_conn_params, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - uint32_t index = 0; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - SER_ASSERT_LENGTH_LEQ(1 + 1, *p_buf_len); - - p_buf[index++] = SD_BLE_GAP_PPCP_SET; - p_buf[index++] = (p_conn_params != NULL) ? SER_FIELD_PRESENT : SER_FIELD_NOT_PRESENT; - - if (p_conn_params != NULL) - { - SER_ASSERT_LENGTH_LEQ(index + 8, *p_buf_len); - index += uint16_encode(p_conn_params->min_conn_interval, &p_buf[index]); - index += uint16_encode(p_conn_params->max_conn_interval, &p_buf[index]); - index += uint16_encode(p_conn_params->slave_latency, &p_buf[index]); - index += uint16_encode(p_conn_params->conn_sup_timeout, &p_buf[index]); - } - - *p_buf_len = index; - - return NRF_SUCCESS; -} - - -uint32_t ble_gap_ppcp_set_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_PPCP_SET, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_get.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_get.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_get.c deleted file mode 100644 index 6dd268d..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_get.c +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include <stdlib.h> -#include <string.h> -#include "ble_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - -uint32_t ble_gap_rssi_get_req_enc(uint16_t conn_handle, - int8_t const * const p_rssi, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - uint32_t index = 0; - uint32_t err_code = NRF_SUCCESS; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint32_t total_len = *p_buf_len; - SER_ASSERT_LENGTH_LEQ(index + 1, total_len); - - p_buf[index++] = SD_BLE_GAP_RSSI_GET; - - err_code = uint16_t_enc(&conn_handle, p_buf, total_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_rssi, p_buf, total_len, &index, NULL); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - - -uint32_t ble_gap_rssi_get_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - int8_t * const p_rssi, - uint32_t * const p_result_code) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_result_code); - - uint32_t index = 0; - uint32_t decode_result = ser_ble_cmd_rsp_result_code_dec(p_buf, - &index, - packet_len, - SD_BLE_GAP_RSSI_GET, - p_result_code); - - if (decode_result != NRF_SUCCESS) - { - return decode_result; - } - - if (*p_result_code != NRF_SUCCESS) - { - SER_ASSERT_LENGTH_EQ(index, packet_len); - return NRF_SUCCESS; - } - - decode_result = uint8_t_dec(p_buf, packet_len, &index, (uint8_t *) p_rssi); - SER_ASSERT(decode_result == NRF_SUCCESS, decode_result); - - SER_ASSERT_LENGTH_EQ(index, packet_len); - - return decode_result; -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_start.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_start.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_start.c deleted file mode 100644 index 0f069b7..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_start.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "app_util.h" - -uint32_t ble_gap_rssi_start_req_enc(uint16_t conn_handle, - uint8_t threshold_dbm, - uint8_t skip_count, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_RSSI_START; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint8_t_enc(&threshold_dbm, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint8_t_enc(&skip_count, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_rssi_start_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_RSSI_START, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_stop.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_stop.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_stop.c deleted file mode 100644 index 8507f0f..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_rssi_stop.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "app_util.h" - -uint32_t ble_gap_rssi_stop_req_enc(uint16_t conn_handle, - 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 err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - uint8_t op_code = SD_BLE_GAP_RSSI_STOP; - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_rssi_stop_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_RSSI_STOP, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_start.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_start.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_start.c deleted file mode 100644 index 62996ef..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_start.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "cond_field_serialization.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" - -uint32_t ble_gap_scan_start_req_enc(ble_gap_scan_params_t const * p_scan_params, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_SCAN_START; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - err_code = cond_field_enc(p_scan_params, p_buf, buf_len, &index, ble_gap_scan_params_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_scan_start_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_SCAN_START, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_stop.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_stop.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_stop.c deleted file mode 100644 index 342bb54..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_scan_stop.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" - -uint32_t ble_gap_scan_stop_req_enc(uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_SCAN_STOP; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_scan_stop_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_SCAN_STOP, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_info_reply.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_info_reply.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_info_reply.c deleted file mode 100644 index 1e0134c..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_info_reply.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include <string.h> -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "ble_gap.h" -#include "cond_field_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_sec_info_reply_req_enc(uint16_t conn_handle, - ble_gap_enc_info_t const * p_enc_info, - ble_gap_irk_t const * p_id_info, - ble_gap_sign_info_t const * p_sign_info, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_SEC_INFO_REPLY; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - SER_ASSERT_LENGTH_LEQ(index + 1, buf_len); - p_buf[index++] = (p_enc_info != NULL) ? SER_FIELD_PRESENT : SER_FIELD_NOT_PRESENT; - - if (p_enc_info != NULL) - { - SER_ASSERT_LENGTH_LEQ(index + BLE_GAP_SEC_KEY_LEN + 1, buf_len); - memcpy(&p_buf[index], p_enc_info->ltk, BLE_GAP_SEC_KEY_LEN); - index += BLE_GAP_SEC_KEY_LEN; - p_buf[index++] = (p_enc_info->auth | (p_enc_info->ltk_len << 1)); - } - - err_code = cond_field_enc(p_id_info, p_buf, buf_len, &index, ble_gap_irk_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - SER_ASSERT_LENGTH_LEQ(index + 1, buf_len); - p_buf[index++] = (p_sign_info != NULL) ? SER_FIELD_PRESENT : SER_FIELD_NOT_PRESENT; - - if (p_sign_info != NULL) - { - SER_ASSERT_LENGTH_LEQ(index + BLE_GAP_SEC_KEY_LEN, buf_len); - memcpy(&p_buf[index], p_sign_info->csrk, BLE_GAP_SEC_KEY_LEN); - index += BLE_GAP_SEC_KEY_LEN; - } - - *p_buf_len = index; - - return err_code; -} - - -uint32_t ble_gap_sec_info_reply_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_SEC_INFO_REPLY, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_params_reply.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_params_reply.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_params_reply.c deleted file mode 100644 index a199878..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_sec_params_reply.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "ble_gap_struct_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - - -uint32_t ble_gap_sec_params_reply_req_enc(uint16_t conn_handle, - uint8_t sec_status, - ble_gap_sec_params_t const * const p_sec_params, - ble_gap_sec_keyset_t const * const p_sec_keyset, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_SEC_PARAMS_REPLY; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint8_t_enc(&sec_status, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_sec_params, p_buf, buf_len, &index, ble_gap_sec_params_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_sec_keyset, p_buf, buf_len, &index, ble_gap_sec_keyset_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_sec_params_reply_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - ble_gap_sec_keyset_t const * const p_sec_keyset, - uint32_t * const p_result_code) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_result_code); - - uint32_t err_code = NRF_SUCCESS; - uint32_t index = 0; - - err_code = ser_ble_cmd_rsp_result_code_dec(p_buf, &index, packet_len, SD_BLE_GAP_SEC_PARAMS_REPLY, p_result_code); - - if (err_code != NRF_SUCCESS) - { - return err_code; - } - - if (*p_result_code != NRF_SUCCESS) - { - SER_ASSERT_LENGTH_EQ(index, packet_len); - return NRF_SUCCESS; - } - - SER_ASSERT_NOT_NULL(p_sec_keyset); - - err_code = cond_field_dec(p_buf, packet_len, &index, (void **)&p_sec_keyset, ble_gap_sec_keyset_t_dec); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - SER_ASSERT_LENGTH_EQ(index, packet_len); - - return err_code; -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_tx_power_set.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_tx_power_set.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_tx_power_set.c deleted file mode 100644 index a461338..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gap_tx_power_set.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gap_app.h" -#include "ble_serialization.h" -#include "app_util.h" - -uint32_t ble_gap_tx_power_set_req_enc(int8_t tx_power, - uint8_t * const p_buf, - uint32_t * const p_buf_len) -{ - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint8_t op_code = SD_BLE_GAP_TX_POWER_SET; - uint32_t err_code = NRF_SUCCESS; - uint32_t buf_len = *p_buf_len; - uint32_t index = 0; - - err_code = uint8_t_enc(&op_code, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint8_t_enc(&tx_power, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gap_tx_power_set_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GAP_TX_POWER_SET, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_app.h ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_app.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_app.h deleted file mode 100644 index 77cbd59..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_app.h +++ /dev/null @@ -1,451 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ -#ifndef BLE_GATTC_APP_H__ -#define BLE_GATTC_APP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @addtogroup ser_codecs Serialization codecs - * @ingroup ble_sdk_lib_serialization - */ - -/** - * @addtogroup ser_app_s130_codecs Application s130 codecs - * @ingroup ser_codecs - */ - -/**@file - * - * @defgroup ble_gattc_app GATTC Application command request encoders and command response decoders - * @{ - * @ingroup ser_app_s130_codecs - * - * @brief GATTC Application command request encoders and command response decoders. - */ -#include "ble_gattc.h" -#include "ble.h" - -/**@brief Encodes @ref sd_ble_gattc_primary_services_discover command request. - * - * @sa @ref nrf51_sd_ble_gattc_primary_services_discover_encoding for packet format, - * @ref ble_gattc_primary_services_discover_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] start_handle Handle to start searching from. - * @param[in] p_srvc_uuid Pointer to a @ref ble_uuid_t which indicates the service UUID to - * be found. If it is NULL, all primary services will be returned. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_primary_services_discover_req_enc(uint16_t conn_handle, - uint16_t start_handle, - ble_uuid_t const * const p_srvc_uuid, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_primary_services_discover command. - * - * @sa @ref nrf51_sd_ble_gattc_primary_services_discover_encoding for packet format, - * @ref ble_gattc_primary_services_discover_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_primary_services_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_descriptors_discover command request. - * - * @sa @ref nrf51_sd_ble_gattc_descriptors_discover_encoding for packet format, - * @ref ble_gattc_descriptors_discover_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_handle_range A pointer to the range of handles of the Service to perform - * this procedure on. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_descriptors_discover_req_enc( - uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len); - - -/**@brief Decodes response to @ref sd_ble_gattc_descriptors_discover command. - * - * @sa @ref nrf51_sd_ble_gattc_descriptors_discover_encoding for packet format, - * @ref ble_gattc_primary_services_discover_rsp_dec for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_descriptors_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_relationships_discover command request. - * - * @sa @ref nrf51_sd_ble_gattc_relationships_discover_encoding for packet format, - * @ref ble_gattc_relationships_discover_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_handle_range A pointer to the range of handles of the Service to perform - * this procedure on. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_relationships_discover_req_enc( - uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_relationships_discover command. - * - * @sa @ref nrf51_sd_ble_gattc_relationships_discover_encoding for packet format, - * @ref ble_gattc_relationships_discover_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_relationships_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_characteristics_discover command request. - * - * @sa @ref nrf51_sd_ble_gattc_characteristics_discover_encoding for packet format, - * @ref ble_gattc_characteristics_discover_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_handle_range A pointer to the range of handles of the Service to perform - * this procedure on. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_characteristics_discover_req_enc - (uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_characteristics_discover command. - * - * @sa @ref nrf51_sd_ble_gattc_characteristics_discover_encoding for packet format, - * @ref ble_gattc_primary_services_discover_rsp_dec for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_characteristics_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_read command request. - * - * @sa @ref nrf51_sd_ble_gattc_read_encoding for packet format, - * @ref ble_gattc_read_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] handle The handle of the attribute to be read. - * @param[in] offset Offset into the attribute value to be read. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_read_req_enc(uint16_t conn_handle, - uint16_t handle, - uint16_t offset, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_read command. - * - * @sa @ref nrf51_sd_ble_gattc_read_encoding for packet format, - * @ref ble_gattc_read_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_read_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_char_values_read command request. - * - * @sa @ref nrf51_sd_ble_gattc_char_values_read for packet format, - * @ref ble_gattc_char_values_read_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read. - * @param[in] handle_count The number of handles in p_handles. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_char_values_read_req_enc(uint16_t conn_handle, - uint16_t const * const p_handles, - uint16_t handle_count, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_char_values_read command. - * - * @sa @ref nrf51_sd_ble_gattc_char_values_read for packet format, - * @ref ble_gattc_char_values_read_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_char_values_read_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_write command request. - * - * @sa @ref nrf51_sd_ble_gattc_write_encoding for packet format, - * @ref ble_gattc_write_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_write_params Pointer to \ref sd_ble_gattc_write params. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_write_req_enc(uint16_t conn_handle, - ble_gattc_write_params_t const * const p_write_params, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_write command. - * - * @sa @ref nrf51_sd_ble_gattc_write_encoding for packet format, - * @ref ble_gattc_write_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_write_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_hv_confirm command request. - * - * @sa @ref nrf51_sd_ble_gattc_hv_confirm for packet format, - * @ref ble_gattc_hv_confirm_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] handle Handle of the attribute in the indication. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_hv_confirm_req_enc(uint16_t conn_handle, - uint16_t handle, - uint8_t * const p_buf, - uint32_t * const p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_hv_confirm command. - * - * @sa @ref nrf51_sd_ble_gattc_hv_confirm for packet format, - * @ref ble_gattc_hv_confirm_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Pointer to command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_hv_confirm_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_char_value_by_uuid_read command request. - * - * @sa @ref nrf51_sd_ble_gattc_char_value_by_uuid_read_encoding for packet format, - * @ref ble_gattc_char_value_by_uuid_read_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_uuid Pointer to a characteristic value UUID to read. - * @param[in] p_handle_range Pointer to the range of handles to perform this procedure on. - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_char_value_by_uuid_read_req_enc - (uint16_t conn_handle, - ble_uuid_t const * const p_uuid, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * const p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_char_value_by_uuid_read command. - * - * @sa @ref nrf51_sd_ble_gattc_char_value_by_uuid_read_encoding for packet format, - * @ref ble_gattc_char_value_by_uuid_read_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Pointer to command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_char_value_by_uuid_read_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); - -/**@brief Encodes @ref sd_ble_gattc_attr_info_discover command request. - * - * @sa @ref ble_gattc_attr_info_discover_rsp_dec for command response decoder. - * - * @param[in] conn_handle Connection handle of the connection. - * @param[in] p_handle_range Pointer to the range of handles - * @param[in] p_buf Pointer to buffer where encoded data command will be returned. - * @param[in, out] p_buf_len \c in: size of \p p_buf buffer. - * \c out: Length of encoded command 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_gattc_attr_info_discover_req_enc(uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len); - -/**@brief Decodes response to @ref sd_ble_gattc_attr_info_discover command. - * - * @sa @ref ble_gattc_attr_info_discover_req_enc for command request encoder. - * - * @param[in] p_buf Pointer to beginning of command response packet. - * @param[in] packet_len Length (in bytes) of response packet. - * @param[out] p_result_code Pointer to command response result code. - * - * @retval NRF_SUCCESS Decoding success. - * @retval NRF_ERROR_NULL Decoding failure. NULL pointer supplied. - * @retval NRF_ERROR_DATA_SIZE Decoding failure. Incorrect buffer length. - * @retval NRF_ERROR_INVALID_DATA Decoding failure. Decoded operation code does not match expected - * operation code. - */ -uint32_t ble_gattc_attr_info_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code); -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif - - http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_attr_info_discover.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_attr_info_discover.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_attr_info_discover.c deleted file mode 100644 index 3ae1c13..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_attr_info_discover.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gattc_app.h" -#include <string.h> -#include "ble_serialization.h" -#include "ble_gattc_struct_serialization.h" -#include "cond_field_serialization.h" -#include "app_util.h" - -uint32_t ble_gattc_attr_info_discover_req_enc(uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len) -{ - uint32_t index = 0; - uint32_t err_code; - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - SER_ASSERT_LENGTH_LEQ(index + 4, *p_buf_len); - - p_buf[index++] = SD_BLE_GATTC_ATTR_INFO_DISCOVER; - index += uint16_encode(conn_handle, &p_buf[index]); - - err_code = cond_field_enc(p_handle_range, p_buf, *p_buf_len, &index, ble_gattc_handle_range_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return NRF_SUCCESS; -} - - -uint32_t ble_gattc_attr_info_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GATTC_ATTR_INFO_DISCOVER, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_value_by_uuid_read.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_value_by_uuid_read.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_value_by_uuid_read.c deleted file mode 100644 index d9e55ea..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_value_by_uuid_read.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gattc_app.h" -#include "ble_serialization.h" -#include "ble_struct_serialization.h" -#include "ble_gattc_struct_serialization.h" -#include "cond_field_serialization.h" -#include "ble_types.h" -#include <string.h> - -uint32_t ble_gattc_char_value_by_uuid_read_req_enc - (uint16_t conn_handle, - ble_uuid_t const * const p_uuid, - ble_gattc_handle_range_t const * const p_handle_range, - 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 err_code; - uint32_t index = 0; - uint32_t buf_len = *p_buf_len; - uint8_t opcode = SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ; - - err_code = uint8_t_enc(&opcode, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_uuid, p_buf, buf_len, &index, ble_uuid_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - err_code = cond_field_enc(p_handle_range, p_buf, buf_len, &index, ble_gattc_handle_range_t_enc); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - - *p_buf_len = index; - - return err_code; -} - -uint32_t ble_gattc_char_value_by_uuid_read_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, - packet_len, - SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, - p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_values_read.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_values_read.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_values_read.c deleted file mode 100644 index 3ffbb7a..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_char_values_read.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gattc_app.h" -#include "ble_serialization.h" -#include "app_util.h" - -uint32_t ble_gattc_char_values_read_req_enc(uint16_t conn_handle, - uint16_t const * const p_handles, - uint16_t handle_count, - uint8_t * const p_buf, - uint32_t * p_buf_len) -{ - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - uint32_t index = 0; - uint32_t buf_len = *p_buf_len; - uint32_t err_code; - uint8_t opCode = SD_BLE_GATTC_CHAR_VALUES_READ; - - err_code = uint8_t_enc(&opCode, p_buf, *p_buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - err_code = uint16_t_enc(&conn_handle, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - err_code = count16_cond_data16_enc(p_handles, handle_count, p_buf, buf_len, &index); - SER_ASSERT(err_code == NRF_SUCCESS, err_code); - *p_buf_len = index; - return err_code; -} - - -uint32_t ble_gattc_char_values_read_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GATTC_CHAR_VALUES_READ, p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_characteristics_discover.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_characteristics_discover.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_characteristics_discover.c deleted file mode 100644 index 1be7548..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_characteristics_discover.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gattc_app.h" -#include "ble_serialization.h" -#include "app_util.h" - - -uint32_t ble_gattc_characteristics_discover_req_enc( - uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len) -{ - uint32_t index = 0; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - SER_ASSERT_LENGTH_LEQ(index + 1 + 2, *p_buf_len); - - p_buf[index++] = SD_BLE_GATTC_CHARACTERISTICS_DISCOVER; - index += uint16_encode(conn_handle, &p_buf[index]); - - SER_ASSERT_LENGTH_LEQ(index + 1, *p_buf_len); - p_buf[index++] = (p_handle_range != NULL) ? SER_FIELD_PRESENT : SER_FIELD_NOT_PRESENT; - - if (p_handle_range != NULL) - { - SER_ASSERT_LENGTH_LEQ(index + 2 + 2, *p_buf_len); - - index += uint16_encode(p_handle_range->start_handle, &p_buf[index]); - index += uint16_encode(p_handle_range->end_handle, &p_buf[index]); - } - - *p_buf_len = index; - - return NRF_SUCCESS; -} - - -uint32_t ble_gattc_characteristics_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, - p_result_code); -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_descriptors_discover.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_descriptors_discover.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_descriptors_discover.c deleted file mode 100644 index bf1bc69..0000000 --- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/serialization/application/codecs/s130/serializers/ble_gattc_descriptors_discover.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. - * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. - * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. - * - */ - -#include "ble_gattc_app.h" -#include "ble_serialization.h" -#include "app_util.h" - - -uint32_t ble_gattc_descriptors_discover_req_enc( - uint16_t conn_handle, - ble_gattc_handle_range_t const * const p_handle_range, - uint8_t * const p_buf, - uint32_t * p_buf_len) -{ - uint32_t index = 0; - - SER_ASSERT_NOT_NULL(p_buf); - SER_ASSERT_NOT_NULL(p_buf_len); - - SER_ASSERT_LENGTH_LEQ(index + 1 + 2 + 1, *p_buf_len); - - p_buf[index++] = SD_BLE_GATTC_DESCRIPTORS_DISCOVER; - index += uint16_encode(conn_handle, &p_buf[index]); - p_buf[index++] = (p_handle_range == NULL) ? SER_FIELD_NOT_PRESENT : SER_FIELD_PRESENT; - - if (p_handle_range != NULL) - { - SER_ASSERT_LENGTH_LEQ(index + 2 + 2, *p_buf_len); - index += uint16_encode(p_handle_range->start_handle, &p_buf[index]); - index += uint16_encode(p_handle_range->end_handle, &p_buf[index]); - } - - *p_buf_len = index; - - return NRF_SUCCESS; -} - - -uint32_t ble_gattc_descriptors_discover_rsp_dec(uint8_t const * const p_buf, - uint32_t packet_len, - uint32_t * const p_result_code) -{ - return ser_ble_cmd_rsp_dec(p_buf, packet_len, SD_BLE_GATTC_DESCRIPTORS_DISCOVER, p_result_code); -}
