diff --git a/epicardium/ble/ble_attc.c b/epicardium/ble/ble_attc.c index ea4c69de3feecf60e92eb03d4f06b48227639446..e9e29053174975be6d41f069b4ecc0a1e53ea126 100644 --- a/epicardium/ble/ble_attc.c +++ b/epicardium/ble/ble_attc.c @@ -73,6 +73,8 @@ static const attcDiscCfg_t bleDiscCfgList[] = /* Write: GATT service changed ccc descriptor */ {bleGattScCccVal, sizeof(bleGattScCccVal), (GATT_SC_CCC_HDL_IDX + BLE_DISC_GATT_START)}, + {NULL, 0, (GAP_DN_HDL_IDX + BLE_DISC_GAP_START)}, + /* Read: GAP central address resolution attribute */ {NULL, 0, (GAP_CAR_HDL_IDX + BLE_DISC_GAP_START)}, diff --git a/epicardium/ble/profiles/gap_api.h b/epicardium/ble/profiles/gap_api.h index b1838162c9fe9525015573034d50ccbe4b8350e4..912e9759faa8093833b43aeb977463405b11eaec 100644 --- a/epicardium/ble/profiles/gap_api.h +++ b/epicardium/ble/profiles/gap_api.h @@ -35,6 +35,7 @@ extern "C" { /*! \brief Enumeration of handle indexes of characteristics to be discovered */ enum { + GAP_DN_HDL_IDX, GAP_CAR_HDL_IDX, /*!< \brief Central Address Resolution */ GAP_RPAO_HDL_IDX, /*!< \brief Resolvable Private Address Only */ GAP_HDL_LIST_LEN /*!< \brief Handle list length */ diff --git a/epicardium/ble/profiles/gap_main.c b/epicardium/ble/profiles/gap_main.c index baa16b940121e26a262f8f86825b28f5985a14b0..d11aabe1b4c8086bd24d3c0bc3e5152d03dddb82 100644 --- a/epicardium/ble/profiles/gap_main.c +++ b/epicardium/ble/profiles/gap_main.c @@ -22,13 +22,24 @@ #include "wsf_trace.h" #include "app_db.h" #include "app_api.h" -#include "gap/gap_api.h" +#include "gap_api.h" + +/* card10: + * copied from lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gap/gap_main.c + */ +/* clang-format off */ +/* clang-formet turned off for easier diffing against orginal file */ /************************************************************************************************** Local Variables **************************************************************************************************/ /*! GAP service characteristics for discovery */ +static const attcDiscChar_t gapDn = +{ + attDnChUuid, + 0 +}; /*! Central Address Resolution */ static const attcDiscChar_t gapCar = @@ -47,6 +58,7 @@ static const attcDiscChar_t gapRpao = /*! List of characteristics to be discovered; order matches handle index enumeration */ static const attcDiscChar_t *gapDiscCharList[] = { + &gapDn, &gapCar, /* Central Address Resolution */ &gapRpao /* Resolvable Private Address Only */ }; @@ -90,8 +102,12 @@ uint8_t GapValueUpdate(uint16_t *pHdlList, attEvt_t *pMsg) { uint8_t status = ATT_SUCCESS; + /* device name string */ + if (pMsg->handle == pHdlList[GAP_DN_HDL_IDX]) + { + } /* Central Address Resolution */ - if (pMsg->handle == pHdlList[GAP_CAR_HDL_IDX]) + else if (pMsg->handle == pHdlList[GAP_CAR_HDL_IDX]) { appDbHdl_t dbHdl; @@ -120,3 +136,4 @@ uint8_t GapValueUpdate(uint16_t *pHdlList, attEvt_t *pMsg) return status; } +/* clang-format on */